waybar: remove cpu bars, re add power menu

This commit is contained in:
Vinzenz Schroeter 2025-11-09 15:06:18 +01:00
parent 9218e70999
commit 0679372363
2 changed files with 37 additions and 51 deletions

View file

@ -172,10 +172,10 @@
# Suggested binds for running programs: terminal, app launcher, screen locker. # Suggested binds for running programs: terminal, app launcher, screen locker.
"Mod+T".action.spawn = "${lib.getBin pkgs.gnome-console}/bin/kgx"; "Mod+T".action.spawn = "${lib.getBin pkgs.gnome-console}/bin/kgx";
"Mod+D".action.spawn = "fuzzel"; "Mod+D".action.spawn = "${lib.getBin config.programs.fuzzel.package}/bin/fuzzel";
"Super+Alt+L" = { "Super+Alt+L" = {
action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock";
allow-when-locked=true; allow-when-locked = true;
}; };
# You can also use a shell. Do this if you need pipes, multiple commands, etc. # You can also use a shell. Do this if you need pipes, multiple commands, etc.
@ -406,7 +406,7 @@
"Mod+Shift+P".action.power-off-monitors = { }; "Mod+Shift+P".action.power-off-monitors = { };
"Mod+W".action.toggle-column-tabbed-display = { }; "Mod+W".action.toggle-column-tabbed-display = { };
"Mod+O".action.toggle-overview = {}; "Mod+O".action.toggle-overview = { };
}; };
}; };
}; };

View file

@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
device, lib,
config,
... ...
}: }:
{ {
@ -34,7 +35,7 @@
]; ];
modules-right = [ modules-right = [
"mpris" "mpris"
"image" #"image"
"gamemode" "gamemode"
"temperature" "temperature"
@ -48,7 +49,7 @@
"power-profiles-daemon" "power-profiles-daemon"
"battery" "battery"
"idle_inhibitor" "idle_inhibitor"
#"group/group-power" "group/group-power"
]; ];
"niri/workspaces" = { "niri/workspaces" = {
format = "{icon}"; format = "{icon}";
@ -114,25 +115,7 @@
}; };
cpu = { cpu = {
interval = 1; interval = 1;
format = format = "{usage:3}%@{avg_frequency:4}";
"{usage:3}%@{avg_frequency:4} "
+ (builtins.getAttr device {
"vinzenz-lpt2" =
"{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}{icon16}{icon17}{icon18}{icon19}";
"vinzenz-pc2" =
"{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}";
})
+ " ";
format-icons = [
"<span color='#69ff94'></span>"
"<span color='#2aa9ff'></span>"
"<span color='#f8f8f2'></span>"
"<span color='#f8f8f2'></span>"
"<span color='#ffffa5'></span>"
"<span color='#ffffa5'></span>"
"<span color='#ff9977'></span>"
"<span color='#dd532e'></span>"
];
}; };
disk = { disk = {
format = "{free}/{total}"; format = "{free}/{total}";
@ -152,25 +135,28 @@
]; ];
}; };
"custom/quit" = { "custom/quit" = {
"format" = "󰗼"; "format" = "󰗼 ";
"tooltip" = false; "tooltip" = false;
"on-click" = "hyprctl dispatch exit"; "on-click" = "niri msg action quit";
min-width = 20; min-width = 20;
}; };
"custom/lock" = { "custom/lock" = {
"format" = "󰍁"; "format" = "󰍁 ";
"tooltip" = false; "tooltip" = false;
"on-click" = "swaylock"; "on-click" = "${lib.getBin config.programs.swaylock.package}/bin/swaylock";
min-width = 20;
}; };
"custom/reboot" = { "custom/reboot" = {
"format" = "󰜉"; "format" = "󰜉 ";
"tooltip" = false; "tooltip" = false;
"on-click" = "reboot"; "on-click" = "systemctl reboot";
min-width = 20;
}; };
"custom/power" = { "custom/power" = {
"format" = ""; "format" = " ";
"tooltip" = false; "tooltip" = false;
"on-click" = "shutdown now"; "on-click" = "systemctl shutdown";
min-width = 20;
}; };
idle_inhibitor = { idle_inhibitor = {
format = "{icon}"; format = "{icon}";
@ -179,24 +165,24 @@
deactivated = ""; deactivated = "";
}; };
}; };
image = #image =
let # let
albumArtScript = pkgs.writeShellScriptBin "album-art.sh" '' # albumArtScript = pkgs.writeShellScriptBin "album-art.sh" ''
#!${pkgs.bash}/bin/bash # #!${pkgs.bash}/bin/bash
album_art=$(playerctl metadata mpris:artUrl) # album_art=$(playerctl metadata mpris:artUrl)
if [[ -z $album_art ]] # if [[ -z $album_art ]]
then # then
exit # exit
fi # fi
curl -s "''${album_art}" --output "/tmp/cover.jpeg" # curl -s "''${album_art}" --output "/tmp/cover.jpeg"
echo "/tmp/cover.jpeg" # echo "/tmp/cover.jpeg"
''; # '';
in # in
{ # {
exec = "${albumArtScript}/bin/album-art.sh"; # exec = "${albumArtScript}/bin/album-art.sh";
interval = 15; # interval = 15;
on-click = "playerctl play-pause"; # on-click = "playerctl play-pause";
}; # };
mpris = { mpris = {
format = "{title} "; format = "{title} ";
tooltip-format = "{player} ({status}) {dynamic}"; tooltip-format = "{player} ({status}) {dynamic}";