From 3cab603c6052d87d8ab646f409d3bfe798826fd0 Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Sun, 23 Feb 2025 12:23:02 +0100 Subject: [PATCH] Added backlight widget to waybar --- nixos/modules/hyprland/waybar.nix | 15 ++++++++++++--- nixos/users/tania/default.nix | 1 - 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/nixos/modules/hyprland/waybar.nix b/nixos/modules/hyprland/waybar.nix index efff28c..5ee6808 100644 --- a/nixos/modules/hyprland/waybar.nix +++ b/nixos/modules/hyprland/waybar.nix @@ -32,11 +32,12 @@ in "hyprland/workspaces" # "hyprland/window" ]; - modules-right = [ + modules-right = lib.optional hwconfig.isLaptop "backlight" + ++ [ "pulseaudio" #"network" #"cpu" - #"memory" + "memory" #"temperature" "hyprland/language" ] ++ lib.optional battery.available "custom/battery" @@ -57,6 +58,11 @@ in warning = 20; }; }; + backlight = { + format = "{percent}% 󰛩"; + on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl s 5%+"; + on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl s 5%-"; + }; "custom/battery" = { exec ="${pkgs.writeShellScriptBin "battery-widget" '' ${battery.labelAdaptive} @@ -76,7 +82,10 @@ in "hyprland/language" = { format = " {}"; }; - memory = { format = "{}% "; }; + memory = { + interval = 1; + format = "{used}/{total}Gb "; + }; network = { interval = 1; format-alt = "{ifname}: {ipaddr}/{cidr}"; diff --git a/nixos/users/tania/default.nix b/nixos/users/tania/default.nix index 2659821..74ec878 100644 --- a/nixos/users/tania/default.nix +++ b/nixos/users/tania/default.nix @@ -11,7 +11,6 @@ in #initialPassword = "1234"; hashedPasswordFile = config.sops.secrets."users/${username}".path; packages = with pkgs; [ - anydesk ]; }; sops.secrets = {