Waybar power button
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
// Choose the order of the modules
|
||||
"modules-left": ["sway/workspaces"],
|
||||
"modules-center": ["pulseaudio", "clock"],
|
||||
"modules-right": ["tray", "memory", "battery"],
|
||||
"modules-right": ["tray", "memory", "battery", "custom/power"],
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true,
|
||||
"sort-by-name": true,
|
||||
@@ -38,14 +38,17 @@
|
||||
"format": "{icon}",
|
||||
"format-icons": ["", "", "", "", "", "", "", "", ""]
|
||||
},
|
||||
"memory": {
|
||||
"format": "{used:0.1f}/{total:0.1f}G"
|
||||
},
|
||||
"battery": {
|
||||
"states": {
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{capacity}%",
|
||||
"format-charging": "",
|
||||
"format-plugged": "",
|
||||
"format": "🔋{capacity}%",
|
||||
"format-charging": "⚡{capacity}%",
|
||||
"format-plugged": "🔌{capacity}%",
|
||||
"format-alt": "{icon}",
|
||||
"format-icons": ["", "", "", "", "", "", "", "", "", "", "", ""]
|
||||
},
|
||||
@@ -56,6 +59,16 @@
|
||||
"format-icons": {
|
||||
"default": ["", "", " "]
|
||||
},
|
||||
"on-click": "pavucontrol"
|
||||
"on-click": "pwvucontrol"
|
||||
},
|
||||
"custom/power": {
|
||||
"format" : "⏻",
|
||||
"tooltip": false,
|
||||
"menu": "on-click",
|
||||
"menu-file": "~/.config/waybar/power_menu.xml",
|
||||
"menu-actions": {
|
||||
"shutdown": "systemctl poweroff",
|
||||
"reboot": "systemctl reboot"
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
15
.config/waybar/power_menu.xml
Normal file
15
.config/waybar/power_menu.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkMenu" id="menu">
|
||||
<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>
|
||||
Reference in New Issue
Block a user