Skip to content

Commit

Permalink
[helix] Change theme based on OS appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
sestrella committed Jan 3, 2025
1 parent 7b5abb5 commit 3cd6640
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions home/helix/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ pkgs, ... }:
{
config,
lib,
pkgs,
...
}:

{
programs.helix = {
Expand Down Expand Up @@ -27,7 +32,17 @@
];
};
settings = {
theme = "solarized_dark";
theme = "solarized";
};
};

home.activation.helixTheme = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p ~/.config/helix/themes
style=$(/usr/bin/defaults read -g AppleInterfaceStyle 2> /dev/null || echo "Light")
if [ "$style" == "Dark" ]; then
ln -sf ${config.programs.helix.package}/lib/runtime/themes/solarized_dark.toml ~/.config/helix/themes/solarized.toml
else
ln -sf ${config.programs.helix.package}/lib/runtime/themes/solarized_light.toml ~/.config/helix/themes/solarized.toml
fi
'';
}

0 comments on commit 3cd6640

Please sign in to comment.