diff --git a/tree/.config/i3/config b/tree/.config/i3/config index 3452a8e..e1d5b92 100644 --- a/tree/.config/i3/config +++ b/tree/.config/i3/config @@ -32,7 +32,7 @@ exec --no-startup-id dex --autostart --environment i3 # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the # screen before suspend. Use loginctl lock-session to lock your screen. -exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock-cool +exec --no-startup-id xss-lock --transfer-sleep-lock -- screenlock # NetworkManager is the most popular way to manage wireless networks on Linux, # and nm-applet is a desktop environment-independent system tray GUI for it. @@ -64,7 +64,7 @@ bindsym $mod+e exec --no-startup-id dmenu_run # lock screen #bindsym $mod+Shift+l exec loginctl lock-session -bindsym $mod+Shift+l exec i3lock-cool +bindsym $mod+Shift+l exec screenlock # change focus bindsym $mod+h focus left diff --git a/tree/.config/sway/config b/tree/.config/sway/config index 2b59b80..a2343ee 100644 --- a/tree/.config/sway/config +++ b/tree/.config/sway/config @@ -50,9 +50,9 @@ exec mako ### Idle configuration exec swayidle -w \ - timeout 300 'swaylock-cool -fFe' \ + timeout 300 'screenlock -fFe' \ timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock-cool -fFe' + before-sleep 'screenlock -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 @@ -90,7 +90,7 @@ input * { bindsym $mod+d exec $menu # Lock the screen - bindsym $mod+Shift+Plus exec "swaylock-cool -fFe" + bindsym $mod+Shift+Plus exec "screenlock -fFe" # Drag floating windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. diff --git a/tree/.config/sway/ferris-stamp.png b/tree/.config/sway/ferris-stamp.png deleted file mode 100644 index e403c9b..0000000 Binary files a/tree/.config/sway/ferris-stamp.png and /dev/null differ diff --git a/tree/.local/bin/i3lock-cool b/tree/.local/bin/i3lock-cool deleted file mode 100755 index c782685..0000000 --- a/tree/.local/bin/i3lock-cool +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -set -x - -# check if i3lock is running -if ps -e | grep " i3lock$"; then - echo "i3lock is already running!" - exit 1 -fi - -OPTIONAL_CMDS="scrot lockscreen-blur" - -for CMD in $OPTIONAL_CMDS; do - echo "checking $CMD" - if ! command -v "$CMD" &> /dev/null - then - echo "$CMD could not be found, falling back to basic mode." - - i3lock -c 302f3b "$@" - - exit 0 - fi -done - -TMP_IMG="/tmp/lock.png" - -scrot - | lockscreen-blur -o "$TMP_IMG" -b 20 --stamp ~/.config/sway/ferris-stamp.png - -i3lock -nef --image="$TMP_IMG" "$@" - -rm "$TMP_IMG" diff --git a/tree/.local/bin/screenlock.tpl b/tree/.local/bin/screenlock.tpl new file mode 100755 index 0000000..26ec5b9 --- /dev/null +++ b/tree/.local/bin/screenlock.tpl @@ -0,0 +1,41 @@ +#!/bin/sh + +TMP_IMG="/tmp/lock.png" + +{% if hostname == "sputnik" %} + +LOCKPROG=i3lock +LOCKARGS="-nef --image=$TMP_IMG" +LOCKARGS_NOCOOL="-c 302f3b" +OPTIONAL_CMDS="scrot lockscreen-blur" +SCREENCAP="scrot -" +BLUR_FACTOR=20 + +{% elif hostname == "sputnik" %} + +LOCKPROG=swaylock +LOCKARGS="--config ~/.config/sway/swaylock.config --image $TMP_IMG" +LOCKARGS_NOCOOL="--config ~/.config/sway/swaylock.config --color 302f3b" +OPTIONAL_CMDS="grim lockscreen-blur" +SCREENCAP="grim -t ppm -" +BLUR_FACTOR=40 + +{% else %} +echo "screenlock not configured for this system" +exit 1 +{% end %} + +for CMD in $OPTIONAL_CMDS; do + if ! command -v "$CMD" &> /dev/null + then + echo "$CMD could not be found, falling back to basic mode." + + $LOCKPROG $LOCKARGS_NOCOOL "$@" + + exit 0 + fi +done + +$SCREENCAP | lockscreen-blur -o $TMP_IMG -b $BLUR_FACTOR --stamp ~/.config/wallpapers/ferris-stamp.png + +$LOCKPROG $LOCKARGS "$@" diff --git a/tree/.local/bin/swaylock-cool b/tree/.local/bin/swaylock-cool deleted file mode 100755 index a47a1dd..0000000 --- a/tree/.local/bin/swaylock-cool +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# check if swaylock is running -if ps -e | grep " swaylock$"; then - echo "swaylock is already running!" - exit 1 -fi - -OPTIONAL_CMDS=("convert" "python3" "grim", "lockscreen-blur") - -for CMD in $OPTIONAL_CMDS; do - if ! command -v "$CMD" &> /dev/null - then - echo "$CMD could not be found, falling back to basic mode." - - swaylock --config ~/.config/sway/swaylock.config --color 302f3b "$@" - - exit 0 - fi -done - -TMP_IMG="/tmp/lock.png" - -grim -t ppm - | lockscreen-blur -o "$TMP_IMG" -b 40 --stamp ~/.config/sway/ferris-stamp.png - -swaylock --config ~/.config/sway/swaylock.config --image "$TMP_IMG" "$@" - -rm "$TMP_IMG"