diff --git a/tree/.config/hypr/hyprlock.conf.tpl b/tree/.config/hypr/hyprlock.conf.tpl index 84880e9..c52a296 100644 --- a/tree/.config/hypr/hyprlock.conf.tpl +++ b/tree/.config/hypr/hyprlock.conf.tpl @@ -7,6 +7,7 @@ background { monitor = {% if hostname == "sputnik" %} + # make background transparent, used in combination with screenlock-video color = rgba(00000000) {% else %} path = ~/.config/wallpapers/6000x3376/akira.jpg @@ -49,6 +50,7 @@ input-field { shadow_boost = 1.2 } +# ferris image in the center image { monitor = path = ~/.config/wallpapers/ferris-stamp.png @@ -64,6 +66,7 @@ image { shadow_boost = 1.2 } +# clock label { monitor = text = $TIME @@ -82,16 +85,36 @@ label { shadow_boost = 1.3 } +# battery label { monitor = - text = $LAYOUT + text = cmd[update:5000] wmutils battery + text_align = left + color = rgba(200, 200, 200, 1.0) + font_size = 20 + font_family = Noto Sans + rotate = 0 # degrees, counter-clockwise + + position = 24, -20 + halign = left + valign = top + + shadow_passes = 2 + shadow_size = 1 + shadow_boost = 1.1 +} + +# keyboard layout +label { + monitor = + text = $LAYOUT text_align = right color = rgba(200, 200, 200, 1.0) font_size = 20 font_family = Noto Sans rotate = 0 # degrees, counter-clockwise - position = -12, -12 + position = -24, -20 halign = right valign = top @@ -100,6 +123,7 @@ label { shadow_boost = 1.1 } +# greeting text label { monitor = text = GREET_ $user @@ -118,6 +142,7 @@ label { shadow_boost = 1.3 } +# number of login attempts label { monitor = text = $ATTEMPTS[0]x $FAIL diff --git a/tree/.config/niri/config.kdl.tpl b/tree/.config/niri/config.kdl.tpl index 1c29e28..3b14fec 100644 --- a/tree/.config/niri/config.kdl.tpl +++ b/tree/.config/niri/config.kdl.tpl @@ -267,7 +267,7 @@ binds { Mod+Return { spawn "alacritty"; } Mod+D { spawn "fuzzel"; } - Mod+Plus { spawn "/home/hulthe/.local/bin/screenlock"; } + Mod+Plus { spawn "loginctl lock-session"; } // You can also use a shell: // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } diff --git a/tree/.config/swayidle/config.tpl b/tree/.config/swayidle/config.tpl index 1c8f9a3..4ce243e 100644 --- a/tree/.config/swayidle/config.tpl +++ b/tree/.config/swayidle/config.tpl @@ -1,7 +1,5 @@ {% if hostname == "sputnik" %} lock '$HOME/.local/bin/screenlock-video' -{% elif hostname == "buran" %} -lock 'hyprlock' {% else %} lock '$HOME/.local/bin/screenlock' {% end %} diff --git a/tree/.local/bin/screenlock b/tree/.local/bin/screenlock index 3de6117..c49aa5a 100755 --- a/tree/.local/bin/screenlock +++ b/tree/.local/bin/screenlock @@ -1,11 +1,7 @@ #!/usr/bin/fish # configured for wayland -set LOCKPROG swaylock -set OPTIONAL_CMDS rg sed grim lockscreen-blur jq -set CONFIG "$HOME/.config/sway/swaylock.config" -set DEFAULT_ARGS --daemonize --ignore-empty-password --show-failed-attempts --color 302f3b --config $CONFIG -set BLUR_FACTOR 40 +set LOCKPROG hyprlock # check if lock program is running if ps -e | grep " $LOCKPROG\$" @@ -13,38 +9,4 @@ if ps -e | grep " $LOCKPROG\$" exit 1 end -# check if we have programs required to take a screenshot and do cool stuff with it -for cmd in $OPTIONAL_CMDS - if not command -v $cmd &>/dev/null - echo "$cmd could not be found, falling back to basic mode." - $LOCKPROG $DEFAULT_ARGS - exit 0 - end -end - -# get a list of outputs/monitors -switch $XDG_CURRENT_DESKTOP - case Hyprland - set outputs (hyprctl monitors | rg Monitor | sed 's/Monitor //' | sed 's/ (ID.*$//') - case sway - set outputs (swaymsg -t get_outputs -r | rg "name" | sed 's/^.*"name": "//' | sed 's/",$//') - case niri - set outputs (niri msg --json outputs | jq -r 'keys | join("\n")') - case '*' - echo "unsupported compositor, falling back to basic mode." - $LOCKPROG $DEFAULT_ARGS - exit 0 -end - -# take one screenshot of each output -for output in $outputs - set img "/tmp/lock-$output.png" - grim -o $output -t ppm - | lockscreen-blur -o $img -b $BLUR_FACTOR --stamp ~/.config/wallpapers/ferris-stamp.png & - set -a images --image - set -a images "$output:$img" -end - -# wait for all screenshot jobs to complete -wait - -$LOCKPROG $DEFAULT_ARGS $images +$LOCKPROG $argv