feat: stop/resume mpd playing inbetween locking

This commit is contained in:
Klesh Wong 2021-08-31 13:56:09 +08:00
parent b4fbe47f23
commit 7afa985b07
3 changed files with 15 additions and 1 deletions

10
bin/lock.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
if mpc status | grep -F '[playing]'; then
mpc pause
RESTORE=1
fi
slock
if [ "$RESTORE" = 1 ]; then
mpc play
fi

View File

@ -10,7 +10,7 @@ statusbar
xset s off
xset dpms 300 300 300
killall xss-lock
xss-lock "$(command -v slock)" &
xss-lock "$(command -v lock.sh)" &
launchapp () {
! command -v "$1" >/dev/null && return # command doesn't exist

View File

@ -60,6 +60,10 @@ case "$PM" in
bluez bluez-utils blueman
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
# bluetoothctl devices
# bluetoothctl pair <ADDR>
# bluetoothctl trust <ADDR>
# bluetoothctl connect <ADDR>
fi
if is_laptop; then
sudo pacman -S --noconfirm --needed \