From 0b766610a385dba634a0ef864ce7110f29c789a9 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 29 Dec 2024 17:27:37 -0800 Subject: [PATCH] feat: rice out system --- .../desktop-environment/hyprland/default.nix | 50 ++++++----- .../desktop-environment/waybar/default.nix | 85 ++++++++++++++++++- hm/modules/linux/programs/default.nix | 2 +- modules/linux/misc/default.nix | 7 ++ reference/hosts/demeter/configuration.nix | 14 ++- 5 files changed, 133 insertions(+), 25 deletions(-) diff --git a/hm/modules/linux/desktop-environment/hyprland/default.nix b/hm/modules/linux/desktop-environment/hyprland/default.nix index 6f5fbda..d9c5eca 100644 --- a/hm/modules/linux/desktop-environment/hyprland/default.nix +++ b/hm/modules/linux/desktop-environment/hyprland/default.nix @@ -229,29 +229,37 @@ in "winOut, 0.3, -0.3, 0, 1" "liner, 1, 1, 1, 1" ]; - animation = [ - "windows, 1, 6, wind, slide" - "windowsIn, 1, 6, winIn, slide" - "windowsOut, 1, 5, winOut, slide" - "windowsMove, 1, 5, wind, slide" - # "border, 1, 1, liner" - # "borderangle, 1, 30, liner, loop" - "fade, 1, 10, default" - "workspaces, 1, 5, wind" - # "layers, 1, 8, default, slide" - ]; + animation = + [ + "windows, 1, 6, wind, slide" + "windowsIn, 1, 6, winIn, slide" + "windowsOut, 1, 5, winOut, slide" + "windowsMove, 1, 5, wind, slide" + "fade, 1, 10, default" + "workspaces, 1, 5, wind" + # "layers, 1, 8, default, slide" + ] + ++ (lib.optionals (!osConfig.liminalOS.powersave) [ + "border, 1, 1, liner" + "borderangle, 1, 30, liner, loop" + ]); }; - general = { - gaps_in = "3"; - gaps_out = "8"; - border_size = "2"; - # the dot is a hyprland name, not nix syntax, so we escape it - "col.active_border" = pkgs.lib.mkForce "rgba(ca9ee6ff) rgba(f2d5cfff) 45deg"; - "col.inactive_border" = pkgs.lib.mkForce "rgba(b4befecc) rgba(6c7086cc) 45deg"; - layout = "dwindle"; - resize_on_border = "true"; - }; + general = + let + inherit (config.lib.stylix) colors; + in + { + gaps_in = "3"; + gaps_out = "8"; + border_size = "2"; + # "col.active_border" = pkgs.lib.mkForce "rgba(ca9ee6ff) rgba(f2d5cfff) 45deg"; + # "col.inactive_border" = pkgs.lib.mkForce "rgba(b4befecc) rgba(6c7086cc) 45deg"; + "col.active_border" = "rgba(${colors.base0A}ff) rgba(${colors.base09}ff) 45deg"; + "col.inactive_border" = "rgba(${colors.base01}cc) rgba(${colors.base02}cc) 45deg"; + layout = "dwindle"; + resize_on_border = "true"; + }; misc = { disable_hyprland_logo = true; diff --git a/hm/modules/linux/desktop-environment/waybar/default.nix b/hm/modules/linux/desktop-environment/waybar/default.nix index 66aee10..cbb6b3c 100644 --- a/hm/modules/linux/desktop-environment/waybar/default.nix +++ b/hm/modules/linux/desktop-environment/waybar/default.nix @@ -22,7 +22,90 @@ in config = { programs.waybar = lib.mkIf cfg.enable { enable = true; - style = ./style.css; + style = + let + inherit (config.lib.stylix) colors; + in + '' + window#waybar { + font-family: ${config.stylix.fonts.monospace.name}; + background-color: rgba(0,0,0,0); + font-size: 0.8rem; + border-radius: 0.5rem; + color: #${colors.base05}; + } + + .modules-left { + opacity: 1; + background: linear-gradient(45deg, #${colors.base0B}, #${colors.base0A}); + border-radius: 0.5rem; + padding: 2px; + } + + .modules-center { + opacity: 0; + } + + .modules-right { + opacity: 1; + background-color: #${colors.base00}; + border-radius: 0.5rem; + padding: 2px 2px 2px 10px + } + + /* label.module { + margin-left: -1px; + } */ + + #workspaces { + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 0 2px; + } + + #workspaces button { + font-size: 0.6rem; + padding: 0 0.3rem 0 0; + border: #cccccc; + color: #cccccc; + } + + #window { + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 2px 5px; + } + + #clock { + font-weight: bolder; + border-radius: 0.5rem; + padding: 0 3px 0 0; + } + + #battery { + color: #${colors.base08}; + } + + #memory { + color: #${colors.base09}; + } + + #disk { + color: #${colors.base0A}; + } + + #cpu { + color: #${colors.base0B}; + } + + #temperature { + color: #${colors.base0C}; + } + + #network { + color: #${colors.base0D}; + } + ''; systemd.enable = true; settings = { mainBar = { diff --git a/hm/modules/linux/programs/default.nix b/hm/modules/linux/programs/default.nix index 280c715..7a15309 100644 --- a/hm/modules/linux/programs/default.nix +++ b/hm/modules/linux/programs/default.nix @@ -53,7 +53,7 @@ in listen_on = "unix:/tmp/kitty"; scrollback_pager = ''nvim --noplugin -c "set signcolumn=no showtabline=0" -c "silent write! /tmp/kitty_scrollback_buffer | te cat /tmp/kitty_scrollback_buffer - "''; cursor = pkgs.lib.mkForce "#c0caf5"; - cursor_text_color = pkgs.lib.mkForce "#1a1b26"; + cursor_text_color = lib.mkForce "#1a1b26"; cursor_trail = 3; }; keybindings = { diff --git a/modules/linux/misc/default.nix b/modules/linux/misc/default.nix index b23d6ce..d567e4f 100644 --- a/modules/linux/misc/default.nix +++ b/modules/linux/misc/default.nix @@ -67,6 +67,13 @@ in Form factor of the machine. Adjusts some UI settings. ''; }; + powersave = lib.mkOption { + type = lib.types.bool; + default = cfg.formFactor == "laptop"; + description = '' + Whether to set some options to reduce power consumption (mostly Hyprland). + ''; + }; }; config = lib.mkIf cfg.enable { diff --git a/reference/hosts/demeter/configuration.nix b/reference/hosts/demeter/configuration.nix index 2e6d58c..1c23527 100755 --- a/reference/hosts/demeter/configuration.nix +++ b/reference/hosts/demeter/configuration.nix @@ -19,10 +19,20 @@ defaultEditor = inputs.viminal.packages.${pkgs.system}.default; formFactor = "desktop"; theming = { - wallpaper = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; + # wallpaper = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; + wallpaper = "${ + pkgs.fetchFromGitHub { + owner = "dharmx"; + repo = "walls"; + rev = "6bf4d733ebf2b484a37c17d742eb47e5139e6a14"; + hash = "sha256-YdPkJ+Bm0wq/9LpuST6s3Aj13ef670cQOxAEIhJg26E="; + sparseCheckout = [ "radium" ]; + } + }/radium/a_mountain_range_at_night.png"; # if you don't manually set polarity when using manual colorscheme, GTK # apps won't respect colorscheme - base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; + # base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/oxocarbon-dark.yaml"; polarity = "dark"; }; system = {