From b58b19479748a8e291611e3c6638c14e7c7c2198 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 21 Aug 2025 01:57:48 +0200 Subject: [PATCH] first cmatrix lock fix, still needs debugging --- .config/hypr/config/variables.conf | 6 ++++-- .config/hypr/config/windowrules.conf | 7 ++----- .config/swaylock/lockscript.sh | 31 +++++++++++++++------------- .config/swaylock/matrix.sh | 2 +- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.config/hypr/config/variables.conf b/.config/hypr/config/variables.conf index 6cc4a1d..06af48f 100644 --- a/.config/hypr/config/variables.conf +++ b/.config/hypr/config/variables.conf @@ -9,8 +9,8 @@ general { gaps_in = 2 gaps_out = 1 border_size = 1 - col.active_border = $color2 - col.inactive_border = $color4 + col.active_border = $color4 + col.inactive_border = $color2 layout = dwindle # master|dwindle resize_on_border = true extend_border_grab_area = 10 @@ -65,6 +65,8 @@ misc { swallow_regex = ^(cachy-browser|firefox|nautilus|nemo|thunar|btrfs-assistant.)$ focus_on_activate = true vrr = 2 + # Hypridle cmatrix fix: + session_lock_xray = true } # https://wiki.hyprland.org/0.45.0/Configuring/Variables/#render diff --git a/.config/hypr/config/windowrules.conf b/.config/hypr/config/windowrules.conf index 1e679c3..2fd0f56 100644 --- a/.config/hypr/config/windowrules.conf +++ b/.config/hypr/config/windowrules.conf @@ -22,18 +22,18 @@ windowrule = opacity 0.92, class:^(thunar|nemo|dolphin)$ windowrule = opacity 0.96, class:^(discord|armcord|webcord)$ windowrule = opacity 0.95, title:^(QQ|Telegram)$ windowrule = opacity 0.95, title:^(NetEase Cloud Music Gtk4)$ +windowrule = opacity 1, class:^(kitty)$ # General window rules windowrule = float, title:^(Picture-in-Picture)$ windowrule = size 960 540, title:^(Picture-in-Picture)$ windowrule = move 25%-, title:^(Picture-in-Picture)$ -windowrule = float, title:^(imv|mpv|danmufloat|termfloat|nemo|ncmpcpp)$ +windowrule = float, title:^(imv|mpv|danmufloat|termfloat|nemo|ncmpcpp|nwg-look|nwg-displays)$ windowrule = move 25%-, title:^(imv|mpv|danmufloat|termfloat|nemo|ncmpcpp)$ windowrule = size 960 540, title:^(imv|mpv|danmufloat|termfloat|nemo|ncmpcpp)$ windowrule = pin, title:^(danmufloat)$ windowrule = rounding 5, title:^(danmufloat|termfloat)$ windowrule = animation slide right, class:^(kitty|Alacritty)$ windowrule = noblur, class:^(org.mozilla.firefox)$ -windowrule = opacity 0.88, class:Code # Decorations related to floating windows on workspaces 1 to 10 windowrule = bordersize 2, floating:1, onworkspace:w[fv1-10] windowrule = bordercolor $color4, floating:1, onworkspace:w[fv1-10] @@ -68,6 +68,3 @@ layerrule = animation fade 50%, wallpaper windowrule = float,class:^(Zotero)$,title:^(Citation Dialog)$ windowrule = center,class:^(Zotero)$,title:^(Citation Dialog)$ windowrule = noanim,class:^(Zotero)$,title:^(Citation Dialog)$ - -windowrule = fullscreen, class:matrix -windowrule = opacity 0.8, class:matrix diff --git a/.config/swaylock/lockscript.sh b/.config/swaylock/lockscript.sh index ff91bce..1c7494a 100755 --- a/.config/swaylock/lockscript.sh +++ b/.config/swaylock/lockscript.sh @@ -1,22 +1,25 @@ #!/usr/bin/env bash -USER_HOME="/home/michaelb" +set -Eeuo pipefail + +USER_HOME="$HOME" MATRIX_SCRIPT="$USER_HOME/.config/swaylock/matrix.sh" ALACRITTY_CONF="$USER_HOME/.config/swaylock/alacritty-matrix.toml" -mtrx_command="alacritty \ - --config-file \"$ALACRITTY_CONF\" \ - --class matrix \ - -e \"$MATRIX_SCRIPT\"" - -# 1) Spawn Matrix windows per-monitor -screens=$(hyprctl -j monitors | jq length) -for (( i = -1; i < screens; i++ )); do - hyprctl dispatch focusmonitor $i - eval $mtrx_command & +# 1) Spawn matrix per monitor +mapfile -t MONS < <(hyprctl -j monitors | jq -r '.[].name') +for mon in "${MONS[@]}"; do + hyprctl dispatch focusmonitor "$mon" + sleep 0.06 + kitty \ + --app-id matrix \ + --title "matrix-$mon" \ + --start-as fullscreen \ + bash -lc "$MATRIX_SCRIPT" & + sleep 0.12 done -# 2) Lock (blocks until unlock) +# 2) Lock screen (blocks until unlock) swaylock -# 3) Tear down Matrix -pkill -f "$MATRIX_SCRIPT" +# 3) Tear down matrix +pkill -f "$MATRIX_SCRIPT" || true diff --git a/.config/swaylock/matrix.sh b/.config/swaylock/matrix.sh index 833bdeb..3751975 100755 --- a/.config/swaylock/matrix.sh +++ b/.config/swaylock/matrix.sh @@ -1,4 +1,4 @@ #!/bin/bash -sleep 0.03 +sleep 0.15 cmatrix