lock script, styling

This commit is contained in:
2025-10-28 15:37:56 +01:00
parent 57d5f6a51a
commit c8d8e3a7d7
4 changed files with 31 additions and 10 deletions
+11 -9
View File
@@ -5,7 +5,7 @@ set $down j
set $up k
set $right l
set $term alacritty
set $menu wmenu-run
set $menu wmenu-run -l 5
# Font
font pango:MesloLGL Nerd Font Mono 10
@@ -17,14 +17,8 @@ output * bg /home/agres/.config/sway/wallpaper/wallpaper.jpg fill
gaps inner 2
gaps outer 2
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
# before-sleep 'swaylock -f -c 000000'
#
# 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
# resumed. It will also lock your screen before your computer goes to sleep.
# Screen Locker
exec_always /home/agres/.config/sway/scripts/lock-sway.sh
# Key bindings
bindsym $mod+Return exec $term
@@ -33,6 +27,7 @@ gaps outer 2
floating_modifier $mod normal
bindsym $mod+Shift+r reload
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
bindsym $mod+q exec /home/agres/.config/sway/scripts/lock-sway-instant.sh
# Moving around:
bindsym $mod+$left focus left
@@ -143,5 +138,12 @@ output eDP-1 {
scale_filter linear
}
# Opacity Settings
for_window [app_id="Alacritty"] opacity 0.98
# Border Colors
client.focused #00b5af #00b5af #fdf6e3 #073642
client.focused_inactive #073642 #073642 #fdf6e3 #073642
client.unfocused #073642 #073642 #fdf6e3 #073642
include /etc/sway/config.d/*
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
IMG_PATH="${XDG_RUNTIME_DIR:-/tmp}/lock.png"
grim -t png "$IMG_PATH"
magick "$IMG_PATH" -blur 0x12 "$IMG_PATH"
swaylock -f -i "$IMG_PATH"
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
IMG_PATH="${XDG_RUNTIME_DIR:-/tmp}/lock.png"
exec swayidle -w \
timeout 30 "grim -t png \"$IMG_PATH\" && magick \"$IMG_PATH\" -blur 0x12 \"$IMG_PATH\" && swaylock -f -i \"$IMG_PATH\"" \
timeout 600 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \
before-sleep "grim -t png \"$IMG_PATH\" && magick \"$IMG_PATH\" -blur 0x12 \"$IMG_PATH\" && swaylock -f -i \"$IMG_PATH\""
+1 -1
View File
@@ -4,5 +4,5 @@ cpu=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {printf "
bat=$(cat /sys/class/power_supply/macsmc-battery/capacity 2>/dev/null || echo "N/A")
time=$(date "+%d.%m %H:%M:%S")
echo "CPU: $cpu | MEM: $mem | BAT: $bat% | $time"
echo "$USER | CPU: $cpu | MEM: $mem | BAT: $bat% | $time"