dotfiles/bin/lock.sh

21 lines
361 B
Bash
Raw Normal View History

#!/bin/sh
if mpc status | grep -F '[playing]'; then
mpc pause
2022-05-24 16:26:22 +00:00
RESTORE_MPD=1
fi
if command -v bluetoothctl >/dev/null; then
RESTORE_BLU=$(bluetoothctl show | grep -F "Powered: yes")
fi
2022-05-19 08:19:17 +00:00
if [ -n "$LOCKER" ]; then
$LOCKER
else
slock
fi
2022-05-24 16:26:22 +00:00
if [ "$RESTORE_MPD" = 1 ]; then
mpc play
fi
2022-05-24 16:26:22 +00:00
if [ -n "$RESTORE_BLU" ]; then
bluetoothctl power on
fi