From 9ff6f764c02be3371e48479726df1c1951fc4b6c Mon Sep 17 00:00:00 2001 From: KP64 Date: Mon, 16 Dec 2024 20:02:50 +0100 Subject: [PATCH] add: hyprpanel module --- desktop/hypr/default.nix | 1 + desktop/hypr/hyprland.nix | 27 +++--- desktop/hypr/hyprpanel.nix | 162 ++++++++++++++++++++++++++++++++ hosts/kg/configuration.nix | 3 +- hosts/tp/configuration.nix | 1 + programs/cli/ricing/default.nix | 1 + system/nix.nix | 1 + 7 files changed, 183 insertions(+), 13 deletions(-) create mode 100644 desktop/hypr/hyprpanel.nix diff --git a/desktop/hypr/default.nix b/desktop/hypr/default.nix index a70bfbb..a527646 100644 --- a/desktop/hypr/default.nix +++ b/desktop/hypr/default.nix @@ -3,6 +3,7 @@ ./hypridle.nix ./hyprland.nix ./hyprlock.nix + ./hyprpanel.nix ./hyprpaper.nix ]; } diff --git a/desktop/hypr/hyprland.nix b/desktop/hypr/hyprland.nix index f875494..feb4c13 100644 --- a/desktop/hypr/hyprland.nix +++ b/desktop/hypr/hyprland.nix @@ -85,18 +85,22 @@ in environment.sessionVariables.NIXOS_OZONE_WL = "1"; # System wide install needed for e.g. SDDM - programs.hyprland.enable = true; + programs = { + hyprland.enable = true; + thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-volman + thunar-archive-plugin + thunar-media-tags-plugin + ]; + }; + }; home-manager.users.${username} = { - home.packages = - (with inputs; [ - hyprland-contrib.packages.${pkgs.system}.grimblast - # TODO: Ditch for Custom EWW or Ags Config! - hyprpanel.packages.${pkgs.system}.default - ]) - ++ (with pkgs; [ - kdePackages.dolphin - hyprpicker - ]); + home.packages = [ + pkgs.hyprpicker + inputs.hyprland-contrib.packages.${pkgs.system}.grimblast + ]; wayland.windowManager.hyprland = { enable = true; package = inputs.hyprland.packages.${pkgs.system}.hyprland; @@ -181,7 +185,6 @@ in exec-once = [ "copyq --start-server" "mako" - "hyprpanel" "udiskie" "hyprpaper" "hypridle" diff --git a/desktop/hypr/hyprpanel.nix b/desktop/hypr/hyprpanel.nix new file mode 100644 index 0000000..fd13a21 --- /dev/null +++ b/desktop/hypr/hyprpanel.nix @@ -0,0 +1,162 @@ +{ + config, + lib, + pkgs, + inputs, + username, + ... +}: +let + cfg = config.desktop.hypr.hyprpanel; + + inherit (config.lib.stylix) colors; + + accent = "#${colors.base0D}"; + accent-alt = "#${colors.base03}"; + background = "#${colors.base00}"; + background-alt = "#${colors.base01}"; + foreground = "#${colors.base05}"; + + hyprpanel-reload = pkgs.writers.writeBashBin "hyprpanel-reload" '' + [ $(pgrep "ags") ] && pkill ags + hyprctl dispatch exec hyprpanel + ''; +in +{ + options.desktop.hypr.hyprpanel.enable = lib.mkEnableOption "Hyprpanel"; + + config = lib.mkIf cfg.enable { + nixpkgs.overlays = [ inputs.hyprpanel.overlay ]; + + home-manager.users.${username} = { + wayland.windowManager.hyprland.settings.exec-once = [ "hyprpanel" ]; + home = { + packages = [ + pkgs.hyprpanel + hyprpanel-reload + ]; + + # TODO: Right now weather Key doesn't work with sops-nix. + # Wait for Hyprpanel to provide support i.e. an option that expect a path. + file.".cache/ags/hyprpanel/options.json".text = lib.mkIf config.isStylixEnabled '' + { + "wallpaper.enable": false, + + "bar.media.show_active_only": true, + "bar.customModules.updates.pollingInterval": 1440000, + "bar.windowtitle.label": false, + "bar.launcher.icon": "", + "bar.layouts": { + "*": { + "left": [ + "dashboard", + "workspaces" + ], + "middle": [ "media" ], + "right": [ + "volume", + "bluetooth", + "systray", + "clock", + "notifications" + ] + } + }, + + "bar.workspaces.show_numbered": true, + "bar.workspaces.workspaces": 9, + "bar.workspaces.monitorSpecific": true, + + "menus.clock.weather.location": "", + "menus.clock.weather.key": "", + "menus.clock.weather.unit": "metric", + + "menus.dashboard.shortcuts.left.shortcut1.icon": "", + "menus.dashboard.shortcuts.left.shortcut1.command": "firefox", + "menus.dashboard.shortcuts.left.shortcut1.tooltip": "Firefox", + "menus.dashboard.shortcuts.left.shortcut2.icon": "", + "menus.dashboard.shortcuts.left.shortcut2.command": "spotify", + "menus.dashboard.shortcuts.left.shortcut2.tooltip": "Spotify", + "menus.dashboard.shortcuts.left.shortcut3.icon": "", + "menus.dashboard.shortcuts.left.shortcut3.command": "vesktop", + "menus.dashboard.shortcuts.left.shortcut3.tooltip": "Vesktop", + + "menus.dashboard.shortcuts.right.shortcut1.icon": "", + "menus.dashboard.shortcuts.right.shortcut1.command": "hyprpicker -a", + "menus.dashboard.shortcuts.right.shortcut1.tooltip": "Color Picker", + "menus.dashboard.shortcuts.right.shortcut3.icon": "󰄀", + "menus.dashboard.shortcuts.right.shortcut3.command": "grimblast --freeze --notify copysave area", + "menus.dashboard.shortcuts.right.shortcut3.tooltip": "Screenshot", + + "menus.dashboard.directories.left.directory1.label": "󰉍 Downloads", + "menus.dashboard.directories.left.directory1.command": "bash -c \"thunar $HOME/Downloads/\"", + "menus.dashboard.directories.left.directory2.label": "󰉏 Pictures", + "menus.dashboard.directories.left.directory2.command": "bash -c \"thunar $HOME/Pictures/\"", + "menus.dashboard.directories.left.directory3.label": "󱧶 Documents", + "menus.dashboard.directories.left.directory3.command": "bash -c \"thunar $HOME/Documents/\"", + "menus.dashboard.directories.right.directory1.label": "󱂵 Home", + "menus.dashboard.directories.right.directory1.command": "bash -c \"thunar $HOME/\"", + "menus.dashboard.directories.right.directory2.label": "󰚝 Projects", + "menus.dashboard.directories.right.directory2.command": "bash -c \"thunar $HOME/dev/\"", + "menus.dashboard.directories.right.directory3.label": " Config", + "menus.dashboard.directories.right.directory3.command": "bash -c \"thunar $HOME/.config/\"", + + "theme.bar.transparent": true, + + "theme.bar.buttons.workspaces.hover": "${accent-alt}", + "theme.bar.buttons.workspaces.active": "${accent}", + "theme.bar.buttons.workspaces.available": "${accent-alt}", + "theme.bar.buttons.workspaces.occupied": "${accent}", + + "theme.bar.menus.monochrome": true, + "theme.bar.menus.background": "${background}", + "theme.bar.menus.cards": "${background-alt}", + "theme.bar.menus.label": "${foreground}", + "theme.bar.menus.text": "${foreground}", + "theme.bar.menus.border.color": "${accent}", + "theme.bar.menus.popover.text": "${foreground}", + "theme.bar.menus.popover.background": "${background-alt}", + "theme.bar.menus.listitems.active": "${accent}", + "theme.bar.menus.icons.active": "${accent}", + "theme.bar.menus.switch.enabled":"${accent}", + "theme.bar.menus.check_radio_button.active": "${accent}", + "theme.bar.menus.buttons.default": "${accent}", + "theme.bar.menus.buttons.active": "${accent}", + "theme.bar.menus.iconbuttons.active": "${accent}", + "theme.bar.menus.progressbar.foreground": "${accent}", + "theme.bar.menus.slider.primary": "${accent}", + "theme.bar.menus.tooltip.background": "${background-alt}", + "theme.bar.menus.tooltip.text": "${foreground}", + "theme.bar.menus.dropdownmenu.background":"${background-alt}", + "theme.bar.menus.dropdownmenu.text": "${foreground}", + "theme.bar.buttons.style": "default", + "theme.bar.buttons.monochrome": true, + "theme.bar.buttons.text": "${foreground}", + "theme.bar.buttons.icon": "${accent}", + "theme.bar.buttons.notifications.background": "${background-alt}", + "theme.bar.buttons.hover": "${background}", + "theme.bar.buttons.notifications.hover": "${background}", + "theme.bar.buttons.notifications.total": "${accent}", + "theme.bar.buttons.notifications.icon": "${accent}", + "theme.notification.background": "${background-alt}", + "theme.notification.actions.background": "${accent}", + "theme.notification.actions.text": "${foreground}", + "theme.notification.label": "${accent}", + "theme.notification.border": "${background-alt}", + "theme.notification.text": "${foreground}", + "theme.notification.labelicon": "${accent}", + "theme.osd.bar_color": "${accent}", + "theme.osd.bar_overflow_color": "${accent-alt}", + "theme.osd.icon": "${background}", + "theme.osd.icon_container": "${accent}", + "theme.osd.label": "${accent}", + "theme.osd.bar_container": "${background-alt}", + "theme.bar.menus.menu.media.background.color": "${background-alt}", + "theme.bar.menus.menu.media.card.color": "${background-alt}", + "theme.bar.menus.menu.media.card.tint": 90 + } + ''; + }; + }; + }; +} diff --git a/hosts/kg/configuration.nix b/hosts/kg/configuration.nix index 860e2b8..27f3249 100644 --- a/hosts/kg/configuration.nix +++ b/hosts/kg/configuration.nix @@ -28,7 +28,7 @@ tpm.enable = true; sudo-rs.enable = true; }; - style.catppuccin.enable = true; + style.stylix.enable = true; }; cli = { @@ -85,6 +85,7 @@ hypr = { hypridle.enable = true; hyprlock.enable = true; + hyprpanel.enable = true; hyprpaper.enable = true; hyprland = { enable = true; diff --git a/hosts/tp/configuration.nix b/hosts/tp/configuration.nix index e901bf8..15984c1 100644 --- a/hosts/tp/configuration.nix +++ b/hosts/tp/configuration.nix @@ -108,6 +108,7 @@ hypr = { hypridle.enable = true; hyprlock.enable = true; + hyprpanel.enable = true; hyprpaper.enable = true; hyprland = { enable = true; diff --git a/programs/cli/ricing/default.nix b/programs/cli/ricing/default.nix index 6ba0273..0a3979e 100644 --- a/programs/cli/ricing/default.nix +++ b/programs/cli/ricing/default.nix @@ -18,6 +18,7 @@ cbonsai pipes-rs cmatrix + nms ]; }; } diff --git a/system/nix.nix b/system/nix.nix index 66db9df..1e5edb7 100644 --- a/system/nix.nix +++ b/system/nix.nix @@ -60,6 +60,7 @@ in nurl nvd statix + vulnix ]); }