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
|
||||
|
||||
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/"
|
||||
path=${1}
|
||||
duration=${2}
|
||||
|
@ -24,10 +44,12 @@ randomIndex=$(($RANDOM % $length))
|
|||
echo ${image}
|
||||
}
|
||||
|
||||
|
||||
|
||||
while true; do
|
||||
chooseRandom ${path}
|
||||
hyprctl hyprpaper preload "${image}"
|
||||
hyprctl hyprpaper wallpaper ",${image}"
|
||||
hyprctl hyprpaper wallpaper ",contain:${image}"
|
||||
sleep $duration
|
||||
hyprpaper unload all
|
||||
done
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
bgsDirectory="${HOME}/bgs/"
|
||||
|
||||
##set working directory to location of this script
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
##stop slideshow if running
|
||||
sh ./hyprland-slideshow.sh kill
|
||||
|
||||
|
||||
preloadImage(){
|
||||
hyprctl hyprpaper preload "${image}"
|
||||
}
|
||||
|
||||
setImage() {
|
||||
hyprctl hyprpaper wallpaper ",${image}"
|
||||
hyprctl hyprpaper wallpaper ",contain:${image}"
|
||||
}
|
||||
|
||||
#ARGS $1:directory e.g. chsck
|
||||
|
|
Loading…
Reference in New Issue