From 8fea37feef1048ec0613739c8c34ec6486713aeb Mon Sep 17 00:00:00 2001 From: Tomas Rivera <137088692+Totorile1@users.noreply.github.com> Date: Sat, 28 Feb 2026 11:51:23 +0100 Subject: [PATCH] worked on waybar config --- hosts/laptop/configuration.nix | 1 + modules/home-manager/waybar.nix | 81 ++++++++++++++++++++++++------- modules/scripts/colorpicker.nix | 13 ++++- modules/scripts/weatherwaybar.nix | 2 +- 4 files changed, 77 insertions(+), 20 deletions(-) diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 2c8a40c..88c34f2 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -151,6 +151,7 @@ gcc # GNU C compiler libreoffice gruvbox-gtk-theme hyprpicker +powertop #we need to install gnome and kde utils individually as we dont use gnome gnome-calculator snapshot diff --git a/modules/home-manager/waybar.nix b/modules/home-manager/waybar.nix index ea8fd91..c9c3fa7 100644 --- a/modules/home-manager/waybar.nix +++ b/modules/home-manager/waybar.nix @@ -13,19 +13,18 @@ modules-left = [ "hyprland/workspaces" "group/info" + "group/power" ]; - - modules-center = [ - "hyprland/window" ]; modules-right = [ + "hyprland/window" "group/brightness" "group/sound" "group/connection" "group/together" "tray" - "group/power" + "battery" ]; # groups settings are organized by alphabetical order "group/audio" = { @@ -95,13 +94,9 @@ }; "group/power" = { orientation = "inherit"; - drawer = { - transition-duration = 500; - transition-left-to-right = false; - }; modules = [ - "battery" - "power-profiles-daemon" + "battery#w" + "battery#powerdraw" ]; }; "group/sound" = { @@ -162,6 +157,37 @@ orientation = "vertical"; device = "intel_backlight"; }; + battery = { + #rotate = 90; + interval = 30; + states = { + good = 95; + warning = 20; + critical = 15; + }; + format = "{icon} {capacity}"; + format-charging = "{icon} {capacity}% "; + format-full = "{icon}"; + format-icons = [ + "󰁻" + "󰁼" + "󰁾" + "󰂀" + "󰂂" + "󰁹" + ]; + tooltip-format = "{timeTo} {capacity} %"; + }; + "battery#powerdraw" = { + rotate = 90; + interval = 10; + format = "{power:.0001f}"; + }; + "battery#w" = { + rotate = 90; + interval = 100000; + format = "W"; + }; bluetooth = { format-on = ""; format-off = "󰂲"; @@ -202,11 +228,7 @@ }; "custom/colorpicker" = { format = ""; - return-type = "json"; - interval = "once"; - exec = "custom-colorpicker -j"; - on-click = "sleep 1 && ~/.config/waybar/scripts/colorpicker.sh"; - signal = 1; + on-click = "hyprpicker | tee >(wl-copy) | cliphist store"; }; "custom/cpu-icon" = { format = "󰻠"; @@ -380,6 +402,7 @@ box-shadow: none; text-shadow: none; padding: 0px; + margin: 0px; } @@ -440,7 +463,10 @@ tooltip label { #disk, #together, #submap, -#custom-weather +#custom-weather { + font-size: 12px; +} + #custom-recorder, #connection, #cnoti, @@ -488,6 +514,9 @@ tooltip label { } #custom-cputemp, +#temperature { + font-size: 12px; +} #disk, #memory, #cpu { @@ -508,6 +537,10 @@ tooltip label { margin-bottom: 0px; } +#hyprland.window { + margin-left: 20px; +} + #workspaces { margin: 0px 2px; padding: 4px 0px 0px 0px; @@ -545,7 +578,7 @@ tooltip label { } #tray { - padding: 4px 0px 4px 0px; + padding: 0px 0px 0px 0px; } #bluetooth { @@ -559,6 +592,7 @@ tooltip label { } #battery { + font-size: 12px; border-radius: 8px; padding: 4px 0px; margin: 4px 2px 4px 2px; @@ -580,6 +614,19 @@ tooltip label { animation-direction: alternate; } +#battery.powerdraw { + font-size: 12px; + padding: 0; + margin-right: -20px; + margin-left: -20px; +} +#battery.w { + font-size: 12px; + padding: 0; + margin-left: -20px; + margin-right: -20px; +} + #clock { font-weight: bold; padding: 4px 2px 2px 2px; diff --git a/modules/scripts/colorpicker.nix b/modules/scripts/colorpicker.nix index 6ed3496..6137039 100644 --- a/modules/scripts/colorpicker.nix +++ b/modules/scripts/colorpicker.nix @@ -1,11 +1,20 @@ -{ writeShellApplication, hyprpicker, libnotify, toybox, ... }: + +# useless +# used to come from my old dotfiles which were copied from fedora-hyprdots +# just use hyprpicker | tee >(wl-copy) | cliphist store +# because hyprpicker and cliphist are inside my configuration.nix +# no need to verify their existence + + +{ writeShellApplication, hyprpicker, libnotify, toybox, wl-clipboard, ... }: writeShellApplication { - name = "custom-colorpicker"; + name = "custom-colorpicker-useless"; runtimeInputs = [ hyprpicker libnotify toybox + wl-clipboard ]; text = '' check() { diff --git a/modules/scripts/weatherwaybar.nix b/modules/scripts/weatherwaybar.nix index c14ce35..fa75032 100644 --- a/modules/scripts/weatherwaybar.nix +++ b/modules/scripts/weatherwaybar.nix @@ -14,7 +14,7 @@ TEXT2="''$(curl -s "https://wttr.in/?format=%t")" TEXT2=''${TEXT2/$PATTERN/} TEXT3="''$(curl -s "https://wttr.in/?format=%f")" TEXT3=''${TEXT3/$PATTERN/} -printf '{"text":"%s\n%s\n%s", "tooltip": false, "class": "weather"}\n' \ +printf '{"text":" %s\\n %s\\n %s", "tooltip": false, "class": "weather"}\\n' \ "$TEXT1" "$TEXT2" "$TEXT3" ''; }