mirror of
https://github.com/Mastermindzh/dotfiles.git
synced 2024-11-24 15:54:36 +01:00
lockscreen now stops/starts spotify automatically :)
This commit is contained in:
parent
67384d8797
commit
caec5d5d04
@ -3,9 +3,21 @@
|
|||||||
icon="$HOME/.config/i3/icons/lock.png"
|
icon="$HOME/.config/i3/icons/lock.png"
|
||||||
tmpbg='/tmp/screen.png'
|
tmpbg='/tmp/screen.png'
|
||||||
|
|
||||||
|
# detect whether spotify is running
|
||||||
|
isPlaying=$(~/.config/i3/scripts/spotify-cli.sh status);
|
||||||
|
|
||||||
(( $# )) && { icon=$1; }
|
(( $# )) && { icon=$1; }
|
||||||
|
|
||||||
scrot "$tmpbg"
|
scrot "$tmpbg"
|
||||||
convert "$tmpbg" -scale 10% -scale 1000% "$tmpbg"
|
convert "$tmpbg" -scale 10% -scale 1000% "$tmpbg"
|
||||||
convert "$tmpbg" "$icon" -gravity center -composite -matte "$tmpbg"
|
convert "$tmpbg" "$icon" -gravity center -composite -matte "$tmpbg"
|
||||||
i3lock -f -i "$tmpbg"
|
|
||||||
|
# Stop music if playing
|
||||||
|
~/.config/i3/scripts/spotify-cli.sh pause
|
||||||
|
|
||||||
|
i3lock -n -f -i "$tmpbg";
|
||||||
|
|
||||||
|
# if spotify was playing before we locked, resume.
|
||||||
|
if [ $isPlaying == "Playing" ]; then
|
||||||
|
~/.config/i3/scripts/spotify-cli.sh play
|
||||||
|
fi;
|
||||||
|
Loading…
Reference in New Issue
Block a user