From 06e8b5e4f9f0d6d030eb032cfe91c1fbeccc219d Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 28 Aug 2025 22:17:30 +0300 Subject: [PATCH] Added hyprbars --- .config/hypr/hyprland.conf | 28 ++++++++++++++++++++++++++++ modules/display.nix | 34 ++++++++++++++++++++++------------ 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index eec0fe3..3da26bf 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -30,10 +30,13 @@ $menu = wofi --show drun # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: +exec-once = hyprctl plugin load "$HYPR_PLUGIN_DIR/lib/libhyprbars.so" + # exec-once = waybar & hyprpaper & firefox exec-once = [workspace 1 silent] $terminal exec-once = [workspace 2 silent] $browser + ############################# ### ENVIRONMENT VARIABLES ### ############################# @@ -315,3 +318,28 @@ windowrule = noinitialfocus, class:^(flameshot)$ # set this to your leftmost monitor id, otherwise you have to move your cursor to the leftmost monitor # before executing flameshot windowrule = monitor 1, class:^(flameshot)$ + +windowrule = float, class:^(.*gwenview.*)$ +windowrule = float, class:^(.*dolphin.*)$ +windowrule = plugin:hyprbars:bar_color rgb(ff0000), class:^(.*gwenview.*)$ + + +############### +### Plugins ### +############### + +plugin { + hyprbars { + enabled = true + # example config + bar_height = 20 + + # example buttons (R -> L) + # hyprbars-button = color, size, on-click + hyprbars-button = rgb(ff4040), 10, 󰖭, hyprctl dispatch killactive + hyprbars-button = rgb(eeee11), 10, , hyprctl dispatch fullscreen 1 + + # cmd to run on double click of the bar + on_double_click = hyprctl dispatch fullscreen 1 + } +} diff --git a/modules/display.nix b/modules/display.nix index e8598f8..58fb217 100644 --- a/modules/display.nix +++ b/modules/display.nix @@ -1,20 +1,30 @@ -{ pkgs, lib, inputs, ... }: - with lib; let - hyprPluginPkgs = inputs.hyprland-plugins.packages.${pkgs.system}; - hypr-plugin-dir = pkgs.symlinkJoin { - name = "hyrpland-plugins"; - paths = with hyprPluginPkgs; [ - hyprbars - ]; - }; -in { +{ + pkgs, + lib, + inputs, + ... +}: +with lib; +let + hyprPluginPkgs = inputs.hyprland-plugins.packages.${pkgs.system}; + hypr-plugin-dir = pkgs.symlinkJoin { + name = "hyrpland-plugins"; + paths = with hyprPluginPkgs; [ + hyprbars + ]; + }; +in +{ programs.hyprland = { enable = true; package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + portalPackage = + inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + }; + environment.sessionVariables = { + HYPR_PLUGIN_DIR = hypr-plugin-dir; }; - environment.sessionVariables = { HYPR_PLUGIN_DIR = hypr-plugin-dir; }; # Optional, hint electron apps to use wayland: # environment.sessionVariables.NIXOS_OZONE_WL = "1";