first cmatrix lock fix, still needs debugging
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user