cfg/bin/lock
Knut Ahlers 466c1cdbeb
Add automated actions to lock command
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2021-09-12 13:06:16 +02:00

23 lines
573 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
[ -f ${HOME}/.local/share/screen-lock.png ] || ${HOME}/bin/generate_lockscreen
# Stop MPD playback when mpc client was found
(which mpc >/dev/null 2>&1) && mpc stop
# Disable streamdeck to disallow input
systemctl --user stop streamdeck
# Terminate Discord in order to get mobile notifications
killall -TERM Discord || true
# Mute default sink & source
pactl set-sink-mute @DEFAULT_SINK@ true || true
pactl set-sink-mute @DEFAULT_SINK@ true || true
i3lock -e -f -n -c 000000
# Restart streamdeck again
systemctl --user start streamdeck