From 24ac4753ebbf735385a8d3cf9961bdf27f5c4c1f Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Sun, 8 Jun 2025 13:40:50 +0100 Subject: [PATCH] Add ncspot theme Signed-off-by: Nikolaos Karaolidis --- .../configs/user/console/ncspot/default.nix | 31 +++++++++++-------- .../configs/user/console/ncspot/theme.toml | 23 ++++++++++++++ .../configs/user/console/yazi/theme.toml | 16 +++++----- 3 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 hosts/common/configs/user/console/ncspot/theme.toml diff --git a/hosts/common/configs/user/console/ncspot/default.nix b/hosts/common/configs/user/console/ncspot/default.nix index 1f4d774..2323e44 100644 --- a/hosts/common/configs/user/console/ncspot/default.nix +++ b/hosts/common/configs/user/console/ncspot/default.nix @@ -2,25 +2,30 @@ user ? throw "user argument is required", home ? throw "home argument is required", }: -{ ... }: +{ lib, pkgs, ... }: { environment.persistence = { "/persist/state"."${home}/.config/ncspot/userstate.cbor" = { }; "/persist/cache"."${home}/.cache/ncspot" = { }; }; - home-manager.users.${user}.programs.ncspot = { - enable = true; - settings = { - use_nerdfont = true; - volnorm = true; - default_keybindings = true; - library_tabs = [ - "albums" - "artists" - "playlists" - "browse" - ]; + home-manager.users.${user} = { + programs.ncspot.enable = true; + + theme = { + template.".config/ncspot/config.toml".source = ./theme.toml; + + reloadExtraConfig = "${ + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "reload-ncspot"; + runtimeInputs = with pkgs; [ netcat ]; + text = '' + printf "reload\n" | nc -W 1 -U "''${XDG_RUNTIME_DIR:-/run/user/$UID}/ncspot/ncspot.sock" + ''; + } + ) + } &"; }; }; } diff --git a/hosts/common/configs/user/console/ncspot/theme.toml b/hosts/common/configs/user/console/ncspot/theme.toml new file mode 100644 index 0000000..b7c7583 --- /dev/null +++ b/hosts/common/configs/user/console/ncspot/theme.toml @@ -0,0 +1,23 @@ +use_nerdfont = true +volnorm = true +default_keybindings = true +library_tabs = [ "albums", "artists", "playlists", "browse" ] + +[theme] +background = "{{colors.surface.default.hex}}" +primary = "{{colors.on_surface.default.hex}}" +secondary = "{{colors.surface.default.hex}}" +title = "{{colors.primary.default.hex}}" +playing = "{{colors.primary.default.hex}}" +playing_bg = "{{colors.surface.default.hex}}" +highlight = "{{colors.on_primary.default.hex}}" +highlight_bg = "{{colors.primary.default.hex}}" +playing_selected = "{{colors.on_primary.default.hex}}" +error = "{{colors.on_error.default.hex}}" +error_bg = "{{colors.error.default.hex}}" +statusbar = "{{colors.primary.default.hex}}" +statusbar_progress = "{{colors.primary.default.hex}}" +statusbar_bg = "{{colors.surface.default.hex}}" +cmdline = "{{colors.on_surface.default.hex}}" +cmdline_bg = "{{colors.surface.default.hex}}" +search_match = "{{colors.tertiary.default.hex}}" diff --git a/hosts/common/configs/user/console/yazi/theme.toml b/hosts/common/configs/user/console/yazi/theme.toml index 8d715eb..9b30c5e 100644 --- a/hosts/common/configs/user/console/yazi/theme.toml +++ b/hosts/common/configs/user/console/yazi/theme.toml @@ -1,19 +1,19 @@ [mgr] cwd = { fg = "{{colors.primary.default.hex}}" } -preview_hovered = { underline = false } +preview_hovered = { } -find_keyword = { fg = "{{colors.error.default.hex}}", bold = true, italic = true, underline = true } -find_position = { fg = "{{colors.error.default.hex}}", bg = "reset", bold = true, italic = true } +find_keyword = { fg = "{{colors.tertiary.default.hex}}", bold = true, italic = true, underline = true } +find_position = { fg = "{{colors.tertiary.default.hex}}", bg = "reset", bold = true, italic = true } -marker_copied = { fg = "{{colors.secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" } -marker_cut = { fg = "{{colors.warning.default.hex}}", bg = "{{colors.warning.default.hex}}" } -marker_marked = { fg = "{{colors.error.default.hex}}", bg = "{{colors.error.default.hex}}" } marker_selected = { fg = "{{colors.primary.default.hex}}", bg = "{{colors.primary.default.hex}}" } +marker_copied = { fg = "{{colors.secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" } +marker_cut = { fg = "{{colors.secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" } +marker_marked = { fg = "{{colors.tertiary.default.hex}}", bg = "{{colors.tertiary.default.hex}}" } -count_copied = { fg = "{{colors.on_secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" } -count_cut = { fg = "{{colors.on_warning.default.hex}}", bg = "{{colors.warning.default.hex}}" } count_selected = { fg = "{{colors.on_primary.default.hex}}", bg = "{{colors.primary.default.hex}}" } +count_copied = { fg = "{{colors.on_secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" } +count_cut = { fg = "{{colors.on_secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" } border_style = { fg = "{{colors.outline.default.hex}}" }