.dotfiles/.config/hypr/scripts/bg-switcher

14 lines
477 B
Plaintext
Raw Normal View History

2022-06-09 19:29:23 +02:00
#!/bin/zsh
swaybg --image $(find $HOME/.customization/background/ -type f | shuf -n 1) -m fill&
function handle {
if [[ ${1:0:9} == "workspace" ]]; then
echo $line
swpid=`ps axf | grep swaybg | grep -v grep | awk '{printf $1}'`
swaybg --image $(find $HOME/.customization/background | shuf -n 1) -m fill&
sleep .3
kill $swpid
fi
}
socat - UNIX-CONNECT:/tmp/hypr/_1654794872/.socket2.sock | while read line; do handle $line; done