You are not logged in.
Pages: 1
I have a script that changes the background using feh every x seconds/minutes and i'm trying to make it run when the system boots. So far i tried adding this line to the autostart file in $HOME/.config/openbox:
$HOME/.config/openbox/wallchange/timechange.sh &
but it doesn't work. When i run it in the console it works.
Offline
Is the script executable?
Does the script only run once, or do you have a loop in it? Maybe post it here...
Last edited by damo (2020-07-14 20:23:02)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Is the script executable?
Does the script only run once, or do you have a loop in it? Maybe post it here...
Yes it is. It runs every x seconds/minutes
#!/bin/sh
WALLPAPERS=~/Pictures/Wallpapers
TIME=10m
while true;
do
feh --bg-scale "$(find $WALLPAPERS -type f -name '*.jpg' -o -name '*.png' | shuf -n 1)"
sleep $TIME
done &
Offline
The first thing I'd try is to remove the unnecessary ampersand after the do loop, which is forking it off into the background.
When you run the script in the terminal, does it change the wallpaper after ${TIME}, or just set it the first time?
As a general point it is safer to quote paths:
WALLPAPERS="${HOME}/Pictures/Wallpapers"
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
The first thing I'd try is to remove the unnecessary ampersand after the do loop, which is forking it off into the background.
When you run the script in the terminal, does it change the wallpaper after ${TIME}, or just set it the first time?
As a general point it is safer to quote paths:
WALLPAPERS="${HOME}/Pictures/Wallpapers"
If i set to 5s, it changes every 5 seconds as it supposed to so it's not a problem with the script.
Offline
If your Wallpaper directory isn't in your ${PATH}, the command in autostart should be
./$HOME/.config/openbox/wallchange/timechange.sh &
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
This is BunsenLabs Helium?
If it's Lithium, then the file to edit is $HOME/.config/bunsen/autostart
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
There's no reason why the script shouldn't work when started from autostart.
Do other commands in autostart work as expected?
Please show us the whole file.
Offline
If your Wallpaper directory isn't in your ${PATH}, the command in autostart should be
./$HOME/.config/openbox/wallchange/timechange.sh &
Tried that. Didn't work.
This is BunsenLabs Helium?
If it's Lithium, then the file to edit is $HOME/.config/bunsen/autostart
There's no reason why the script shouldn't work when started from autostart.
Do other commands in autostart work as expected?
Please show us the whole file.
Yes things like planky and picom autostart when placed there.
I decided to use conky to execute the script.
Conkyrc:
TEXT
${execpi 180 bash ~/.config/openbox/wallchange/wallchange.sh}
${execpi 5 cat ~/.config/openbox/wallchange/color.txt}
wallchange.sh:
#!/bin/bash
WPCURRENT="$(shuf -n1 -e ~/Pictures/Wallpapers/*)"
feh --randomize --bg-fill "${WPCURRENT}"
color=`convert "${WPCURRENT}" -gravity east -crop 20%x100% -resize 1x1 -negate txt:- | tail -n1 |cut -d' ' -f4`
echo -n '${color '$color'}' > ~/.config/openbox/wallchange/color.txt
cat ~/.config/openbox/wallchange/color.txt
I got the code from here and edited to my needs:
https://github.com/khodges42/Openbox-Wallchanger
The only thing that is needed is to start conky after boot.
Last edited by Aldebaraan (2020-07-15 17:26:11)
Offline
I feared you would misunderstand.
If the script works otherwise,but not when started from autostart, the reason could be in the autostart file and not in the script.
Please show us that file.
Offline
Pages: 1