Skip to content

Commit

Permalink
Add service to sync alacritty theme with OS appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
sestrella committed Jun 7, 2024
1 parent ff3b094 commit fa4557c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions home/alacritty/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,24 @@
ln -sf "$(theme)" ~/.config/alacritty/theme.yml
'';

launchd.agents.alacritty.enable = true;
launchd.agents.alacritty.config = {
ProgramArguments =
let
alacrittyTheme = pkgs.writeScriptBin "alacritty-theme" ''
if [ "$1" == "dark" ]; then
ln -sf "${pkgs.alacritty-theme}/solarized_dark.yaml" ~/.config/alacritty/theme.yml
else
ln -sf "${pkgs.alacritty-theme}/solarized_light.yaml" ~/.config/alacritty/theme.yml
fi
touch -h ~/.config/alacritty/alacritty.yml
'';
in
[
"/opt/homebrew/bin/dark-notify"
"-c"
"${alacrittyTheme}/bin/alacritty-theme"
];
};
}

0 comments on commit fa4557c

Please sign in to comment.