aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/lock-color
blob: 23efb78229b2a732f0625024697bc2595490ea4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

if [ -n "$SWAYSOCK" ]; then
	swaymsg input type:keyboard xkb_switch_layout 0

	if [ "$1" != "screenon" ]; then
  	  	echo idling
		swayidle timeout 15 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' &
	fi
elif [ -n "$NIRI_SOCKET" ]; then
	if [ "$1" != "screenon" ]; then
		echo idling
		swayidle timeout 15 'niri msg action power-off-monitors' resume 'niri msg action power-on-monitors' &
	fi
fi

gpg-connect-agent --no-autostart reloadagent /bye

canberra-gtk-play -i Oxygen-Window-All-Desktops-Not &
swaylock

pkill -n swayidle
canberra-gtk-play -i Oxygen-Window-All-Desktops