From b775657b1e587020cb502d2bbde95140be677821 Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Fri, 17 May 2024 15:36:24 -0700 Subject: [PATCH] backlight --- config/waybar.css | 4 ++++ modules/desktop/hyprland.nix | 3 +++ modules/desktop/waybar.nix | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/config/waybar.css b/config/waybar.css index 0dd5959..3ee3ba2 100644 --- a/config/waybar.css +++ b/config/waybar.css @@ -103,6 +103,10 @@ window#waybar.floating #window { color: @sapphire; } +#backlight { + color: @yellow; +} + #pulseaudio { color: @pink; } diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 948d6ab..9fa0fa5 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -49,6 +49,9 @@ in { bindel = [ # "bind held & locked" ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 10%+" ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%-" + + ", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s +5%" + ", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s 5%-" ]; bindl = [ # "bind locked" ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix index 9c4e939..0c91d10 100644 --- a/modules/desktop/waybar.nix +++ b/modules/desktop/waybar.nix @@ -49,6 +49,7 @@ in { orientation = "inherit"; modules = [ "pulseaudio" + "backlight" #"network" "cpu" "memory" @@ -169,6 +170,11 @@ in { on-click = "${lib.getExe pkgs.pavucontrol}"; ignored-sinks = ["Easy Effects Sink"]; }; + backlight = { + format = "{icon} {percent}%"; + format-icons = ["" ""]; + scroll-step = 1; + }; cpu = { interval = 4; format = " {usage}% {avg_frequency}GHz";