aboutsummaryrefslogtreecommitdiff
path: root/pkgs/theme/myswaylock.sh
blob: c204a57fe33c2728eb1e32fb276660933f112b9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash

# Switch to the US keyboard (to make sure that we have the correct one)
swaymsg input type:keyboard xkb_layout us

resolution="$(swaymsg -t get_outputs \
	| jq -r '.[0].rect | [.width,.height] | join("x")')"
case "$resolution" in
	1920x1080|2560x1440|2560x1600)
		;;
	*)
		resolution="1920x1080"
		;;
esac

exec swaylock -f \
	-n -c 000000 \
	-i "$(shuf -n1 -e "$BACKGROUND_LNXPCS"/*"$resolution.png")" \
	-s fill