From 86259e05dbe688877a7c57bdfeedef0bb9e6dedf Mon Sep 17 00:00:00 2001 From: punkfairie Date: Mon, 6 Jan 2025 20:29:08 -0800 Subject: [PATCH] feat(home): Disable nixGL --- homes/x86_64-linux/marley@nyx/default.nix | 1 - modules/home/services/picom/default.nix | 2 +- modules/home/services/polybar/default.nix | 622 +++++++++++----------- modules/home/xorg/i3/default.nix | 248 ++++----- 4 files changed, 444 insertions(+), 429 deletions(-) diff --git a/homes/x86_64-linux/marley@nyx/default.nix b/homes/x86_64-linux/marley@nyx/default.nix index fbc0a1d..f571272 100644 --- a/homes/x86_64-linux/marley@nyx/default.nix +++ b/homes/x86_64-linux/marley@nyx/default.nix @@ -3,7 +3,6 @@ in { marleyos = { isDesktop = true; - nixGL = enabled; appearance = { base = enabled; diff --git a/modules/home/services/picom/default.nix b/modules/home/services/picom/default.nix index 821b9da..2e055ea 100644 --- a/modules/home/services/picom/default.nix +++ b/modules/home/services/picom/default.nix @@ -14,7 +14,7 @@ in { config = mkIf (cfg.enable && hasXorg) { services.picom = { enable = true; - package = config.lib.nixGL.wrap pkgs.picom; + package = mkIf config.marleyos.nixGL.enable (config.lib.nixGL.wrap pkgs.picom); }; # The module config options are a nightmare. diff --git a/modules/home/services/polybar/default.nix b/modules/home/services/polybar/default.nix index 19f97bf..a4941e1 100644 --- a/modules/home/services/polybar/default.nix +++ b/modules/home/services/polybar/default.nix @@ -3,8 +3,7 @@ config, pkgs, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf getExe; cfg = config.marleyos.services.polybar; @@ -12,16 +11,16 @@ let xrandr = getExe pkgs.xorg.xrandr; grep = getExe pkgs.gnugrep; cut = "${pkgs.coreutils}/bin/cut"; -in -{ +in { options.marleyos.services.polybar.enable = mkEnableOption "polybar"; config = mkIf (cfg.enable && hasXorg) { services.polybar = { enable = true; - package = config.lib.nixGL.wrap pkgs.polybar; + package = mkIf config.marleyos.nixGL.enable (config.lib.nixGL.wrap pkgs.polybar); - script = # bash + script = + # bash '' for m in $(${xrandr} --query | ${grep} " connected" | ${cut} -d" " -f1); do bar="main" @@ -36,385 +35,398 @@ in # colorblock theme from # https://github.com/adi1090x/polybar-themes - settings = - let - color = rec { - background = "#26232f"; - foreground = background; - foreground-alt = "#c8c8cb"; - alpha = "#00000000"; - shade1 = "#d6adb5"; - shade2 = "#d7bdc3"; - dark = "#0a0a0a"; - }; + settings = let + color = rec { + background = "#26232f"; + foreground = background; + foreground-alt = "#c8c8cb"; + alpha = "#00000000"; + shade1 = "#d6adb5"; + shade2 = "#d7bdc3"; + dark = "#0a0a0a"; + }; - fmt = { - prefix.font = 2; - padding = 2; - }; - pref = { - font = 2; + fmt = { + prefix.font = 2; + padding = 2; + }; + pref = { + font = 2; + padding = 2; + }; + + hasRofi = config.marleyos.programs.rofi.enable; + cfgHome = config.xdg.configHome; + in { + # Global Settings - - - - - - - - - - - - - - - - - - - - - - - - - - + "settings" = { + screenchange.reload = true; + compositing = { + background = "source"; + foreground = "over"; + overline = "over"; + underline = "over"; + border = "over"; + }; + pseudo.transparency = false; + }; + "global/wm" = { + margin.bottom = 0; + }; + + # Bars - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + "bar/main" = { + monitor.text = "\${env:MONITOR:}"; + monitor.strict = false; + override.redirect = true; + bottom = false; + fixed.center = true; + width = "99%"; + height = 40; + offset.x = "0.5%"; + offset.y = "1%"; + background = color.alpha; + inherit (color) foreground; + radius.top = 0.0; + radius.bottom = 0.0; + underline.size = 2; + underline.color = color.foreground; + border.size = 0; + border.color = color.background; + padding = 0; + module.margin.left = 0; + module.margin.right = 0; + font = let + mkFt = s: "Maple Mono NF:pixelsize=${toString s};4"; + in [ + (mkFt 10) + (mkFt 15) + ]; + modules.left = "launcher sep workspaces sep title sep mpd"; + modules.right = "filesystem sep cpu memory pulseaudio network date sep sysmenu"; + dim.value = 1.0; + wm.restack = "i3"; + enable.ipc = true; + scroll.up = "i3-msg workspace next_on_output"; + scroll.down = "i3-msg workspace prev_on_output"; + }; + + "bar/tray" = { + "inherit" = "bar/main"; + modules.right = "tray sep filesystem sep cpu memory pulseaudio network date sep sysmenu"; + }; + + # Modules - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + "module/sep" = { + type = "custom/text"; + format = " "; + content.background = color.alpha; + content-foreground = color.alpha; + }; + + "module/launcher" = { + type = "custom/text"; + content = { + text = ""; + inherit (color) background; + foreground = color.shade2; padding = 2; }; + click.left = mkIf hasRofi "${cfgHome}/rofi/launchers/type-1/launcher.sh &"; + click.right = mkIf hasRofi "${cfgHome}/rofi/applets/bin/screenshot.sh &"; + }; - hasRofi = config.marleyos.programs.rofi.enable; - cfgHome = config.xdg.configHome; - in - { - # Global Settings - - - - - - - - - - - - - - - - - - - - - - - - - - - "settings" = { - screenchange.reload = true; - compositing = { - background = "source"; - foreground = "over"; - overline = "over"; - underline = "over"; - border = "over"; - }; - pseudo.transparency = false; - }; - "global/wm" = { - margin.bottom = 0; - }; - - # Bars - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "bar/main" = { - monitor.text = "\${env:MONITOR:}"; - monitor.strict = false; - override.redirect = true; - bottom = false; - fixed.center = true; - width = "99%"; - height = 40; - offset.x = "0.5%"; - offset.y = "1%"; - background = color.alpha; + "module/workspaces" = { + type = "internal/xworkspaces"; + pin.workspaces = true; + enable.click = true; + enable.scroll = true; + icon.text = [ + "1;1" + "2;2" + "3;3" + "4;4" + "5;5" + "6;6" + "7;7" + "8;8" + "9;9" + "10;10" + ]; + icon.default = 0; + format = { + text = ""; + inherit (color) background; inherit (color) foreground; - radius.top = 0.0; - radius.bottom = 0.0; - underline.size = 2; - underline.color = color.foreground; - border.size = 0; - border.color = color.background; - padding = 0; - module.margin.left = 0; - module.margin.right = 0; - font = - let - mkFt = s: "Maple Mono NF:pixelsize=${toString s};4"; - in - [ - (mkFt 10) - (mkFt 15) - ]; - modules.left = "launcher sep workspaces sep title sep mpd"; - modules.right = "filesystem sep cpu memory pulseaudio network date sep sysmenu"; - dim.value = 1.0; - wm.restack = "i3"; - enable.ipc = true; - scroll.up = "i3-msg workspace next_on_output"; - scroll.down = "i3-msg workspace prev_on_output"; }; - - "bar/tray" = { - "inherit" = "bar/main"; - modules.right = "tray sep filesystem sep cpu memory pulseaudio network date sep sysmenu"; - }; - - # Modules - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "module/sep" = { - type = "custom/text"; - format = " "; - content.background = color.alpha; - content-foreground = color.alpha; - }; - - "module/launcher" = { - type = "custom/text"; - content = { - text = ""; + label = { + monitor = "%name%"; + active = { + text = "%icon%"; + background = color.shade2; + foreground = color.dark; + padding = 2; + }; + occupied = { + text = "%icon%"; inherit (color) background; foreground = color.shade2; padding = 2; }; - click.left = mkIf hasRofi "${cfgHome}/rofi/launchers/type-1/launcher.sh &"; - click.right = mkIf hasRofi "${cfgHome}/rofi/applets/bin/screenshot.sh &"; - }; - - "module/workspaces" = { - type = "internal/xworkspaces"; - pin.workspaces = true; - enable.click = true; - enable.scroll = true; - icon.text = [ - "1;1" - "2;2" - "3;3" - "4;4" - "5;5" - "6;6" - "7;7" - "8;8" - "9;9" - "10;10" - ]; - icon.default = 0; - format = { - text = ""; + urgent = { + text = "%icon%"; inherit (color) background; - inherit (color) foreground; + foreground = "#cc6666"; + padding = 2; }; - label = { - monitor = "%name%"; - active = { - text = "%icon%"; - background = color.shade2; - foreground = color.dark; - padding = 2; - }; - occupied = { - text = "%icon%"; - inherit (color) background; - foreground = color.shade2; - padding = 2; - }; - urgent = { - text = "%icon%"; - inherit (color) background; - foreground = "#cc6666"; - padding = 2; - }; - empty = { - text = "%icon%"; - inherit (color) background; - foreground = color.foreground-alt; - padding = 2; - }; + empty = { + text = "%icon%"; + inherit (color) background; + foreground = color.foreground-alt; + padding = 2; }; }; + }; - "module/title" = { - type = "internal/xwindow"; - format.text = "