waybar: add power menu

This commit is contained in:
Adam Gausmann 2025-05-15 16:46:07 -05:00
parent a4c9f59091
commit 022f9468c6
2 changed files with 36 additions and 1 deletions

View file

@ -30,7 +30,8 @@
{% endif %}
"clock#utc",
"clock#local"
"clock#local",
"custom/power",
],
"niri/workspaces": {
@ -148,5 +149,16 @@
"interval": 5,
"format": "{:%H:%M}",
"tooltip": false
},
"custom/power": {
"format": "\uf011",
"tooltip": false,
"menu": "on-click",
"menu-file": "$HOME/.config/waybar/power_menu.xml",
"menu-actions": {
"shutdown": "loginctl poweroff",
"reboot": "loginctl reboot",
"logout": "niri msg action quit"
}
}
}

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkMenu" id="menu">
<child>
<object class="GtkMenuItem" id="logout">
<property name="label">Log out</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="delimiter1"/>
</child>
<child>
<object class="GtkMenuItem" id="shutdown">
<property name="label">Shutdown</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="reboot">
<property name="label">Reboot</property>
</object>
</child>
</object>
</interface>