Rework colorsync file-watching using fswatch instead of watchman

This commit is contained in:
Martin Larsson 2025-08-28 23:00:23 +02:00
parent f74c830e88
commit de289309f7
5 changed files with 72 additions and 85 deletions

View file

@ -0,0 +1,36 @@
{
pkgs,
lib,
config,
isLinux,
isDarwin,
...
}:
let
utils = import ../../utils.nix;
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"
'';
root = "$HOME/.local/state/colorsync/current";
in
lib.mkMerge [
(utils.mkFswatchService {
inherit
pkgs
lib
config
isLinux
isDarwin
;
name = name;
scriptPath = "${colorsyncScriptWrapper}/bin/${name}-wrapper";
root = root;
description = "Run colorsync-scriptrunner after ${root} changes.";
})
]

View file

@ -1,39 +0,0 @@
{
pkgs,
lib,
config,
isLinux,
isDarwin,
...
}:
let
utils = import ../../utils.nix;
in
lib.mkMerge [
(utils.mkWatchmanTrigger {
inherit
pkgs
lib
config
isLinux
isDarwin
;
name = "ghostty";
triggerName = "ghostty_theme";
scriptPath = "$HOME/.config/ghostty/ghostty-change-theme.sh";
description = "Register watchman trigger for Ghostty themes.";
})
(utils.mkWatchmanTrigger {
inherit
pkgs
lib
config
isLinux
isDarwin
;
name = "tmux";
triggerName = "tmux_statusbar_color";
scriptPath = "$HOME/.config/tmux/tmux-statusbar-color.sh";
description = "Register watchman trigger for Tmux statusbar colors.";
})
]