From 93b0545d11bf8c7f065203f7f3eaf1d0e3730dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 21 Feb 2022 21:54:09 +0100 Subject: Add initial version --- pkgs/theme/myswaylock.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 pkgs/theme/myswaylock.sh (limited to 'pkgs/theme/myswaylock.sh') 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 -- cgit v1.2.3