cfg/bin/lock

23 lines
577 B
Text
Raw Normal View History

#!/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-source-mute @DEFAULT_SOURCE@ true || true
i3lock -e -f -n -c 000000
# Restart streamdeck again
systemctl --user start streamdeck