Rework colorsync file-watching using fswatch instead of watchman
This commit is contained in:
parent
f74c830e88
commit
de289309f7
5 changed files with 72 additions and 85 deletions
36
nix/home/common/colorsync_services.nix
Normal file
36
nix/home/common/colorsync_services.nix
Normal 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.";
|
||||
})
|
||||
]
|
||||
|
|
@ -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.";
|
||||
})
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue