[waybar] feat: Add groups and power-profiles module

This commit is contained in:
Tibo De Peuter 2024-06-02 20:53:09 +02:00
parent 24ac842631
commit 0a7a5181ff
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
3 changed files with 123 additions and 15 deletions

View file

@ -1,17 +1,12 @@
{
"modules-left": [
"sway/workspaces",
"idle_inhibitor",
"custom/light-dark-toggle",
"custom/night-light-toggle",
"custom/toggle-notifications",
"mpris"
"custom/scratchpad-indicator",
"mpris",
"group/system",
],
"modules-right": [
"memory",
"cpu",
"temperature",
"group/hardware",
"custom/sep",
"bluetooth",
"network",

View file

@ -58,7 +58,52 @@
"on-click": "bash ${SCRIPT_DIR}/sunset.sh",
"tooltip-format": "Toggle night-light on or off",
"format": "\uf0eb ",
"tooltip": true
"tooltip": true,
"tooltip-format": "Toggle night-light on or off",
},
"custom/scratchpad-indicator": {
"interval": 3,
"return-type": "json",
"exec": "swaymsg -t get_tree | jq --unbuffered --compact-output '(recurse(.nodes[]) | select(.name == \"__i3_scratch\") | .focus) as $scratch_ids | [.. | (.nodes? + .floating_nodes?) // empty | .[] | select(.id |IN($scratch_ids[]))] as $scratch_nodes | if ($scratch_nodes|length) > 0 then { text: \"\\($scratch_nodes | length)\", tooltip: $scratch_nodes | map(\"\\(.app_id // .window_properties.class) (\\(.id)): \\(.name)\") | join(\"\\n\") } else empty end'",
"format": "{} \uf2d2",
"on-click": "exec swaymsg 'scratchpad show'",
"on-click-right": "exec swaymsg 'move scratchpad'"
},
"custom/system-lock": {
"format": "\uf09c",
"tooltip": true,
"tooltip-format": "Lock device",
"on-click": "swaylock -f"
},
"custom/system-sleep": {
"format": "\uf186",
"tooltip": true,
"tooltip-format": "Put device to sleep",
"on-click": "swaylock -f; systemctl suspend"
},
"custom/system-hibernate": {
"format": "\uf2dc",
"tooltip": true,
"tooltip-format": "Hibernate device",
"on-click": "swaylock -f; systemctl hibernate"
},
"custom/system-reboot": {
"format": "\uf0e2",
"tooltip": true,
"tooltip-format": "Reboot device",
"on-click": "systemctl reboot"
},
"custom/system-shutdown": {
"format": "\uf011",
"tooltip": true,
"tooltip-format": "Shutdown device",
"on-click": "systemctl poweroff -i"
},
"custom/toggle-notifications": {
@ -70,10 +115,45 @@
"cpu": {
"format": "{usage}% \uf2db",
"on-click": "kitty -e htop",
"on-click": "foot -e htop",
"tooltip": true
},
"group/hardware": {
"orientation": "inherit",
"modules": [
"power-profiles-daemon",
"memory",
"cpu",
"temperature",
"custom/system-shutdown",
"custom/system-reboot",
"custom/system-hibernate",
"custom/system-sleep",
"custom/system-lock",
],
"drawer": {
"transition-duration": 500,
"transition-left-to-right": false,
"children-class": "drawer-child",
},
},
"group/system": {
"orientation": "inherit",
"modules": [
"idle_inhibitor",
"custom/light-dark-toggle",
"custom/night-light-toggle",
"custom/toggle-notifications",
],
"drawer": {
"transition-duration": 500,
"tansition-left-to-right": true,
"children-class": "drawer-child",
},
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
@ -149,6 +229,18 @@
// }
},
"power-profiles-daemon": {
"format": "{icon}",
"tooltip-format": "Power profile: {profile}\nDriver: {driver}",
"tooltip": true,
"format-icons": {
"default": "",
"performance": "",
"balanced": "",
"power-saver": ""
}
},
"privacy": {
"icon-spacing": 4,
"icon-size": 18,

View file

@ -49,10 +49,31 @@ window#waybar {
}
/* All modules individually. */
#backlight, #battery, #bluetooth, #clock, #cpu,
#custom-browser, #custom-media, #custom-light-dark-toggle, #custom-night-light-toggle, #custom-toggle-notifications,
#disk, #idle_inhibitor, #memory, #mode, #mpd, #network,
#pulseaudio, #temperature, #tray {
#backlight,
#battery,
#bluetooth,
#clock,
#cpu,
#custom-browser,
#custom-light-dark-toggle,
#custom-night-light-toggle,
#custom-system-lock, #custom-system-sleep, #custom-system-hibernate, #custom-system-reboot, #custom-system-shutdown,
#custom-toggle-notifications,
#disk,
#group-hardware,
#group-system,
#idle_inhibitor,
#keyboard-state,
#memory,
#mode,
#mpd,
#mpris,
#network,
#power-profiles-daemon,
#privacy-item.audio-in, #privacy-item.audio-out, #privacy-item.screenshare,
#pulseaudio,
#temperature,
#tray {
padding: 0 5px;
}