mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 15:39:58 +00:00
sway: add DND toggle in sway and waybar
This commit is contained in:
@@ -170,6 +170,9 @@ bindsym $mod+Shift+v exec pavucontrol
|
||||
# File manager
|
||||
bindsym $mod+Shift+f exec thunar
|
||||
|
||||
# Do not disturb (dunst pause toggle)
|
||||
bindsym $mod+Shift+d exec dunstctl set-paused toggle
|
||||
|
||||
# Manual lock screen
|
||||
bindsym $mod+Shift+x exec ~/.config/sway/scripts/lockscreen
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
"modules-left": ["sway/workspaces"],
|
||||
"modules-center": [],
|
||||
"modules-right": ["cpu", "memory", "disk", "temperature", "backlight", "network", "pulseaudio", "battery", "tray", "clock", "custom/power"],
|
||||
"modules-right": ["cpu", "memory", "disk", "temperature", "backlight", "network", "pulseaudio", "battery", "tray", "clock", "custom/dnd", "custom/power"],
|
||||
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true,
|
||||
@@ -99,6 +99,14 @@
|
||||
"spacing": 6
|
||||
},
|
||||
|
||||
"custom/dnd": {
|
||||
"exec": "dunstctl is-paused | grep -q true && echo '{\"text\":\"\",\"class\":\"paused\"}' || echo '{\"text\":\"\",\"class\":\"\"}'",
|
||||
"return-type": "json",
|
||||
"interval": 2,
|
||||
"on-click": "dunstctl set-paused toggle",
|
||||
"tooltip": false
|
||||
},
|
||||
|
||||
"custom/power": {
|
||||
"format": "⏻",
|
||||
"tooltip": false,
|
||||
|
||||
@@ -44,6 +44,7 @@ window#waybar {
|
||||
#pulseaudio,
|
||||
#battery,
|
||||
#tray,
|
||||
#custom-dnd,
|
||||
#custom-power {
|
||||
padding: 0 8px;
|
||||
}
|
||||
@@ -67,6 +68,17 @@ window#waybar {
|
||||
|
||||
#tray { padding: 0 6px; }
|
||||
|
||||
#custom-dnd {
|
||||
color: #8e8e9a;
|
||||
font-size: 11pt;
|
||||
}
|
||||
#custom-dnd.paused {
|
||||
color: #e0af68;
|
||||
}
|
||||
#custom-dnd:hover {
|
||||
background-color: rgba(224, 175, 104, 0.15);
|
||||
}
|
||||
|
||||
#custom-power {
|
||||
color: #c7162b;
|
||||
padding: 0 10px;
|
||||
|
||||
Reference in New Issue
Block a user