diff options
Diffstat (limited to 'pkgs/theme/myswaylock.sh')
-rwxr-xr-x | pkgs/theme/myswaylock.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pkgs/theme/myswaylock.sh b/pkgs/theme/myswaylock.sh new file mode 100755 index 0000000..c204a57 --- /dev/null +++ b/pkgs/theme/myswaylock.sh @@ -0,0 +1,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 |