diff --git a/nix/home/common/colorsync_services.nix b/nix/home/common/colorsync_services.nix index 87c5c37..60fe468 100644 --- a/nix/home/common/colorsync_services.nix +++ b/nix/home/common/colorsync_services.nix @@ -12,10 +12,15 @@ let name = "colorsync-scriptrunner"; colorsyncScriptWrapper = pkgs.writeShellScriptBin "${name}-wrapper" '' set -euo pipefail - echo colorsync-scriptrunner is executing - "$HOME/.config/tmux/tmux-statusbar-color.sh" - "$HOME/.config/ghostty/ghostty-change-theme.sh" + + if tmux has-session 2>/dev/null; then + "$HOME/.config/tmux/tmux-statusbar-color.sh" || true + fi + + if command -v ghostty >/dev/null 2>&1; then + "$HOME/.config/ghostty/ghostty-change-theme.sh" || true + fi ''; root = "$HOME/.local/state/colorsync/current"; in diff --git a/nix/utils.nix b/nix/utils.nix index 5581e78..7219c9b 100644 --- a/nix/utils.nix +++ b/nix/utils.nix @@ -61,19 +61,16 @@ rec { description ? "Register ${name}.", }: let + fswatchLatencyArg = if isDarwin then "--latency=0.2" else ""; scriptPkg = pkgs.writeShellScriptBin "${name}" '' set -euo pipefail ROOT="${root}" SCRIPT="${scriptPath}" FSWATCH="${pkgs.fswatch}/bin/fswatch" + FSWATCH_LATENCY_ARG="${fswatchLatencyArg}" - echo root:"$ROOT" - echo script:"$SCRIPT" - echo fswatch:"$FSWATCH" - echo home:"$HOME" - - "$FSWATCH" --latency=0.2 -o "$ROOT" | xargs -n1 "$SCRIPT" + "$FSWATCH" $FSWATCH_LATENCY_ARG --event=Updated --event=Created --event=Removed --event=Renamed -o --exclude '\.DS_Store$' "$ROOT" | xargs -n1 "$SCRIPT" ''; baseBinPath = lib.makeBinPath [