Revert "fix(screensaver): fix shifting issue on tte-loop"

This reverts commit 40efab98b9.
This commit is contained in:
kenji
2026-01-03 09:39:36 -06:00
parent 40efab98b9
commit 39aa8a421e
+8 -15
View File
@@ -6,29 +6,21 @@
home.packages = [ home.packages = [
# TODO: will rewrite later # TODO: will rewrite later
(pkgs.writeShellScriptBin "tte-loop" '' (pkgs.writeShellScriptBin "tte-loop" ''
trap 'exit 0' INT trap 'printf "\e[?25h"; exit 0' INT
printf '\e[?25l'
effects=(beams binarypath blackhole bouncyballs bubbles burn colorshift crumble decrypt errorcorrect expand fireworks highlight laseretch matrix middleout orbittingvolley overflow pour print rain randomsequence rings scattered slice slide spotlights spray swarm sweep synthgrid unstable vhstape waves wipe) effects=(beams binarypath blackhole bouncyballs bubbles burn colorshift crumble decrypt errorcorrect expand fireworks highlight laseretch matrix middleout orbittingvolley overflow pour print rain randomsequence rings scattered slice slide spotlights spray swarm sweep synthgrid unstable vhstape waves wipe)
while true; do while true; do
clear clear
cols=$(tput cols)
lines=$(tput lines) lines=$(tput lines)
effect="''${effects[RANDOM % ''${#effects[@]}]}" effect="''${effects[RANDOM % ''${#effects[@]}]}"
${pkgs.terminaltexteffects}/bin/tte --input-file ${config.home.homeDirectory}/.config/nixos/assets/branding.txt --anchor-canvas c --anchor-text c --canvas-width 0 --canvas-height "$((lines - 2))" --frame-rate 240 "$effect" printf '\e[?25l'
${pkgs.terminaltexteffects}/bin/tte --input-file ${config.home.homeDirectory}/.config/nixos/assets/branding.txt --anchor-canvas c --anchor-text c --canvas-width "$cols" --canvas-height "$((lines-2))" --frame-rate 120 "$effect"
printf '\e[?25l'
sleep 2 sleep 2
done done
'') '')
(pkgs.writeShellScriptBin "tte-screensaver" '' (pkgs.writeShellScriptBin "tte-screensaver" ''
exit_screensaver() {
${pkgs.hyprland}/bin/hyprctl keyword cursor:inactive_timeout 0
${pkgs.procps}/bin/pkill -x tte 2>/dev/null
${pkgs.procps}/bin/pkill -f "ghostty.*tte-loop" 2>/dev/null
exit 0
}
trap exit_screensaver SIGINT SIGTERM SIGHUP SIGQUIT
# Hide cursor
${pkgs.hyprland}/bin/hyprctl keyword cursor:inactive_timeout 1
# Get all monitors # Get all monitors
monitors=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[].name') monitors=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[].name')
@@ -43,7 +35,8 @@
# Monitor for any input and exit when detected # Monitor for any input and exit when detected
${pkgs.libinput}/bin/libinput debug-events 2>/dev/null | head -n 1 >/dev/null ${pkgs.libinput}/bin/libinput debug-events 2>/dev/null | head -n 1 >/dev/null
exit_screensaver # Input detected, kill all screensaver instances
${pkgs.procps}/bin/pkill -f "ghostty.*tte-loop"
'') '')
]; ];