theme: switch vivid theme alongside theme.sh
3 files changed, 28 insertions(+), 1 deletion(-)
A user/settings/fish/functions/toggle-light-dark.fish
@@ -0,0 +1,4 @@ +function toggle-light-dark + last_theme + vivid-toggle +end
A user/settings/fish/functions/vivid-toggle.fish
@@ -0,0 +1,12 @@ +function vivid-toggle + if set --query VIVID_THEME + switch $VIVID_THEME + case '*-light' + set -gx VIVID_THEME $(string replace -- "-light" "-dark" $VIVID_THEME) + case '*-dark' + set -gx VIVID_THEME $(string replace -- "-dark" "-light" $VIVID_THEME) + case '*' + return 1 + end + end +end
M user/settings/theme.nix → user/settings/theme.nix
@@ -1,5 +1,7 @@ { + config, pkgs, + lib, inputs, ... }:@@ -53,7 +55,16 @@ else theme.sh flexoki-light end - bind \co last_theme + function __vivid_update --on-variable VIVID_THEME + set -gx LS_COLORS $(vivid ${ + let + vivid = config.programs.vivid; + in + lib.optionalString (vivid.colorMode != null) "-m ${vivid.colorMode}" + } generate $VIVID_THEME) + end + + bind \co toggle-light-dark ''; };