Files
nixos/apps/ghostty/default.nix
T
CLAUDE AI f7ab887ed0 revert(hypr): remove game-focus-watcher, restore steam rules
Keep only DP-1 forcing changes: gamingMonitor variable, monitor rules
for steam_app/mkGameRules, gaming-focus script, and SUPER+G binding.

Remove game-focus-watcher (caused game freeze on workspace switch).
Revert steam workspace rule back to title:Steam only.
Revert ghostty exec-once order.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 08:18:42 -05:00

81 lines
2.9 KiB
Nix

{
config,
pkgs,
myConfig,
...
}: {
home.packages = [
# TODO: will rewrite later
(pkgs.writeShellScriptBin "tte-loop" ''
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[@]}]}"
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" ''
# Get all monitors
monitors=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[].name')
# Launch ghostty on each monitor one at a time
for monitor in $monitors; do
${pkgs.hyprland}/bin/hyprctl dispatch focusmonitor "$monitor"
sleep 0.3
${pkgs.ghostty}/bin/ghostty --config-file=${config.home.homeDirectory}/.config/ghostty/screensaver --fullscreen -e tte-loop &
sleep 1
done
# Monitor for any input and exit when detected
${pkgs.libinput}/bin/libinput debug-events 2>/dev/null | head -n 1 >/dev/null
# Input detected, kill all screensaver instances
${pkgs.procps}/bin/pkill -f "ghostty.*tte-loop"
'')
];
home.file.".config/ghostty/screensaver".text = ''
window-padding-x = 0
window-padding-y = 0
window-padding-color = "extend-always"
'';
programs.ghostty = {
enable = true;
package =
if pkgs.stdenv.isDarwin
then pkgs.ghostty-bin
else pkgs.ghostty;
enableFishIntegration = true;
settings = {
font-family = myConfig.terminal.font;
confirm-close-surface = false;
app-notifications = false;
window-padding-x = 15;
window-padding-y = 15;
window-padding-balance = true;
gtk-titlebar = false;
mouse-hide-while-typing = true;
copy-on-select = "clipboard";
auto-update = "off";
};
};
wayland.windowManager.hyprland.settings.bindd = [
"SUPER, P, Toggle Preload, togglespecialworkspace, preload"
"SUPER SHIFT, P, Move to Preload Special Workspace, movetoworkspace, special:preload"
];
wayland.windowManager.hyprland.settings.exec-once = [
"[workspace special:preload silent] uwsm app -- xdg-terminal-exec"
"[workspace 1] uwsm app -- ghostty -e bash -c 'fastfetch; exec $SHELL'" # TODO: must be xdg-terminal-exec, or default user terminal
];
}