From 3208537433e38c7e082bf2f58e3f69718492e97e Mon Sep 17 00:00:00 2001 From: albert Date: Sun, 18 Aug 2024 14:06:00 +0900 Subject: [PATCH] Update Hyprland --- flake.nix | 4 +- .../desktops/hyprland/components/hyprland.nix | 16 ++-- .../desktops/hyprland/components/rofi.nix | 9 +-- .../desktops/hyprland/components/waybar.nix | 76 ++++++++++--------- .../common/desktops/hyprland/default.nix | 11 ++- home-manager/common/image-specific.nix | 2 +- home-manager/common/software/cli/btop.nix | 4 + .../desktops/hyprland/default.nix | 12 +-- nixos/common/desktops/hyprland/default.nix | 34 +++++---- stylix/common/default.nix | 9 ++- stylix/themes/gruvbox/default.nix | 5 +- stylix/themes/gruvbox/theme.yaml | 17 +++++ wallpapers | 2 +- 13 files changed, 123 insertions(+), 78 deletions(-) create mode 100644 stylix/themes/gruvbox/theme.yaml diff --git a/flake.nix b/flake.nix index d6525ddd..38569164 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,7 @@ # User Machines nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; unfree = true; desktop = "plasma6"; }; - nixos-framework = libx.mkHost { hostname = "nixos-framework"; unfree = true; desktop = "plasma6"; }; + nixos-framework = libx.mkHost { hostname = "nixos-framework"; unfree = true; desktop = "hyprland"; theme = "gruvbox"; }; steamdeck = libx.mkDeck { hostname = "steamdeck"; desktop = "plasma6"; }; # Raspberry Pi's @@ -85,7 +85,7 @@ # User Machines "albert@nixos-desktop" = libx.mkHome { hostname = "nixos-desktop"; desktop = "plasma6"; }; - "albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "plasma6"; }; + "albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "hyprland"; theme = "gruvbox"; }; "albert@steamdeck" = libx.mkHome { hostname = "steamdeck"; desktop = "plasma6"; }; # Raspberry Pi's diff --git a/home-manager/common/desktops/hyprland/components/hyprland.nix b/home-manager/common/desktops/hyprland/components/hyprland.nix index 89450818..ec337ddf 100644 --- a/home-manager/common/desktops/hyprland/components/hyprland.nix +++ b/home-manager/common/desktops/hyprland/components/hyprland.nix @@ -27,9 +27,9 @@ ]; xwayland.force_zero_scaling = false; general = { - gaps_in = "5"; - gaps_out = "10"; - border_size = "1"; + gaps_in = "8"; + gaps_out = "8"; + border_size = "2"; resize_on_border = "true"; extend_border_grab_area = "15"; layout = "dwindle"; @@ -50,7 +50,6 @@ gestures = { workspace_swipe = true; workspace_swipe_fingers = 3; - workspace_swipe_numbered = false; }; misc = { disable_hyprland_logo = true; @@ -58,7 +57,7 @@ key_press_enables_dpms = true; }; decoration = { - rounding = 3; + rounding = 15; active_opacity = 0.75; inactive_opacity = 0.6; fullscreen_opacity = 1.0; @@ -89,7 +88,6 @@ preserve_split = true;# you probably want this no_gaps_when_only = 1; # If it's the only window int he layout, 1=don't show gaps }; - master.new_is_master = true; windowrule = [ "noblur,^(firefox)$" # disables blur for firefox "opacity 1.0 override,^(firefox)$" # Sets opacity to 1 @@ -101,8 +99,12 @@ "opacity 0.9 override,^(codium)$" # Sets opacity to 1 "stayfocused, title:^()$,class:^(steam)$" "minsize 1 1, title:^()$,class:^(steam)$" - ]; + + windowrulev2 = [ + ''float, class:(rofi), title:(rofi)'' + ]; + bind = [ ''SUPER, Q, exec, kitty'' ''SUPER, C, killactive,'' diff --git a/home-manager/common/desktops/hyprland/components/rofi.nix b/home-manager/common/desktops/hyprland/components/rofi.nix index e9c1d664..9086ab3c 100644 --- a/home-manager/common/desktops/hyprland/components/rofi.nix +++ b/home-manager/common/desktops/hyprland/components/rofi.nix @@ -1,6 +1,5 @@ -{ lib, ...}: { - programs.rofi = { - enable = true; - font = lib.mkForce "DejaVu Sans 16"; - }; +{ ...}: { + programs.rofi = { + enable = true; + }; } diff --git a/home-manager/common/desktops/hyprland/components/waybar.nix b/home-manager/common/desktops/hyprland/components/waybar.nix index 9190bc0a..55cd4eb0 100644 --- a/home-manager/common/desktops/hyprland/components/waybar.nix +++ b/home-manager/common/desktops/hyprland/components/waybar.nix @@ -39,7 +39,7 @@ "tooltip-format" = "Games running: {count}"; }; "custom/wlogout" = { - format = ""; + format = " "; on-click = "wlogout"; }; "custom/tailscale" = { @@ -49,15 +49,15 @@ return-type = "json"; interval = 5; format-icons = { - Running = "󰌆"; - Stopped = "󰌊 "; + Running = " 󰌆 "; + Stopped = " 󰌊"; }; }; idle_inhibitor = { format = "{icon}"; format-icons = { - activated = ""; - deactivated = ""; + activated = "  "; + deactivated = "  "; }; }; mpris = { @@ -71,9 +71,16 @@ on-click = "activate"; }; clock = { - format = "󰥔 {:%H:%M}"; - format-alt = "󰃭 {:%A, %d %b, %Y}"; - tooltip-format = "{calendar}"; + format = "󰥔 {:%H:%M (%Z)}"; + format-alt = "󰃭 {:%A, %d %b, %Y (%Z)}"; + tooltip-format = "{tz_list}"; + timezones = [ + "Asia/Tokyo" + "Europe/Warsaw" + "America/Los_Angeles" + "America/Chicago" + "America/New_York" + ]; calendar = { mode = "month"; mode-mon-col = 3; @@ -101,7 +108,7 @@ format-bluetooth-muted = " "; format-muted = "󰝟 {format_source}"; format-source = " "; - format-source-muted = " "; + format-source-muted = "  "; format-icons = { headphone = " "; headset = " "; @@ -112,11 +119,11 @@ }; network = { format = "{ifname}"; - format-wifi = ""; + format-wifi = " "; format-ethernet = " "; format-disconnected = ""; # Hides the module - tooltip-format = "{ifname} via {gwaddr} "; - tooltip-format-wifi = "{essid} ({signalStrength}%) "; + tooltip-format = "{ifname} via {gwaddr}  "; + tooltip-format-wifi = "{essid} ({signalStrength}%)  "; tooltip-format-ethernet = "{ifname} \n{ipaddr}"; tooltip-format-disconnected = "Disconnected"; max-length = 50; @@ -129,10 +136,10 @@ warning = 35; critical = 20; }; - format = "{icon} {capacity}%"; + format = "{icon} {capacity}%"; format-charging = "󰂄 {capacity}%"; - format-plugged = " {capacity}%"; - format-icons = [ "" "" "" "" "" ]; + format-plugged = " {capacity}%"; + format-icons = [ " " " " " " " " " " ]; }; }; }; @@ -149,7 +156,7 @@ #workspaces button.visible, #workspaces button { - font-size: 15px; + font-size: 12px; border-radius: 50px; padding: 0px 5px; margin: 5px; @@ -164,7 +171,7 @@ #workspaces button:hover, #workspaces button.focused:hover, #workspaces button.visible:hover { - background-color: #${config.lib.stylix.colors.base07}; + background-color: #${config.lib.stylix.colors.base05}; color: #${config.lib.stylix.colors.base00}; } @@ -194,32 +201,33 @@ #custom-wlogout, #window { font-size: 16px; - /*padding: 0px 10px;*/ + padding: 0px 5px; margin: 5px; border-radius: 3px; font-weight: normal; + background-color: #${config.lib.stylix.colors.base02}; } /* * General background */ #privacy #button:hover, - #network button:hover, - #mpris button:hover, - #memory button:hover, - #backlight button:hover, - #cpu button:hover, - #pulseaudio button:hover, - #temperature button:hover, - #battery button:hover, - #tray button:hover, - #submap button:hover, - #clock button:hover, - #idle_inhibitor button:hover, - #custom-tailscale button:hover, - #custom-wlogout button:hover, - #window button:hover{ - background-color: #${config.lib.stylix.colors.base00}; + #network #button:hover, + #mpris #button:hover, + #memory #button:hover, + #backlight #button:hover, + #cpu #button:hover, + #pulseaudio #button:hover, + #temperature #button:hover, + #battery #button:hover, + #tray #button:hover, + #submap #button:hover, + #clock #button:hover, + #idle_inhibitor #button:hover, + #custom-tailscale #button:hover, + #custom-wlogout #button:hover, + #window #button:hover{ + background-color: #${config.lib.stylix.colors.base01}; } /* diff --git a/home-manager/common/desktops/hyprland/default.nix b/home-manager/common/desktops/hyprland/default.nix index 367fc430..160727c3 100644 --- a/home-manager/common/desktops/hyprland/default.nix +++ b/home-manager/common/desktops/hyprland/default.nix @@ -1,9 +1,10 @@ -{ pkgs, theme, lib, ... }: { +{ pkgs, ... }: { imports = [ ./components ./assets/waybar/scripts.nix ]; + # TODO Update this when I move services.gammastep = { enable = true; latitude = "35.62370"; @@ -17,15 +18,16 @@ programs.fish.shellInit = ''set DISABLE_TMUX "true" ''; stylix = { - image = lib.mkForce /etc/nixos/git/wallpapers/${theme}/wallpaper1.png; + enable = true; + autoEnable = true; opacity = { desktop = 0.7; popups = 0.7; applications = 1.0; terminal = 1.0; }; - autoEnable = true; targets = { + mako.enable = true; kitty = { enable = true; variant256Colors = true; @@ -37,6 +39,9 @@ enableRightBackColors = false; }; }; + cursor = { + size = 24; + }; fonts = { sizes = { desktop = 12; diff --git a/home-manager/common/image-specific.nix b/home-manager/common/image-specific.nix index 3bc60474..9d06b066 100644 --- a/home-manager/common/image-specific.nix +++ b/home-manager/common/image-specific.nix @@ -1,4 +1,4 @@ { lib, ... }: { # Requires secrets not available in images - programs.atuin.enable = mkDefault false; + programs.atuin.enable = lib.mkDefault false; } diff --git a/home-manager/common/software/cli/btop.nix b/home-manager/common/software/cli/btop.nix index 843e51e4..d990437d 100644 --- a/home-manager/common/software/cli/btop.nix +++ b/home-manager/common/software/cli/btop.nix @@ -1,5 +1,9 @@ { ... }: { programs.btop = { enable = true; + settings = { + color_theme = "TTY"; + theme_background = false; + }; }; } diff --git a/home-manager/hosts/nixos-framework/desktops/hyprland/default.nix b/home-manager/hosts/nixos-framework/desktops/hyprland/default.nix index 464a771f..2b78186b 100644 --- a/home-manager/hosts/nixos-framework/desktops/hyprland/default.nix +++ b/home-manager/hosts/nixos-framework/desktops/hyprland/default.nix @@ -1,18 +1,20 @@ { theme, ... }: { wayland.windowManager.hyprland = { settings = { - monitor = ",highrr,auto,1.25"; + monitor = ",highrr,auto,1.175"; bind = [ '', XF86AudioMute, exec, swayosd --output-volume=mute-toggle'' '', XF86AudioPrev, exec, playerctl previous'' + '', XF86AudioNext, exec, playerctl next'' ]; binde = [ '', XF86AudioPlay, exec, playerctl play-pause'' '', XF86AudioNext, exec, playerctl next'' - '', XF86MonBrightnessDown, exec, light -U 5'' - '', XF86MonBrightnessUp, exec, light -A 5'' - '', XF86AudioLowerVolume, exec, swayosd --output-volume=lower'' - '', XF86AudioRaiseVolume, exec, swayosd --output-volume=raise'' + '', XF86MonBrightnessDown, exec, swayosd-client --brightness=lower'' + '', XF86MonBrightnessUp, exec, swayosd-client --brightness=raise'' + '', XF86AudioMute, exec, swayosd-client --output-volume=mute-toggle'' + '', XF86AudioLowerVolume, exec, swayosd-client --output-volume=lower'' + '', XF86AudioRaiseVolume, exec, swayosd-client --output-volume=raise'' ]; bindl = [ '',switch:on:1241ec0,exec,hyprctl keyword monitor "eDP-1, 2560x1600, 0x0, 1"'' diff --git a/nixos/common/desktops/hyprland/default.nix b/nixos/common/desktops/hyprland/default.nix index 040a3bb3..55ce1b24 100644 --- a/nixos/common/desktops/hyprland/default.nix +++ b/nixos/common/desktops/hyprland/default.nix @@ -1,4 +1,4 @@ -{inputs, pkgs, system, theme, ...}: { +{inputs, pkgs, theme, ...}: { imports = [ inputs.stylix.nixosModules.stylix @@ -6,7 +6,8 @@ ]; stylix = { - image = /etc/nixos/git/wallpapers/${theme}/wallpaper1.png; + enable = true; + autoEnable = true; opacity = { desktop = 0.7; popups = 0.7; @@ -16,23 +17,28 @@ targets = { plymouth.enable = false; }; - autoEnable = true; + cursor = { + size = 24; + }; fonts = { + sizes = { + desktop = 12; + popups = 12; + terminal = 12; + applications = 12; + }; serif = { - package = pkgs.dejavu_fonts; - name = "DejaVu Serif"; + package = pkgs.hack-font; + name = "Hack Nerd Font Regular"; }; - sansSerif = { - package = pkgs.dejavu_fonts; - name = "DejaVu Sans"; + package = pkgs.hack-font; + name = "Hack Nerd Font Regular"; }; - monospace = { - package = pkgs.dejavu_fonts; - name = "DejaVu Sans Mono"; + package = pkgs.hack-font; + name = "Hack Nerd Font Mono Regular"; }; - emoji = { package = pkgs.noto-fonts-emoji; name = "Noto Color Emoji"; @@ -53,7 +59,7 @@ # Brightness and volume control # https://haikarainen.github.io/light/ - programs.light.enable = true; + # programs.light.enable = true; # PolKit for the fingerprint reader security.polkit.enable = true; # https://github.com/NixOS/nixpkgs/issues/143365 @@ -143,6 +149,6 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - jack.enable = true; + jack.enable = false; }; } diff --git a/stylix/common/default.nix b/stylix/common/default.nix index f63fe258..10eb4359 100644 --- a/stylix/common/default.nix +++ b/stylix/common/default.nix @@ -1,5 +1,8 @@ { lib, ... }: { - stylix.targets.tmux.enable = lib.mkForce false; # Custom theme in main config - stylix.targets.zellij.enable = lib.mkForce false; # Custom theme in main config - stylix.targets.fish.enable = lib.mkForce false; # Slow load times with tmux + stylix.targets = { + tmux.enable = lib.mkForce false; # Config in main hm configs + zellij.enable = lib.mkForce false; # Config in main hm configs + fish.enable = lib.mkForce false; # Slow load times + btop.enable = lib.mkForce false; # This usually looks better + }; } diff --git a/stylix/themes/gruvbox/default.nix b/stylix/themes/gruvbox/default.nix index 09fc15d1..92c247bd 100644 --- a/stylix/themes/gruvbox/default.nix +++ b/stylix/themes/gruvbox/default.nix @@ -1,9 +1,8 @@ -{lib, inputs, pkgs, gpu, system, theme, ...}: { +{ ...}: { # Themes https://github.com/tinted-theming/base16-schemes stylix = { image = /etc/nixos/git/wallpapers/gruvbox/wallpaper1.png; - polarity = "dark"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; + base16Scheme = ./theme.yaml; autoEnable = true; }; } diff --git a/stylix/themes/gruvbox/theme.yaml b/stylix/themes/gruvbox/theme.yaml new file mode 100644 index 00000000..6e271e20 --- /dev/null +++ b/stylix/themes/gruvbox/theme.yaml @@ -0,0 +1,17 @@ +scheme: "Gruvbox dark, hard" +base00: "1d2021" # ---- +base01: "3c3836" # --- +base02: "504945" # -- +base03: "665c54" # - +base04: "bdae93" # + +base05: "d5c4a1" # ++ +base06: "ebdbb2" # +++ +base07: "fbf1c7" # ++++ +base08: "fb4934" # red +base09: "fe8019" # orange +base0A: "fabd2f" # yellow +base0B: "b8bb26" # green +base0C: "8ec07c" # aqua/cyan +base0D: "83a598" # blue +base0E: "d3869b" # purple +base0F: "d65d0e" # brown diff --git a/wallpapers b/wallpapers index 8ed82c9a..26552d8b 160000 --- a/wallpapers +++ b/wallpapers @@ -1 +1 @@ -Subproject commit 8ed82c9afaac6359cf4603196f7a5bd4b399a4b5 +Subproject commit 26552d8bade6fa39188ebf68e9ffa1a8dcd75108