From 39aa8a421edd2f27041848e2bb4fe332dd32abdf Mon Sep 17 00:00:00 2001 From: kenji Date: Sat, 3 Jan 2026 09:39:36 -0600 Subject: [PATCH] Revert "fix(screensaver): fix shifting issue on tte-loop" This reverts commit 40efab98b94a59ad00ada04d60b00cd0e2af0862. --- apps/ghostty/default.nix | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/apps/ghostty/default.nix b/apps/ghostty/default.nix index e559964..dce2b37 100644 --- a/apps/ghostty/default.nix +++ b/apps/ghostty/default.nix @@ -6,29 +6,21 @@ home.packages = [ # TODO: will rewrite later (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) while true; do clear + cols=$(tput cols) lines=$(tput lines) 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 done '') (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 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 ${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" '') ];