From 19c027c498d1560235cc4ee45e2b8678e223fca6 Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Thu, 17 Aug 2023 21:24:52 +0100 Subject: [PATCH] Use single config for cinnamon theme I only switch between two themes anyway... --- home/cinnamon.nix | 134 +++++++++++++++++++++++----------------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/home/cinnamon.nix b/home/cinnamon.nix index bdcd26aa..0f8c2c70 100644 --- a/home/cinnamon.nix +++ b/home/cinnamon.nix @@ -15,79 +15,79 @@ let in { options = with lib; { - me.cinnamon.theme = mkOption { - type = types.str; - default = "Mint-Y-Dark-Aqua"; - }; me.cinnamon.dark-mode = mkOption { type = types.bool; }; }; - config = { - dconf.settings = { - # custom keybindings - "org/cinnamon/desktop/keybindings/custom-keybindings/custom0" = { - binding = [ "s" ]; - command = mkShortcutCommand "slack"; - name = "Slack"; - }; - "org/cinnamon/desktop/keybindings/custom-keybindings/custom1" = { - binding = [ "t" ]; - command = mkShortcutCommand terminal; - name = "Terminal"; - }; - "org/cinnamon/desktop/keybindings/custom-keybindings/custom2" = { - binding = [ "c" ]; - command = mkShortcutCommand browser; - name = "Browser"; - }; - "org/cinnamon/desktop/keybindings/custom-keybindings/custom3" = { - binding = [ "e" ]; - command = mkShortcutCommand "obsidian"; - name = "Notes"; - }; - "org/cinnamon/desktop/keybindings/custom-keybindings/custom4" = { - binding = [ "r" ]; - command = mkShortcutCommand "zeal"; - name = "Documentation"; - }; - "org/cinnamon/desktop/keybindings" = { - custom-list = [ "__dummy__" "custom0" "custom1" "custom2" "custom3" "custom4" ]; - }; - # media keys - "org/cinnamon/desktop/keybindings/media-keys" = { - previous = [ "XF86AudioPrev" "F7" ]; - play = [ "XF86AudioPlay" "F8" ]; - next = [ "XF86AudioNext" "F9" ]; - mute = [ "XF86AudioMute" "F10" ]; - volume-down = [ "XF86AudioLowerVolume" "F11" ]; - volume-up = [ "XF86AudioRaiseVolume" "F12" ]; - }; - # other - "org/cinnamon/desktop/wm/preferences" = { - button-layout = "close,maximize,minimize:"; - titlebar-font = "Ubuntu Bold 10"; - }; - "org/cinnamon" = { - alttab-switcher-style = "icons+preview"; - }; + config = + let + theme = if cfg.dark-mode then "Mint-Y-Dark-Aqua" else "Mint-Y-Aqua"; + in + { + dconf.settings = { + # custom keybindings + "org/cinnamon/desktop/keybindings/custom-keybindings/custom0" = { + binding = [ "s" ]; + command = mkShortcutCommand "slack"; + name = "Slack"; + }; + "org/cinnamon/desktop/keybindings/custom-keybindings/custom1" = { + binding = [ "t" ]; + command = mkShortcutCommand terminal; + name = "Terminal"; + }; + "org/cinnamon/desktop/keybindings/custom-keybindings/custom2" = { + binding = [ "c" ]; + command = mkShortcutCommand browser; + name = "Browser"; + }; + "org/cinnamon/desktop/keybindings/custom-keybindings/custom3" = { + binding = [ "e" ]; + command = mkShortcutCommand "obsidian"; + name = "Notes"; + }; + "org/cinnamon/desktop/keybindings/custom-keybindings/custom4" = { + binding = [ "r" ]; + command = mkShortcutCommand "zeal"; + name = "Documentation"; + }; + "org/cinnamon/desktop/keybindings" = { + custom-list = [ "__dummy__" "custom0" "custom1" "custom2" "custom3" "custom4" ]; + }; + # media keys + "org/cinnamon/desktop/keybindings/media-keys" = { + previous = [ "XF86AudioPrev" "F7" ]; + play = [ "XF86AudioPlay" "F8" ]; + next = [ "XF86AudioNext" "F9" ]; + mute = [ "XF86AudioMute" "F10" ]; + volume-down = [ "XF86AudioLowerVolume" "F11" ]; + volume-up = [ "XF86AudioRaiseVolume" "F12" ]; + }; + # other + "org/cinnamon/desktop/wm/preferences" = { + button-layout = "close,maximize,minimize:"; + titlebar-font = "Ubuntu Bold 10"; + }; + "org/cinnamon" = { + alttab-switcher-style = "icons+preview"; + }; - # theming - "org/x/apps/portal" = { - color-scheme = if cfg.dark-mode then "prefer-dark" else "prefer-light"; - }; - "org/cinnamon/desktop/interface" = { - gtk-theme = cfg.theme; - icon-theme = cfg.theme; - font-name = "Ubuntu Medium 10"; - }; - "org/nemo/desktop" = { - font = "Ubuntu Medium 10"; - }; - "org/cinnamon/theme" = { - name = cfg.theme; + # theming + "org/x/apps/portal" = { + color-scheme = if cfg.dark-mode then "prefer-dark" else "prefer-light"; + }; + "org/cinnamon/desktop/interface" = { + gtk-theme = theme; + icon-theme = theme; + font-name = "Ubuntu Medium 10"; + }; + "org/nemo/desktop" = { + font = "Ubuntu Medium 10"; + }; + "org/cinnamon/theme" = { + name = theme; + }; }; }; - }; }