Update swaylock-cool
- Faster blur - Avoid double-locking on sleep
This commit is contained in:
@ -48,13 +48,10 @@ output eDP-1 scale 1.5
|
||||
exec mako
|
||||
|
||||
### Idle configuration
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
exec swayidle -w \
|
||||
timeout 300 'swaylock-cool -f' \
|
||||
timeout 300 'swaylock-cool -fFe' \
|
||||
timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
||||
before-sleep 'swaylock-cool -f'
|
||||
before-sleep 'swaylock-cool -fFe'
|
||||
|
||||
# This will lock your screen after 300 seconds of inactivity, then turn off
|
||||
# your displays after another 300 seconds, and turn your screens back on when
|
||||
@ -92,7 +89,7 @@ input * {
|
||||
bindsym $mod+d exec $menu
|
||||
|
||||
# Lock the screen
|
||||
bindsym $mod+Shift+Plus exec "swaylock-cool -f"
|
||||
bindsym $mod+Shift+Plus exec "swaylock-cool -fFe"
|
||||
|
||||
# Drag floating windows by holding down $mod and left mouse button.
|
||||
# Resize them with right mouse button + $mod.
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(91, 63, 99, 0.7);
|
||||
background-color: rgba(48, 47, 59, 0.7);
|
||||
border-bottom: 3px solid rgba(55, 76, 110, 0.0);
|
||||
color: #ffffff;
|
||||
transition-property: background-color;
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
BLUR_FACTOR=64;
|
||||
# check if swaylock is running
|
||||
if ps -e | grep " swaylock$"; then
|
||||
echo "swaylock is already running!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OPTIONAL_CMDS=("convert" "python3" "grim")
|
||||
OPTIONAL_CMDS=("convert" "python3" "grim", "lockscreen-blur")
|
||||
|
||||
for CMD in $OPTIONAL_CMDS; do
|
||||
if ! command -v "$CMD" &> /dev/null
|
||||
@ -19,17 +23,13 @@ BASE_IMAGE_DIR="$(mktemp -d)"
|
||||
INDEX=1
|
||||
|
||||
image_path() {
|
||||
echo "$BASE_IMAGE_DIR/$1.jpg"
|
||||
echo "$BASE_IMAGE_DIR/$1.png"
|
||||
}
|
||||
|
||||
UPSCALE="$(python3 -c "print(100*$BLUR_FACTOR, end='')")%"
|
||||
DOWNSCALE="$(python3 -c "print(100/$BLUR_FACTOR, end='')")%"
|
||||
|
||||
grim "$(image_path 1)"
|
||||
|
||||
convert -scale $DOWNSCALE -scale $UPSCALE "$(image_path 1)" "$(image_path 2)"
|
||||
convert -composite -gravity center "$(image_path 2)" ~/.config/sway/ferris-stamp.png "$(image_path 3)"
|
||||
lockscreen-blur -i "$(image_path 1)" -o "$(image_path 2)" -b 40 --stamp ~/.config/sway/ferris-stamp.png
|
||||
|
||||
swaylock --config ~/.config/sway/swaylock.config --image "$(image_path 3)"
|
||||
swaylock --config ~/.config/sway/swaylock.config --image "$(image_path 2)" $@
|
||||
|
||||
rm -r "$BASE_IMAGE_DIR"
|
||||
|
||||
Reference in New Issue
Block a user