From a36fc856994a5a066ddb77bbf58a25f95d9a53f1 Mon Sep 17 00:00:00 2001 From: Chris Toph Date: Sun, 20 Apr 2025 13:29:50 -0400 Subject: [PATCH] Refines Hyprland configuration and scripts - Updates monitor identifiers for consistency (DP-3 to DP-1) - Enhances brightness script with dynamic bus list and ddcutil integration - Adds new window rules for specific overlay dialogs - Fixes font package reference for better maintainability - Consolidates firmware handling to enable all types - Improves configuration clarity and functionality across multiple components. --- home/toph/common/optional/hyprland/binds.nix | 2 +- .../toph/common/optional/hyprland/plugins.nix | 4 ++-- home/toph/common/optional/hyprland/rules.nix | 2 ++ .../optional/hyprland/scripts/brightness.nix | 24 ++++++++++++------- .../optional/hyprland/theme/default.nix | 5 +--- home/toph/rune/default.nix | 2 +- hosts/common/core/default.nix | 3 +-- hosts/common/core/fonts.nix | 4 ---- 8 files changed, 24 insertions(+), 22 deletions(-) diff --git a/home/toph/common/optional/hyprland/binds.nix b/home/toph/common/optional/hyprland/binds.nix index 38dc480..560256e 100644 --- a/home/toph/common/optional/hyprland/binds.nix +++ b/home/toph/common/optional/hyprland/binds.nix @@ -27,7 +27,7 @@ let launcher = "${pkgs.walker}/bin/walker --modules applications,ssh"; pactl = lib.getExe' pkgs.pulseaudio "pactl"; terminal = exec (import ./scripts/terminal.nix { inherit pkgs; }); - brightness = exec (import ./scripts/brightness.nix { inherit pkgs; }); + brightness = exec (import ./scripts/brightness.nix { inherit pkgs lib; }); ## Long ass keys ## lowerVol = "XF86AudioLowerVolume"; diff --git a/home/toph/common/optional/hyprland/plugins.nix b/home/toph/common/optional/hyprland/plugins.nix index e018858..8406856 100644 --- a/home/toph/common/optional/hyprland/plugins.nix +++ b/home/toph/common/optional/hyprland/plugins.nix @@ -45,7 +45,7 @@ jump_labels_keys = "qwfpgarstd"; # monitor_options = '' # ( - # DP-3 = ( + # DP-1 = ( # mode = row; # column_default_width = onehalf; # column_widths = onehalf onethird twothirds threefourths; @@ -60,7 +60,7 @@ # window_heights = seveneighths onehalf onethird twothirds # ), # )''; - monitor_options = "(DP-3 = (mode = row;column_default_width = onehalf;column_widths = seveneighths threequarters twothirds onehalf onethird;window_default_height = one;window_heights = one seveneighths twothirds onehalf onethird),HDMI-A-2 = (mode = col; column_default_width = one;column_widths = one onehalf;window_default_height = twothirds;window_heights = seveneighths twothirds onehalf onethird),)"; + monitor_options = "(DP-1 = (mode = row;column_default_width = onehalf;column_widths = seveneighths threequarters twothirds onehalf onethird;window_default_height = one;window_heights = one seveneighths twothirds onehalf onethird),HDMI-A-2 = (mode = col; column_default_width = one;column_widths = one onehalf;window_default_height = twothirds;window_heights = seveneighths twothirds onehalf onethird),)"; }; }; }; diff --git a/home/toph/common/optional/hyprland/rules.nix b/home/toph/common/optional/hyprland/rules.nix index 47e5c75..a4c6de3 100644 --- a/home/toph/common/optional/hyprland/rules.nix +++ b/home/toph/common/optional/hyprland/rules.nix @@ -100,6 +100,8 @@ in "opaque, initialClass:^(Ryujinx)$" "immediate, initialClass:^(Ryujinx)$" "workspace 3, initialClass:^(Ryujinx)$" + "float, initialTitle:^(ContentDialogOverlayWindow)$" + "center, initialTitle:^(ContentDialogOverlayWindow)$" ## Steam rules ## "opaque, initialClass:^([Gg]amescope)$" diff --git a/home/toph/common/optional/hyprland/scripts/brightness.nix b/home/toph/common/optional/hyprland/scripts/brightness.nix index 3d8c32e..f851fb8 100644 --- a/home/toph/common/optional/hyprland/scripts/brightness.nix +++ b/home/toph/common/optional/hyprland/scripts/brightness.nix @@ -1,7 +1,15 @@ -{ - pkgs, - ... -}: +{ pkgs, lib, ... }: + +let + # Define your I2C bus numbers + # Couldnt find a non hardcoded way to get the bus numbers :( + busesList = [ + 6 + 9 + ]; + busesStr = lib.concatStringsSep " " (map toString busesList); +in + pkgs.writeScript "brightness-control" '' #!/usr/bin/env fish @@ -17,7 +25,7 @@ pkgs.writeScript "brightness-control" '' end set option $argv[1] - set value $argv[2] + set value $argv[2] if test "$option" = "--up" -o "$option" = "+" set op "+" @@ -28,11 +36,11 @@ pkgs.writeScript "brightness-control" '' exit 1 end - # Hardcoded bus numbers from ddcutil detect. Adjust if necessary. - set buses 10 11 + # Hard-coded bus list: + set buses ${busesStr} for bus in $buses echo "Changing brightness on bus $bus: ddcutil setvcp 10 $op $value --bus $bus" - ddcutil setvcp 10 $op $value --bus $bus + ${pkgs.ddcutil}/bin/ddcutil setvcp 10 $op $value --bus $bus end '' diff --git a/home/toph/common/optional/hyprland/theme/default.nix b/home/toph/common/optional/hyprland/theme/default.nix index 2c9bc3f..a4c8132 100644 --- a/home/toph/common/optional/hyprland/theme/default.nix +++ b/home/toph/common/optional/hyprland/theme/default.nix @@ -5,9 +5,6 @@ ... }: let - path = lib.custom.relativeToRoot "pkgs/common/monocraft-nerd-fonts/package.nix"; - monocraft-nerd-fonts = pkgs.callPackage path { inherit pkgs; }; - qogir = pkgs.qogir-icon-theme.override { colorVariants = [ "dark" @@ -42,7 +39,7 @@ in }; monospace = { - package = monocraft-nerd-fonts; + package = pkgs.monocraft-nerd-fonts; name = "Monocraft"; }; diff --git a/home/toph/rune/default.nix b/home/toph/rune/default.nix index 6d77e38..94caac1 100644 --- a/home/toph/rune/default.nix +++ b/home/toph/rune/default.nix @@ -50,7 +50,7 @@ monitors = [ { - name = "DP-3"; + name = "DP-1"; x = 900; y = 0; width = 3840; diff --git a/hosts/common/core/default.nix b/hosts/common/core/default.nix index 884fa3a..ed21537 100644 --- a/hosts/common/core/default.nix +++ b/hosts/common/core/default.nix @@ -66,8 +66,7 @@ in ## SUDO and Terminal ## # Database for aiding terminal-based programs environment.enableAllTerminfo = true; - # Enable firmware with a license allowing redistribution - hardware.enableRedistributableFirmware = true; + hardware.enableAllFirmware = true; security.sudo = { extraRules = [ diff --git a/hosts/common/core/fonts.nix b/hosts/common/core/fonts.nix index f40c4e0..cadfba5 100644 --- a/hosts/common/core/fonts.nix +++ b/hosts/common/core/fonts.nix @@ -1,8 +1,4 @@ { pkgs, lib, ... }: -let - path = lib.custom.relativeToRoot "pkgs/common/monocraft-nerd-fonts/package.nix"; - monocraft-nerd-fonts = pkgs.callPackage path { inherit pkgs; }; -in { fonts = { packages = with pkgs; [