diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/modules/matugen/templates/matugen-discord.nix | 177 | ||||
| -rw-r--r-- | common/modules/matugen/templates/matugen-neovim.nix | 74 | ||||
| -rw-r--r-- | common/modules/matugen/templates/matugen-nvim.nix | 18 | ||||
| -rw-r--r-- | common/modules/matugen/templates/matugen-sequences.nix | 32 | ||||
| -rw-r--r-- | common/modules/matugen/templates/matugen-vesktop.nix | 179 | ||||
| -rw-r--r-- | common/modules/matugen/templates/matugen-xresources.nix | 38 | ||||
| -rw-r--r-- | common/modules/terminal/alacritty.nix | 18 | ||||
| -rw-r--r-- | common/modules/terminal/foot.nix | 2 | ||||
| -rw-r--r-- | common/modules/terminal/ghostty.nix | 2 | ||||
| -rw-r--r-- | common/modules/window_managers/default.nix | 1 | ||||
| -rw-r--r-- | common/modules/window_managers/dwm/default.nix | 4 | ||||
| -rw-r--r-- | common/modules/window_managers/dwm/scripts.nix | 79 | ||||
| -rw-r--r-- | common/modules/window_managers/hyprland/default.nix | 79 | ||||
| -rw-r--r-- | common/programs/btop.nix | 2 | ||||
| -rw-r--r-- | common/templates/default.nix | 5 |
15 files changed, 414 insertions, 296 deletions
diff --git a/common/modules/matugen/templates/matugen-discord.nix b/common/modules/matugen/templates/matugen-discord.nix new file mode 100644 index 0000000..054155c --- /dev/null +++ b/common/modules/matugen/templates/matugen-discord.nix @@ -0,0 +1,177 @@ +{ + config, + lib, + ... +}: +{ + xdg.configFile."matugen/templates/discord.css" = { + text = '' + /** + * @name system24 + * @description a tui-style discord theme. Matugen Material UI + Original Base Colors. + * @author refact0r + * @version 2.0.0 + * @invite nz87hXyvcy + * @website https://github.com/refact0r/system24 + * @source https://github.com/refact0r/system24/blob/master/theme/system24.theme.css + */ + + /* import theme modules */ + @import url("https://refact0r.github.io/system24/build/system24.css"); + + body { + /* font options */ + --font: "IosevkaInput"; + --code-font: "IosevkaInput"; + font-weight: 300; + letter-spacing: -0.05ch; + + /* sizes */ + --gap: 12px; + --divider-thickness: 4px; + --border-thickness: 2px; + --border-hover-transition: 0.2s ease; + + /* animation/transition options */ + --animations: off; + --list-item-transition: 0.2s ease; + --dms-icon-svg-transition: 0.4s ease; + + /* top bar options */ + --top-bar-height: var(--gap); + --top-bar-button-position: titlebar; + --top-bar-title-position: off; + --subtle-top-bar-title: off; + + /* window controls */ + --custom-window-controls: off; + --window-control-size: 14px; + + /* dms button options */ + --custom-dms-icon: off; + --dms-icon-svg-url: url(""); + --dms-icon-svg-size: 90%; + --dms-icon-color-before: var(--icon-subtle); + --dms-icon-color-after: var(--white); + --custom-dms-background: off; + --dms-background-image-url: url(""); + --dms-background-image-size: cover; + --dms-background-color: linear-gradient(70deg, var(--blue-2), var(--purple-2), var(--red-2)); + + /* background image options */ + --background-image: off; + --background-image-url: url(""); + + /* transparency/blur options */ + --transparency-tweaks: off; + --remove-bg-layer: off; + --panel-blur: off; + --blur-amount: 12px; + --bg-floating: var(--bg-3); + + /* other options */ + --small-user-panel: on; + + /* unrounding options */ + --unrounding: on; + + /* styling options */ + --custom-spotify-bar: on; + --ascii-titles: on; + --ascii-loader: system24; + + /* panel labels */ + --panel-labels: on; + --label-color: var(--text-muted); + --label-font-weight: 500; + } + + /* color options */ + :root { + --colors: on; + + /* text colors - mapped to matugen safe hex */ + --text-0: var(--bg-4); + --text-1: {{colors.on_surface.default.hex}}; + --text-2: {{colors.on_surface.default.hex}}; + --text-3: {{colors.on_surface_variant.default.hex}}; + --text-4: {{colors.outline.default.hex}}; + --text-5: {{colors.outline_variant.default.hex}}; + + /* background colors - mapped to matugen safe hex */ + --bg-1: {{colors.surface_variant.default.hex}}; + --bg-2: {{colors.surface_container_high.default.hex}}; + --bg-3: {{colors.surface_container_low.default.hex}}; + <* if {{ is_dark_mode }} *> + --bg-4: {{colors.surface.default.hex}}; + <* else *> + --bg-4: {{colors.surface_container_low.default.hex}}; + <* endif *> + + /* hovers - using on_surface hex + CSS hex opacity (1a=10%, 33=20%, 4d=30%) */ + --hover: {{colors.on_surface.default.hex}}1a; + --active: {{colors.on_surface.default.hex}}33; + --active-2: {{colors.on_surface.default.hex}}4d; + --message-hover: var(--hover); + + /* accent colors - Replaced with Matugen Colors */ + --accent-1: {{colors.tertiary.default.hex}}; + --accent-2: {{colors.primary.default.hex}}; + --accent-3: {{colors.primary.default.hex}}; + --accent-4: {{colors.primary_container.default.hex}}; + --accent-5: {{colors.primary_fixed_dim.default.hex}}; + --accent-new: {{colors.error.default.hex}}; + + /* Math kept identical, only source colors swapped to Matugen */ + --mention: linear-gradient(to right, color-mix(in hsl, {{colors.primary.default.hex}}, transparent 90%) 40%, transparent); + --mention-hover: linear-gradient(to right, color-mix(in hsl, {{colors.primary.default.hex}}, transparent 95%) 40%, transparent); + --reply: linear-gradient(to right, color-mix(in hsl, {{colors.on_surface_variant.default.hex}}, transparent 90%) 40%, transparent); + --reply-hover: linear-gradient(to right, color-mix(in hsl, {{colors.on_surface_variant.default.hex}}, transparent 95%) 40%, transparent); + + /* status indicator colors - Kept original as requested, updated offline */ + --online: var(--green-2); + --dnd: var(--red-2); + --idle: var(--yellow-2); + --streaming: var(--purple-2); + --offline: {{colors.outline.default.hex}}; + + /* border colors */ + --border-light: var(--hover); + --border: var(--active); + --border-hover: {{colors.primary.default.hex}}; + --button-border: {{colors.on_surface.default.hex}}1a; + + /* base colors - UNTOUCHED OKLCH FROM ORIGINAL */ + --red-1: oklch(75% 0.13 0); + --red-2: oklch(70% 0.13 0); + --red-3: oklch(65% 0.13 0); + --red-4: oklch(60% 0.13 0); + --red-5: oklch(55% 0.13 0); + + --green-1: oklch(75% 0.12 170); + --green-2: oklch(70% 0.12 170); + --green-3: oklch(65% 0.12 170); + --green-4: oklch(60% 0.12 170); + --green-5: oklch(55% 0.12 160); + + --blue-1: oklch(75% 0.11 215); + --blue-2: oklch(70% 0.11 215); + --blue-3: oklch(65% 0.11 215); + --blue-4: oklch(60% 0.11 215); + --blue-5: oklch(55% 0.11 215); + + --yellow-1: oklch(80% 0.12 90); + --yellow-2: oklch(75% 0.12 90); + --yellow-3: oklch(70% 0.12 90); + --yellow-4: oklch(65% 0.12 90); + --yellow-5: oklch(60% 0.12 90); + + --purple-1: oklch(75% 0.12 310); + --purple-2: oklch(70% 0.12 310); + --purple-3: oklch(65% 0.12 310); + --purple-4: oklch(60% 0.12 310); + --purple-5: oklch(55% 0.12 310); + } + ''; + }; +} diff --git a/common/modules/matugen/templates/matugen-neovim.nix b/common/modules/matugen/templates/matugen-neovim.nix new file mode 100644 index 0000000..9a1b558 --- /dev/null +++ b/common/modules/matugen/templates/matugen-neovim.nix @@ -0,0 +1,74 @@ +{ + config, + lib, + ... +}: +{ + xdg.configFile = { + "matugen/templates/neovim.lua" = { + text = '' + local present, base46 = pcall(require, "base46") + if not present or not base46._DMS_SUPPORT then + vim.notify( + "base46 plugin not found or incorrect, make sure to install AvengeMedia/base46", + vim.log.levels.ERROR, + { title = "matugen integration" } + ) + return + end + + local settings = { + matugenTemplateNeovimSetBackground = true + } + + vim.o.background = "{{mode}}" + + local current_file_path = debug.getinfo(1, "S").source:sub(2) + local theme_base = nil + if vim.o.background == "dark" then + theme_base = "aquarium" + else + theme_base = "flex-light" + end + local harmony = 0.5 + local theme_name = "matugen" + + if not _G._matugen_theme_watcher then + local uv = vim.uv or vim.loop + _G._matugen_theme_watcher = { uv.new_fs_event(), reload_timer = uv.new_timer() } + + local debounce_time = 100 -- ms + local function handler() + _G._matugen_theme_watcher.reload_timer:stop() + _G._matugen_theme_watcher.reload_timer:start( + debounce_time, + 0, + vim.schedule_wrap(function() + base46.theme_tables[theme_name] = nil + if vim.g.colors_name == theme_name then + vim.cmd.colorscheme(theme_name) + end + _G._matugen_theme_watcher[1]:stop() + _G._matugen_theme_watcher[1]:start(current_file_path, {}, handler) + end) + ) + end + _G._matugen_theme_watcher[1]:start(current_file_path, {}, handler) + end + + if not base46.theme_tables[theme_name] or base46.theme_tables[theme_name].type ~= vim.o.background then + local builtin = vim.deepcopy(assert(base46.get_builtin_theme(theme_base))) + local harmonized = base46.theme_harmonize(builtin, "{{colors.primary.default.hex}}", harmony) + if settings.matugenTemplateNeovimSetBackground ~= false then + harmonized = base46.theme_set_bg(harmonized, "{{colors.background.default.hex}}") + end + + base46.theme_tables[theme_name] = harmonized + end + + base46.load(theme_name) + vim.g.colors_name = theme_name + ''; + }; + }; +} diff --git a/common/modules/matugen/templates/matugen-nvim.nix b/common/modules/matugen/templates/matugen-nvim.nix new file mode 100644 index 0000000..0b7b421 --- /dev/null +++ b/common/modules/matugen/templates/matugen-nvim.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + ... +}: +{ + xdg.configFile = { + "matugen/templates/neovim.json" = { + text = '' + { + "mode": "{{mode}}", + "source_color":"{{colors.primary.default.hex}}", + "background":"{{colors.background.default.hex}}" + } + ''; + }; + }; +} diff --git a/common/modules/matugen/templates/matugen-sequences.nix b/common/modules/matugen/templates/matugen-sequences.nix index ac6e413..03bc538 100644 --- a/common/modules/matugen/templates/matugen-sequences.nix +++ b/common/modules/matugen/templates/matugen-sequences.nix @@ -9,22 +9,22 @@ text = '' #!/bin/sh SEQ="" - SEQ="$SEQ$(printf '\033]4;0;{{dank16.color0.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;1;{{dank16.color1.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;2;{{dank16.color2.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;3;{{dank16.color3.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;4;{{dank16.color4.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;5;{{dank16.color5.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;6;{{dank16.color6.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;7;{{dank16.color7.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;8;{{dank16.color8.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;9;{{dank16.color9.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;10;{{dank16.color10.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;11;{{dank16.color11.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;12;{{dank16.color12.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;13;{{dank16.color13.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;14;{{dank16.color14.default.hex}}\007')" - SEQ="$SEQ$(printf '\033]4;15;{{dank16.color15.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;0;{{colors.surface_variant.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;1;{{colors.error.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;2;{{colors.primary.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;3;{{colors.secondary.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;4;{{colors.tertiary.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;5;{{colors.primary_fixed_dim.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;6;{{colors.secondary_fixed_dim.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;7;{{colors.on_surface.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;8;{{colors.on_surface_variant.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;9;{{colors.error.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;10;{{colors.primary.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;11;{{colors.secondary.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;12;{{colors.tertiary.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;13;{{colors.primary_fixed_dim.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;14;{{colors.secondary_fixed_dim.default.hex}}\007')" + SEQ="$SEQ$(printf '\033]4;15;{{colors.on_surface.default.hex}}\007')" SEQ="$SEQ$(printf '\033]10;{{colors.on_surface.default.hex}}\007')" SEQ="$SEQ$(printf '\033]11;{{colors.background.default.hex}}\007')" # <* if {{ is_dark_mode }} *> diff --git a/common/modules/matugen/templates/matugen-vesktop.nix b/common/modules/matugen/templates/matugen-vesktop.nix deleted file mode 100644 index 461d2c6..0000000 --- a/common/modules/matugen/templates/matugen-vesktop.nix +++ /dev/null @@ -1,179 +0,0 @@ -{ - config, - lib, - ... -}: -{ - config = lib.mkIf config.programs.vesktop.enable { - xdg.configFile."matugen/templates/vesktop.css" = { - text = '' - /** - * @name system24 - * @description a tui-style discord theme. Matugen Material UI + Original Base Colors. - * @author refact0r - * @version 2.0.0 - * @invite nz87hXyvcy - * @website https://github.com/refact0r/system24 - * @source https://github.com/refact0r/system24/blob/master/theme/system24.theme.css - */ - - /* import theme modules */ - @import url("https://refact0r.github.io/system24/build/system24.css"); - - body { - /* font options */ - --font: "IosevkaInput"; - --code-font: "IosevkaInput"; - font-weight: 300; - letter-spacing: -0.05ch; - - /* sizes */ - --gap: 12px; - --divider-thickness: 4px; - --border-thickness: 2px; - --border-hover-transition: 0.2s ease; - - /* animation/transition options */ - --animations: off; - --list-item-transition: 0.2s ease; - --dms-icon-svg-transition: 0.4s ease; - - /* top bar options */ - --top-bar-height: var(--gap); - --top-bar-button-position: titlebar; - --top-bar-title-position: off; - --subtle-top-bar-title: off; - - /* window controls */ - --custom-window-controls: off; - --window-control-size: 14px; - - /* dms button options */ - --custom-dms-icon: off; - --dms-icon-svg-url: url(""); - --dms-icon-svg-size: 90%; - --dms-icon-color-before: var(--icon-subtle); - --dms-icon-color-after: var(--white); - --custom-dms-background: off; - --dms-background-image-url: url(""); - --dms-background-image-size: cover; - --dms-background-color: linear-gradient(70deg, var(--blue-2), var(--purple-2), var(--red-2)); - - /* background image options */ - --background-image: off; - --background-image-url: url(""); - - /* transparency/blur options */ - --transparency-tweaks: off; - --remove-bg-layer: off; - --panel-blur: off; - --blur-amount: 12px; - --bg-floating: var(--bg-3); - - /* other options */ - --small-user-panel: on; - - /* unrounding options */ - --unrounding: on; - - /* styling options */ - --custom-spotify-bar: on; - --ascii-titles: on; - --ascii-loader: system24; - - /* panel labels */ - --panel-labels: on; - --label-color: var(--text-muted); - --label-font-weight: 500; - } - - /* color options */ - :root { - --colors: on; - - /* text colors - mapped to matugen safe hex */ - --text-0: var(--bg-4); - --text-1: {{colors.on_surface.default.hex}}; - --text-2: {{colors.on_surface.default.hex}}; - --text-3: {{colors.on_surface_variant.default.hex}}; - --text-4: {{colors.outline.default.hex}}; - --text-5: {{colors.outline_variant.default.hex}}; - - /* background colors - mapped to matugen safe hex */ - --bg-1: {{colors.surface_variant.default.hex}}; - --bg-2: {{colors.surface_container_high.default.hex}}; - --bg-3: {{colors.surface_container_low.default.hex}}; - <* if {{ is_dark_mode }} *> - --bg-4: {{colors.surface.default.hex}}; - <* else *> - --bg-4: {{colors.surface_container_low.default.hex}}; - <* endif *> - - /* hovers - using on_surface hex + CSS hex opacity (1a=10%, 33=20%, 4d=30%) */ - --hover: {{colors.on_surface.default.hex}}1a; - --active: {{colors.on_surface.default.hex}}33; - --active-2: {{colors.on_surface.default.hex}}4d; - --message-hover: var(--hover); - - /* accent colors - Replaced with Matugen Colors */ - --accent-1: {{colors.tertiary.default.hex}}; - --accent-2: {{colors.primary.default.hex}}; - --accent-3: {{colors.primary.default.hex}}; - --accent-4: {{colors.primary_container.default.hex}}; - --accent-5: {{colors.primary_fixed_dim.default.hex}}; - --accent-new: {{colors.error.default.hex}}; - - /* Math kept identical, only source colors swapped to Matugen */ - --mention: linear-gradient(to right, color-mix(in hsl, {{colors.primary.default.hex}}, transparent 90%) 40%, transparent); - --mention-hover: linear-gradient(to right, color-mix(in hsl, {{colors.primary.default.hex}}, transparent 95%) 40%, transparent); - --reply: linear-gradient(to right, color-mix(in hsl, {{colors.on_surface_variant.default.hex}}, transparent 90%) 40%, transparent); - --reply-hover: linear-gradient(to right, color-mix(in hsl, {{colors.on_surface_variant.default.hex}}, transparent 95%) 40%, transparent); - - /* status indicator colors - Kept original as requested, updated offline */ - --online: var(--green-2); - --dnd: var(--red-2); - --idle: var(--yellow-2); - --streaming: var(--purple-2); - --offline: {{colors.outline.default.hex}}; - - /* border colors */ - --border-light: var(--hover); - --border: var(--active); - --border-hover: {{colors.primary.default.hex}}; - --button-border: {{colors.on_surface.default.hex}}1a; - - /* base colors - UNTOUCHED OKLCH FROM ORIGINAL */ - --red-1: oklch(75% 0.13 0); - --red-2: oklch(70% 0.13 0); - --red-3: oklch(65% 0.13 0); - --red-4: oklch(60% 0.13 0); - --red-5: oklch(55% 0.13 0); - - --green-1: oklch(75% 0.12 170); - --green-2: oklch(70% 0.12 170); - --green-3: oklch(65% 0.12 170); - --green-4: oklch(60% 0.12 170); - --green-5: oklch(55% 0.12 160); - - --blue-1: oklch(75% 0.11 215); - --blue-2: oklch(70% 0.11 215); - --blue-3: oklch(65% 0.11 215); - --blue-4: oklch(60% 0.11 215); - --blue-5: oklch(55% 0.11 215); - - --yellow-1: oklch(80% 0.12 90); - --yellow-2: oklch(75% 0.12 90); - --yellow-3: oklch(70% 0.12 90); - --yellow-4: oklch(65% 0.12 90); - --yellow-5: oklch(60% 0.12 90); - - --purple-1: oklch(75% 0.12 310); - --purple-2: oklch(70% 0.12 310); - --purple-3: oklch(65% 0.12 310); - --purple-4: oklch(60% 0.12 310); - --purple-5: oklch(55% 0.12 310); - } - ''; - }; - }; -} diff --git a/common/modules/matugen/templates/matugen-xresources.nix b/common/modules/matugen/templates/matugen-xresources.nix index 292f0f2..94f4e93 100644 --- a/common/modules/matugen/templates/matugen-xresources.nix +++ b/common/modules/matugen/templates/matugen-xresources.nix @@ -29,29 +29,23 @@ st.foreground: {{colors.on_surface.default.hex}} st.cursorColor: {{colors.primary.default.hex}} - st.color0: {{dank16.color0.default.hex}} - st.color8: {{dank16.color8.default.hex}} + st.color0 : {{colors.surface_variant.default.hex}} + st.color1 : {{colors.error.default.hex}} + st.color2 : {{colors.primary.default.hex}} + st.color3 : {{colors.secondary.default.hex}} + st.color4 : {{colors.tertiary.default.hex}} + st.color5 : {{colors.primary_fixed_dim.default.hex}} + st.color6 : {{colors.secondary_fixed_dim.default.hex}} + st.color7 : {{colors.on_surface.default.hex}} - st.color1: {{dank16.color1.default.hex}} - st.color9: {{dank16.color9.default.hex}} - - st.color2: {{dank16.color2.default.hex}} - st.color10: {{dank16.color10.default.hex}} - - st.color3: {{dank16.color3.default.hex}} - st.color11: {{dank16.color11.default.hex}} - - st.color4: {{dank16.color4.default.hex}} - st.color12: {{dank16.color12.default.hex}} - - st.color5: {{dank16.color5.default.hex}} - st.color13: {{dank16.color13.default.hex}} - - st.color6: {{dank16.color6.default.hex}} - st.color14: {{dank16.color14.default.hex}} - - st.color7: {{dank16.color7.default.hex}} - st.color15: {{dank16.color15.default.hex}} + st.color8 : {{colors.on_surface_variant.default.hex}} + st.color9 : {{colors.error.default.hex}} + st.color10: {{colors.primary.default.hex}} + st.color11: {{colors.secondary.default.hex}} + st.color12: {{colors.tertiary.default.hex}} + st.color13: {{colors.primary_fixed_dim.default.hex}} + st.color14: {{colors.secondary_fixed_dim.default.hex}} + st.color15: {{colors.on_surface.default.hex}} ''; }; }; diff --git a/common/modules/terminal/alacritty.nix b/common/modules/terminal/alacritty.nix index 09cb54f..cbea179 100644 --- a/common/modules/terminal/alacritty.nix +++ b/common/modules/terminal/alacritty.nix @@ -13,17 +13,19 @@ in cursor = { thickness = 0.0; }; - debug = { - prefer_egl = true; - }; colors = { draw_bold_text_with_bright_colors = cfg.font.bright_color_is_bold; + + cursor = { + text = "CellBackground"; + # cursor = "CellForeground"; + }; }; mouse = { hide_when_typing = true; }; general = { - import = lib.optionals config.beeMods.matugen.enable [ "~/.config/alacritty/colors.toml" ]; + import = lib.optionals config.beeMods.matugen.enable [ "~/.config/alacritty/themes/noctalia.toml" ]; }; window = { dynamic_padding = true; @@ -31,10 +33,10 @@ in y = cfg.window.padding-y; x = cfg.window.padding-x; }; - dimensions = { - lines = 75; - columns = 100; - }; + # dimensions = { + # lines = 75; + # columns = 100; + # }; }; font = { normal.family = cfg.font.family; diff --git a/common/modules/terminal/foot.nix b/common/modules/terminal/foot.nix index ff020c6..f9cd424 100644 --- a/common/modules/terminal/foot.nix +++ b/common/modules/terminal/foot.nix @@ -11,7 +11,7 @@ in enable = true; settings = { main = { - include = lib.optionals config.beeMods.matugen.enable [ "~/.config/foot/dank-colors.ini" ]; + include = lib.optionals config.beeMods.matugen.enable [ "~/.config/foot/themes/noctalia" ]; pad = "${toString cfg.window.padding-x}x${toString cfg.window.padding-y} center"; font = "${cfg.font.family}:size=${toString cfg.font.size}"; diff --git a/common/modules/terminal/ghostty.nix b/common/modules/terminal/ghostty.nix index c47e991..0926fe9 100644 --- a/common/modules/terminal/ghostty.nix +++ b/common/modules/terminal/ghostty.nix @@ -11,7 +11,7 @@ in enable = true; enableFishIntegration = true; settings = { - theme = lib.optionalString config.beeMods.matugen.enable "matugen"; + theme = lib.optionalString config.beeMods.matugen.enable "noctalia"; font-family = cfg.font.family; font-size = cfg.font.size; diff --git a/common/modules/window_managers/default.nix b/common/modules/window_managers/default.nix index 7b51946..6591583 100644 --- a/common/modules/window_managers/default.nix +++ b/common/modules/window_managers/default.nix @@ -62,6 +62,7 @@ in wl-clipboard cliphist brightnessctl + maim ]; } else diff --git a/common/modules/window_managers/dwm/default.nix b/common/modules/window_managers/dwm/default.nix index f665d06..d1f7850 100644 --- a/common/modules/window_managers/dwm/default.nix +++ b/common/modules/window_managers/dwm/default.nix @@ -132,10 +132,8 @@ in ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1 & [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources + xrandr --output eDP --set TearFree on - dunst & - clipcatd & - slstatus & sync_dms systemctl --user restart xidlehook.service xautolock-session.service xss-lock.service clipcat.service ''; diff --git a/common/modules/window_managers/dwm/scripts.nix b/common/modules/window_managers/dwm/scripts.nix index 5b52686..25ecc19 100644 --- a/common/modules/window_managers/dwm/scripts.nix +++ b/common/modules/window_managers/dwm/scripts.nix @@ -3,43 +3,76 @@ homeManager: let sync_dms = pkgs.writeShellScriptBin "sync_dms" '' jq=${pkgs.jq}/bin/jq - CONFIG_FILE=$HOME/.local/state/DankMaterialShell/session.json + SETTINGS_FILE="$HOME/.config/noctalia/settings.json" + WALLPAPER_FILE="$HOME/.cache/noctalia/wallpapers.json" - get_val() { $jq -r ".$1" "$CONFIG_FILE"; } - set_val() { + # --- Helpers --- + + get_setting() { + $jq -r "$1" "$SETTINGS_FILE" + } + + toggle_nightlight_state() { local tmp=$(mktemp) - $jq --arg val "$2" ".$1 = \$val" "$CONFIG_FILE" > "$tmp" && mv "$tmp" "$CONFIG_FILE" + # Flips the boolean cleanly without changing it to a string + $jq '.nightLight.enabled = (.nightLight.enabled | not)' "$SETTINGS_FILE" > "$tmp" && mv "$tmp" "$SETTINGS_FILE" } + # --- Modules --- + + apply_wallpaper() { + # Read dark mode and monitor preferences from settings.json + local is_dark=$(get_setting '.colorSchemes.darkMode') + local monitor=$(get_setting '.colorSchemes.monitorForColors') + + # Default to eDP-1 if monitor setting is missing + if [[ "$monitor" == "null" || -z "$monitor" ]]; then + monitor="eDP-1" + fi + + local mode="light" + if [[ "$is_dark" == "true" ]]; then + mode="dark" + fi - function sync_all { - ISNIGHTMODE=$(get_val "nightModeEnabled") - NIGHTMODETEMP=$(get_val "nightModeTemperature") - WALL=$(get_val "wallpaperPath") - ${pkgs.xwallpaper}/bin/xwallpaper --zoom "$WALL" + # Use jq variables to safely parse the nested monitor and mode keys + local wall=$($jq -r --arg mon "$monitor" --arg mode "$mode" '.wallpapers[$mon][$mode]' "$WALLPAPER_FILE") - if [[ "$ISNIGHTMODE" == "true" ]]; then - echo "bitch $ISNIGHTMODE" - ${pkgs.redshift}/bin/redshift -o "$NIGHTMODETEMP" + if [[ "$wall" != "null" && -n "$wall" ]]; then + ${pkgs.xwallpaper}/bin/xwallpaper --zoom "$wall" + fi + } + + apply_nightlight() { + local is_night_mode=$(get_setting '.nightLight.enabled') + local night_temp=$(get_setting '.nightLight.nightTemp') + + if [[ "$is_night_mode" == "true" ]]; then + echo "bitch $is_night_mode" + # -P resets prior adjustments, -O applies one-shot manual temperature + ${pkgs.redshift}/bin/redshift -P -O "$night_temp" else + # -x clears all redshift adjustments ${pkgs.redshift}/bin/redshift -x fi } - function dmenu_settings { - ISNIGHTMODE=$(get_val "nightModeEnabled") - options="NightMode (Currently $ISNIGHTMODE)\nSync Now" + sync_all() { + apply_wallpaper + apply_nightlight + } - choice=$(echo -e "$options" | dmenu -p "Settings:") + dmenu_settings() { + local is_night_mode=$(get_setting '.nightLight.enabled') + local options="Toggle NightMode (Currently $is_night_mode)\nSync Now" + + local choice=$(echo -e "$options" | dmenu -p "Settings:") case "$choice" in *"NightMode"*) - if [[ "$ISNIGHTMODE" == "true" ]]; then - set_val "nightModeEnabled" "false" - else - set_val "nightModeEnabled" "true" - fi - sync_all + toggle_nightlight_state + # Immediately apply the new state after toggling + apply_nightlight ;; "Sync Now") sync_all @@ -47,6 +80,8 @@ let esac } + # --- Main --- + case "$1" in settings) dmenu_settings ;; *) sync_all ;; diff --git a/common/modules/window_managers/hyprland/default.nix b/common/modules/window_managers/hyprland/default.nix index c338f44..c1c13a9 100644 --- a/common/modules/window_managers/hyprland/default.nix +++ b/common/modules/window_managers/hyprland/default.nix @@ -12,23 +12,6 @@ }: let cfg = config.${moduleNameSpace}.windowManagers; - - snip = pkgs.writeShellScript "snip" '' - case $1 in - full) - ${pkgs.grim}/bin/grim - | wl-copy - ;; - selection) - GEOM=$(${pkgs.slurp}/bin/slurp) || exit - ${pkgs.grim}/bin/grim -g "$GEOM" - | wl-copy - ;; - window) - GEOM=$(hyprctl activewindow -j | ${pkgs.jq}/bin/jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"') - ${pkgs.grim}/bin/grim -g "$GEOM" - | wl-copy - ;; - esac - ''; - smart-alacritty = pkgs.writeShellScript "smart-alacritty" '' alacritty msg create-window || exec alacritty ''; @@ -55,28 +38,39 @@ in systemd.variables = [ "--all" ]; xwayland.enable = true; systemd.enableXdgAutostart = false; + extraConfig = '' + layerrule { + name = noctalia + match:namespace = noctalia-background-.*$ + ignore_alpha = 0.5 + blur = true + blur_popups = true + } + ''; settings = { monitor = [ ",1920x1080@120,auto,1.0" ]; - source = [ ] ++ lib.optional (config.beeMods.matugen.enable) "~/.config/hypr/dms/colors.conf"; + source = + [ ] ++ lib.optional (config.beeMods.matugen.enable) "~/.config/hypr/noctalia/noctalia-colors.conf"; "$mainMod" = "SUPER"; - # env = [ - # "NIXOS_OZONE_WL,1" - # "QT_AUTO_SCREEN_SCALE_FACTOR,1" - # "ELECTRON_OZONE_PLATFORM_HINT,auto" - # "QT_QPA_PLATFORM,wayland;xcb" - # "XDG_SESSION_TYPE,wayland" - # "GDK_BACKEND,wayland,x11" - # "GDK_SCALE,1" - # ]; + env = [ + "NIXOS_OZONE_WL,1" + "QT_AUTO_SCREEN_SCALE_FACTOR,1" + "ELECTRON_OZONE_PLATFORM_HINT,auto" + "QT_QPA_PLATFORM,wayland;xcb" + "XDG_SESSION_TYPE,wayland" + "GDK_BACKEND,wayland,x11" + "GDK_SCALE,1" + ]; exec-once = [ - "dbus-update-activation-environment --all" - "sleep 1 && dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" - "gnome-keyring-daemon --start --components=secrets,ssh,pkcs11" + # "dbus-update-activation-environment --all" + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + "gnome-keyring-daemon --start --components=secrets" + "noctalia-shell" ] ++ lib.optionals config.beeMods.windowManagers.dwm.enable [ "systemctl --user stop xidlehook.service" @@ -115,10 +109,7 @@ in resize_on_border = true; no_focus_fallback = true; - allow_tearing = false; - - # "col.active_border" = "$_tertiary_fixed_dim"; - # "col.inactive_border" = "$_outline"; + allow_tearing = true; }; master = { @@ -212,7 +203,7 @@ in }; windowrule = [ - "workspace 1, match:class ^(foot|footclient|alacritty|com.mitchellh.ghostty)$" + "workspace 1, match:class ^(foot|footclient|Alacritty|com.mitchellh.ghostty)$" "workspace 2, match:class ^(zen|firefox|obsidian)$" "workspace 3, match:class ^(vesktop|discord|thunderbird|Element|equibop)$" "workspace 4, match:class ^(steam)$" @@ -224,6 +215,7 @@ in "no_anim on, match:namespace ^rofi$" "no_anim on, match:namespace ^(dms)$" "no_anim on, match:namespace .*dms.*" + "no_anim on, match:namespace .*noctalia.*" ]; workspace = [ "2, layout:scrolling" ]; @@ -231,13 +223,15 @@ in bind = [ "$mainMod, r, exec, hyprctl reload" "$mainMod, Return, exec, ${terminal}" - "$mainMod, a, exec,dms ipc call spotlight toggle" - "$mainMod, v,exec,dms ipc call clipboard toggle" - "ALT, F4, exec, dms ipc call powermenu toggle" - "$mainMod, y, exec, dms ipc call dankdash wallpaper" + "$mainMod, a, exec,noctalia-shell ipc call launcher toggle" + "$mainMod, y, exec,noctalia-shell ipc call wallpaper toggle" + "$mainMod, v, exec,noctalia-shell ipc call launcher clipboard" + "$mainMod, n, exec,noctalia-shell ipc call notifications toggleHistory" - "$mainMod, comma, exec,dms ipc call settings focusOrToggle" + "$mainMod, comma, exec,noctalia-shell ipc call settings toggle" + "$mainMod, Period, exec,noctalia-shell ipc call launcher emoji" + "ALT, F4, exec,noctalia-shell ipc call sessionMenu toggle" "$mainMod, F12, exec, gnome-calculator" "$mainMod, b, exec, zen" "$mainMod, e, exec, nautilus" @@ -250,9 +244,8 @@ in "$mainMod, k, movefocus, u" "$mainMod, j, movefocus, d" - ", Print, exec, ${snip} full" - "$mainMod, Print, exec, ${snip} selection" - "$mainMod SHIFT, Print, exec, ${snip} window" + ", Print, exec, ${pkgs.grimblast}/bin/grimblast copy screen" + "$mainMod, Print, exec, ${pkgs.grimblast}/bin/grimblast copy area" "$mainMod SHIFT, k, swapwindow, u" "$mainMod SHIFT, j, swapwindow, d" diff --git a/common/programs/btop.nix b/common/programs/btop.nix index a030e3d..6d30609 100644 --- a/common/programs/btop.nix +++ b/common/programs/btop.nix @@ -3,7 +3,7 @@ programs.btop = { enable = true; settings = { - color_theme = lib.optionalString config.beeMods.matugen.enable "matugen"; + color_theme = lib.optionalString config.beeMods.matugen.enable "noctalia"; theme_background = false; truecolor = true; vim_keys = true; diff --git a/common/templates/default.nix b/common/templates/default.nix index ce06868..465d5ea 100644 --- a/common/templates/default.nix +++ b/common/templates/default.nix @@ -1,17 +1,22 @@ inputs: { c = { path = ./clang; + description = "Rust template"; }; rust = { path = ./rust; + description = "Rust template"; }; zig = { path = ./zig; + description = "Rust template"; }; go = { path = ./go; + description = "Rust template"; }; python = { path = ./python; + description = "Rust template"; }; } |
