i3lock now stops/starts tidal instead of spotify

This commit is contained in:
2019-11-11 10:20:20 +01:00
parent 9714b2fa1d
commit fbe3848039
5 changed files with 37 additions and 22 deletions

View File

@@ -60,12 +60,12 @@ color=#999999
# see the script for details.
[temperature]
command=bash ~/.config/i3/scripts/blocks/temp.sh
label=
label=
interval=1
color=#999999
[load_average]
label=
label=
interval=10
separator=true
color=#999999
@@ -74,7 +74,7 @@ color=#999999
#
# The type defaults to "mem" if the instance is not specified.
[memory]
label=
label=
separator=true
interval=30
color=#999999
@@ -84,7 +84,7 @@ color=#999999
# The script may be called with a optional argument to set the alert
# (defaults to 10 for 10%).
[disk]
label=
label=
instance=/
interval=5
separator=true
@@ -92,7 +92,7 @@ color=#999999
# Updates
[updates]
label=
label=
command=pacman -Qu | wc -l
interval=60
separator=true
@@ -104,14 +104,14 @@ color=#999999
# The address can be forced to IPv4 or IPv6 with -4 or -6 switches.
[iface]
#instance=wlan0
label=
label=
color=#0fad3c
interval=10
separator=true
# ping
[ping]
label=
label=
command=ping -c 2 8.8.8.8 | tail -1 | awk '{print $4}' | cut -d '/' -f 2 | cut -f1 -d"."
interval=60
separator=true
@@ -123,7 +123,7 @@ color=#999999
# The second parameter overrides the mixer selection
# See the script for details.
[volume]
label=
label=
instance=Master
interval=1
command=/usr/lib/i3blocks/volume/volume 5 pulse
@@ -151,7 +151,7 @@ color=#999999
# Date Time
[time]
label=
label=
command=date '+%Y-%m-%d %H:%M:%S'
interval=1
separator=true

View File

@@ -4,14 +4,14 @@ icon="$HOME/.config/i3/icons/lock.png"
tmpbg='/tmp/screen.png'
# detect whether spotify is running
isPlaying=$(~/.config/i3/scripts/spotify-cli.sh status);
isPlaying=$(~/.config/i3/scripts/tidal-cli.sh status);
scrot "$tmpbg"
convert "$tmpbg" -scale 10% -scale 1000% "$tmpbg"
convert "$tmpbg" "$icon" -gravity center -composite -matte "$tmpbg"
# Stop music if playing
~/.config/i3/scripts/spotify-cli.sh pause
~/.config/i3/scripts/tidal-cli.sh pause
# check whether the lockscreen is being activated because of a suspend
if [[ $* == *--suspend ]]; then
@@ -22,8 +22,8 @@ else
i3lock -n -f -i "$tmpbg";
# if spotify was playing before we locked, resume.
if [ $isPlaying == "Playing" ]; then
~/.config/i3/scripts/spotify-cli.sh play
if [ $isPlaying == "playing" ]; then
~/.config/i3/scripts/tidal-cli.sh play
fi;
fi
fi