summaryrefslogtreecommitdiff
path: root/ext/lock.sh
blob: 508e2b1d89fd69e3a2ed7ff80e5860bfef4e3b1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
set -eu

scrot --quality=10 -o /tmp/.lockscreen.png
convert /tmp/.lockscreen.png \
	-define png:compression-filter=5 \
	-define png:compression-level=1 \
	-brightness-contrast -5 \
	-blur 0x24 \
	/tmp/.lockscreen.png

convert -composite -gravity center /tmp/.lockscreen.png "$HOME/.dots/ext/lock-overlay.png" /tmp/.lockscreen.png

# Pause stuff and mute audio
_muted="$(pacmd list-sinks | awk '/muted/ { print $2 }')"
[[ "$_muted" == "no" ]] && pactl set-sink-mute @DEFAULT_SINK@ 1
#playerctl -a pause > /dev/null
#amixer set Master mute > /dev/null

# Turn on DND
#old_dnd="$(xfconf-query -c xfce4-notifyd -p /do-not-disturb)"
#xfconf-query -c xfce4-notifyd -p /do-not-disturb -s true

i3lock --nofork --ignore-empty-password --image /tmp/.lockscreen.png &

# Set settings back to what they were before
#test "$old_dnd" = false && xfconf-query -c xfce4-notifyd -p /do-not-disturb -s false
[[ "$_muted" == "no" ]] && pactl set-sink-mute @DEFAULT_SINK@ 0