waybar: add power menu
This commit is contained in:
parent
a4c9f59091
commit
022f9468c6
2 changed files with 36 additions and 1 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
23
templates/.config/waybar/power_menu.xml
Normal file
23
templates/.config/waybar/power_menu.xml
Normal 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>
|
Loading…
Add table
Reference in a new issue