stop slideshow when changing bg
This commit is contained in:
parent
50e001f085
commit
383c8dc7af
|
@ -0,0 +1 @@
|
||||||
|
11599
|
|
@ -1,4 +1,24 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
PIDFILE=bg_slideshow.pid
|
||||||
|
remove_pidfile()
|
||||||
|
{
|
||||||
|
rm -f "$PIDFILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -f "$PIDFILE" ]; then
|
||||||
|
kill -9 "$(cat $PIDFILE)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${1} == kill ]]; then
|
||||||
|
echo "killing myslef, byeeee"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo $$ > "$PIDFILE"
|
||||||
|
|
||||||
|
|
||||||
bgsDirectory="/home/andrzej/bgs/"
|
bgsDirectory="/home/andrzej/bgs/"
|
||||||
path=${1}
|
path=${1}
|
||||||
duration=${2}
|
duration=${2}
|
||||||
|
@ -24,10 +44,12 @@ randomIndex=$(($RANDOM % $length))
|
||||||
echo ${image}
|
echo ${image}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
chooseRandom ${path}
|
chooseRandom ${path}
|
||||||
hyprctl hyprpaper preload "${image}"
|
hyprctl hyprpaper preload "${image}"
|
||||||
hyprctl hyprpaper wallpaper ",${image}"
|
hyprctl hyprpaper wallpaper ",contain:${image}"
|
||||||
sleep $duration
|
sleep $duration
|
||||||
hyprpaper unload all
|
hyprpaper unload all
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,11 +1,18 @@
|
||||||
bgsDirectory="${HOME}/bgs/"
|
bgsDirectory="${HOME}/bgs/"
|
||||||
|
|
||||||
|
##set working directory to location of this script
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
##stop slideshow if running
|
||||||
|
sh ./hyprland-slideshow.sh kill
|
||||||
|
|
||||||
|
|
||||||
preloadImage(){
|
preloadImage(){
|
||||||
hyprctl hyprpaper preload "${image}"
|
hyprctl hyprpaper preload "${image}"
|
||||||
}
|
}
|
||||||
|
|
||||||
setImage() {
|
setImage() {
|
||||||
hyprctl hyprpaper wallpaper ",${image}"
|
hyprctl hyprpaper wallpaper ",contain:${image}"
|
||||||
}
|
}
|
||||||
|
|
||||||
#ARGS $1:directory e.g. chsck
|
#ARGS $1:directory e.g. chsck
|
||||||
|
|
Loading…
Reference in New Issue