You are not logged in.
I dont think this needed to be split off. It was just a few passing comments. Ive renamed it to community radio, so it can include other countries.
dice wrote:GlennW wrote:since noscript became scarce and problematic, im using "Palemoon" and "eMatrix" for my main browser.
I use other browsers for smaller jobs, like ff for internet radio (4zzz). Just adding my support...
fellow aussie? i listen to 4zzz on sundays for the doc and the metal maiden. Im assuming you are listening to the same 4zzz i am?
Absolutely! But there's been a shake up lately, no more jazz show sundy morn... but plenty of new shows coming through.
I love the format, and the energy. Peace Brother!
Cool. Yeah i listen to the channel off and on, they have a real diverse spectrum of music. Good community radio run by volunteers.
✌
Sorry for OT - OP.
This was split from another thread where i went off topic. Share a station you enjoy here we can all listen to from online.
since noscript became scarce and problematic, im using "Palemoon" and "eMatrix" for my main browser.
I use other browsers for smaller jobs, like ff for internet radio (4zzz). Just adding my support...
fellow aussie? i listen to 4zzz on sundays for the doc and the metal maiden. Im assuming you are listening to the same 4zzz i am?
I don't think an init script would be appropriate for a per-user script running something in an X session. It is possible to run services just for one user and with the various permissions required for X with systemd but I don't know how to do that with other service managers.
It is possible, i just need to figure it out.
dice wrote:I could try and daemonize it but that would be similar to a while loop script i think?
Not sure what you mean by "daemonize it" but as written the script only runs through once so it can't change the wallpaper unless it is run again at some point.
Why don't you like the while loop? It only runs three very simple shell commands & feh every ten minutes so it's not exactly resource heavy.
I was just trying to think outside the box, explore other ways if there are any.
By daemonize i mean create an init script. Start stop daemon if possible ?
Think i have figured it out without a while loop. This script should just set the background between the hours specified.
EDIT: oops no it wont. I could try and daemonize it but that would be similar to a while loop script i think?
#!/usr/bin/env bash
H=$(date +%H)
if (( 7 <= 10#$H && 10#$H < 13 )); then
feh --bg-scale /usr/share/backgrounds/gnome/adwaita-morning.jpg
echo between 8AM and 1PM
elif (( 13 <= 10#$H && 10#$H < 19 )); then
feh --bg-scale /usr/share/backgrounds/gnome/adwaita-day.jpg
echo between 1PM and 7PM
else
feh --bg-scale /usr/share/backgrounds/gnome/adwaita-night.jpg
echo night
fi
I give in, looks like a while loop is the way to go, below is a variant. Hoping this works...
#!/usr/bin/env bash
get_wall () {
H=$(date +%H)
if (( 7 <= 10#$H && 10#$H < 13 )); then
feh --bg-scale /usr/share/backgrounds/gnome/adwaita-morning.jpg
echo between 8AM and 1PM
elif (( 13 <= 10#$H && 10#$H < 19 )); then
feh --bg-scale /usr/share/backgrounds/gnome/adwaita-day.jpg
echo between 1PM and 7PM
else
feh --bg-scale /usr/share/backgrounds/gnome/adwaita-night.jpg
echo night
fi
}
while true; do
get_wall;
sleep 600;
done
Thats a good one head on a stick, no need for "at" at all indeed.
I tried to make something that wasnt in a while loop and have come up with the below, i would like to add in a 3rd command so it is 3 times of day (morn, day, night) but cant figure that out.
#!/usr/bin/env bash
DATE=$(date +%p)
DATE2=$(date +%p)
MORNING="AM"
NIGHT="PM"
if [[ "$DATE" == "$MORNING" ]] ; then
feh --bg-scale /usr/share/backgrounds/gnome/adwaita-morning.jpg
elif [[ "$DATE2" == "$NIGHT" ]] ; then
feh --bg-scale /usr/share/backgrounds/gnome/adwaita-night.jpg
fi
Thanks for your help head on a stick, what do you think of below script? It works for me, sets the background in 1 minute increments x 3 using command functions in parallel. Im thinking if i put this in my autostart file (.xinitrc) with the correct time/date (today) it should suffice to emulate how the gnome backgrounds function for these wallpapers. The only issue i see is that the wallpapers wont load up if the "at" command is used in the past, it will fail and ill have a blank background. Ill have to figure out the time specifications better maybe.
#!/usr/bin/env bash
morning () {
at now + 1 minute <<< 'DISPLAY=:0 feh --bg-scale /usr/share/backgrounds/gnome/adwaita-morning.jpg'
}
day () {
at now + 2 minute <<< 'DISPLAY=:0 feh --bg-scale /usr/share/backgrounds/gnome/adwaita-day.jpg'
}
night () {
at now + 3 minute <<< 'DISPLAY=:0 feh --bg-scale /usr/share/backgrounds/gnome/adwaita-night.jpg'
}
morning && day && night
dice wrote:but this below would not work as a line not broken.
echo 'DISPLAY=:0 $HOME/bin/fehrand' > ~/test at now + 1 minute -f ~/test
I don't think $HOME will be understood unless you specify it (replace $user with the actual username):
echo 'DISPLAY=:0 HOME=/home/$user $HOME/bin/fehrand' > ~/test at now + 1 minute -f ~/test
Or just call the full path to the script, which would be simpler.
im just not using full paths publicly on the forum.
Think i have it, thanks head on a stick. Need to adjust times and add into a startup script, but this is what im after...
echo 'DISPLAY=:0 feh --bg-scale /usr/share/backgrounds/gnome/adwaita-morning.jpg' > ~/test
at now + 1 minute -f ~/test
echo 'DISPLAY=:0 feh --bg-scale /usr/share/backgrounds/gnome/adwaita-day.jpg' > ~/test
at now + 1 minute -f ~/test
echo 'DISPLAY=:0 feh --bg-scale /usr/share/backgrounds/gnome/adwaita-night.jpg' > ~/test
at now + 1 minute -f ~/test
Thanks head on a stick.
I cant understand how the command is laid out though. very strange if you ask me.
This below worked for a feh command.
echo 'DISPLAY=:0 $HOME/bin/fehrand' > ~/test
at now + 1 minute -f ~/test
but this below would not work as a line not broken.
echo 'DISPLAY=:0 $HOME/bin/fehrand' > ~/test at now + 1 minute -f ~/test
home env variable added to the code quotes.
contents of fehrand
#!/bin/bash
feh --randomize --bg-scale /usr/share/backgrounds/*
yeah made me a bit angry as well. I will have to try and incorporate cron into what im thinking of. I wanted to emulate gnome backgrounds adwaita morning noon night wallpapers somehow with feh.
Im trying to figure out the at command without much luck.
at executes commands at a specified time.
https://packages.debian.org/bullseye/at
i have the atd daemon running in service
~ $ > service atd status
atd is running
Im not sure what im to expect but im pretty sure a terminal window should appear in 1 minute from executing the at command using these commands?
~ $ > at now + 1 minute -f /usr/local/bin/st
warning: commands will be executed using /bin/sh
job 21 at Sat Dec 12 23:37:00 2020
Nothing happens ??
Im want to integrate at into a script somehow but if it doesnt work on the commandline then its useless or im useless and dont know what im doing.
This is a chimaera/testing installation.
dice wrote:Also most crypto software uses broken AES or asymmetric crypto soon broken by The Shor's Algorithm with Quantum Computers.
Today's global cyber espionage can only be stopped by One-Time Pad File Encryption. That's why FinalCrypt.What a load of crap...
That was an interesting read. So doubling the key size may effectively block quantum attacks.
dice wrote:https://github.com/S2-/sshenc.sh/
& this is a good one time pad shell script: https://snippets.bentasker.co.uk/page-1 … -BASH.html
Thank you dice, i will see how this run in the distribution in order to replace "finalcrypt". [ ]
They were just some examples to think about.
There is also https://packages.debian.org/buster/otp
Generator for One Time Pads or Passwords
otp creates key and password lists for verification and security purposes in a variety of formats. Keys can be of any length, consist of digits or letters (capital or lower case), and alphabetic passwords can either be entirely random (most secure) or obey the digraph statistics of English text (easier to remember when transcribing, but less secure).For computer applications, for example one-time login passwords, otp can create a file containing the MD5 signature of each of the generated keys. This permits the computer to verify keys without the need to store the keys in plaintext.
neither am i.
Another unique approach to file encryption in this link from stackoverflow using perl6.
https://stackoverflow.com/questions/540 … 4#54093334
and or shell level.
https://github.com/S2-/sshenc.sh/
& this is a good one time pad shell script: https://snippets.bentasker.co.uk/page-1 … -BASH.html
Interesting spin, seems you have packed in some programs that are not in the stable or testing repos.
For instance finalcrypt. The website for that program doesnt even have https enabled and the program uses java.
https://github.com/ron-from-nl/FinalCrypt
FinalCrypt - The No¹ One-Time Pad Encryption
Why FinalCrypt ?
Today's cyber espionage comes from hidden spyware waiting for you to unlock your drive. Disk Encryption no longer protects!
Even when you're logged on, unopened files have to remain encrypted. Only File Encryption stops spyware reading your files.
Also most crypto software uses broken AES or asymmetric crypto soon broken by The Shor's Algorithm with Quantum Computers.
Today's global cyber espionage can only be stopped by One-Time Pad File Encryption. That's why FinalCrypt.
Is AES broken ?
what fsmithred said. Its just a matter of getting the update to work properly i think?
Possible mirror outage during update.
Wait awhile and do what apt says. Use apt-get. This happened to me when i upgraded from beowulf to chimaera.
maybe run apt-get update or try with --fix-missing?
I tried to use gvim as root to open /usr/share/X11/xorg.conf.d/10-backlight.conf i got the same error message. My guess is it is a limitation for running a gui application as root user, a safeguard built into gvim.
I could use gvim as sudo for the same command though.
as promised, the yad exit icons. They are just recolored #15539E papirus 24x24 action and panel icons done in inkscape, all credit to papirus icons.
https://notabug.org/dice_1/dotfiles/src … with-icons
no longer available, deleted repo. The idea was no good anyway, i cant figure out how to save svg file properly.
Im very novice at scripts, i had thought that they could just be /bin/sh, thanks.
Ahh yes i forgot yad had a calendar function, i will have to incorporate that instead maybe, although does gsimplecal have a bit more functionality than yad calendar? i will have to find out.
Having discovered the wonderful yad program awhile back i have revisited it and give you the following cool scripts. The calendar is mainly a good script to use for the dwm statusbar with the systray patch.
Yad exit menu with papirus icons, this needs elogind to work, you could swap out the commands with sudo though.
Xscreensaver for locking, all other locking programs dont quite compare to it.
#!/usr/bin/env bash
yad-cancel() {
kill -USR1 $YAD_PID
}
export -f yad-cancel
yad --no-buttons --close-on-unfocus --width 200 --height 50 --form --columns 5 --borders=20 --center --on-top \
--field=Lock!"$HOME/bin/exit-icons/lock.svg":fbtn "xscreensaver-command -l" \
--field=Logout!"$HOME/bin/exit-icons/logout.svg":fbtn "pkill -U $USER" \
--field=Reboot!"$HOME/bin/exit-icons/reboot.svg":fbtn "loginctl reboot" \
--field=Poweroff!"$HOME/bin/exit-icons/poweroff.svg":fbtn "loginctl poweroff" \
--field=Cancel!"$HOME/bin/exit-icons/close.svg":fbtn "bash -c yad-cancel"
Yad notification calendar using gsimplecal.
#!/usr/bin/env bash
yad --notification \
--image="/usr/share/icons/Papirus-Dark/24x24/apps/office-calendar.svg" \
--command="gsimplecal" --text="$(date)" \
Some scrots
EDIT: calendar tooltip --text="$(date)" needs a 60 second loop, not sure how to implement that alongside yad?
UPDATE 12/12/20 : for yad exit menu using a newer version of yad (on artixlinux), i can call the icons from /usr/share/icons/Papirus as per below.
#!/bin/bash
yad-cancel() {
kill -USR1 $YAD_PID
}
export -f yad-cancel
yad --no-buttons --close-on-unfocus --width 500 --height 50 --form --columns=5 --borders=10 --center --on-top \
--field='!database-lock!lock':fbtn "xscreensaver-command -l" \
--field='!application-exit!logout':fbtn "loginctl kill-user $USER" \
--field='!reload!reboot':fbtn "loginctl reboot" \
--field='!system-shutdown-panel!poweroff':fbtn "loginctl poweroff" \
--field='!button_cancel!cancel':fbtn "bash -c yad-cancel"
sort of off topic my post here but might be worth it.
I was on reddit unixporn a few days ago and their is this person creating an openbox menu in python3. Worth a look atleast if you are using openbox. Doesn't have all the functionality of obmenu-generator but i like where it is heading only using python libraries.
Managed to hack this together today from various sources, if you use it you would have to play around with the bash command functions.
What i like about this script is ive found a way to maintain timed loops inside the while loop itself using let. I would love any feedback to see if this is a viable script free from errors.
#!/bin/bash
get_cpu (){
printf "Cpu:"
top -bn1 | awk 'NR==3 {print $2}'
}
get_disk (){
printf "| Disk:"
df -h | awk 'NR==4 { print $3" / "$2}'
}
get_mem (){
printf "| Mem:"
free -h | awk 'NR==2 {print $3" / "$2}'
}
get_temp (){
printf "| Temps:"
sensors | awk '/Core/ { printf substr($3,2,2)"°C " }'
}
get_time (){
printf "| Time:"
date +"%R"
}
let loop=0
while true; do
if [[ $loop%60 -eq 0 ]]; then
Time=$(get_time)
fi
if [[ $loop%300 -eq 0 ]]; then
Disk=$(get_disk)
let loop=0 #this prevents an eventual overflow
fi
if [[ $loop%8 -eq 0 ]]; then
Temp=$(get_temp)
fi
if [[ $loop%3 -eq 0 ]]; then
Mem=$(get_mem)
fi
if [[ $loop%2 -eq 0 ]]; then
Cpu=$(get_cpu)
fi
xsetroot -name "$Cpu $Temp $Disk $Mem $Time"
let loop=$loop+1
sleep 1
done
Update: ran this script through shell check, interesting diff.
https://www.shellcheck.net/
#!/bin/bash
get_cpu (){
printf "Cpu:"
top -bn1 | awk 'NR==3 {print $2}'
}
get_disk (){
printf "| Disk:"
df -h | awk 'NR==4 { print $3" / "$2}'
}
get_mem (){
printf "| Mem:"
free -h | awk 'NR==2 {print $3" / "$2}'
}
get_temp (){
printf "| Temps:"
sensors | awk '/Core/ { printf substr($3,2,2)"°C " }'
}
get_time (){
printf "| Time:"
date +"%R"
}
(( loop=0 ))
while true; do
if [[ $loop%60 -eq 0 ]]; then
Time=$(get_time)
fi
if [[ $loop%300 -eq 0 ]]; then
Disk=$(get_disk)
(( loop=0 )) #this prevents an eventual overflow
fi
if [[ $loop%8 -eq 0 ]]; then
Temp=$(get_temp)
fi
if [[ $loop%3 -eq 0 ]]; then
Mem=$(get_mem)
fi
if [[ $loop%2 -eq 0 ]]; then
Cpu=$(get_cpu)
fi
xsetroot -name "$Cpu $Temp $Disk $Mem $Time"
(( loop=loop+1 ))
sleep 1
done