Add notification silencing indicator to waybar
This commit is contained in:
Executable
+11
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
makoctl mode -t do-not-disturb
|
||||||
|
|
||||||
|
if makoctl mode | grep -q 'do-not-disturb'; then
|
||||||
|
notify-send "Silenced notifications"
|
||||||
|
else
|
||||||
|
notify-send "Enabled notifications"
|
||||||
|
fi
|
||||||
|
|
||||||
|
pkill -RTMIN+10 waybar
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
"spacing": 0,
|
"spacing": 0,
|
||||||
"height": 26,
|
"height": 26,
|
||||||
"modules-left": ["custom/omarchy", "hyprland/workspaces"],
|
"modules-left": ["custom/omarchy", "hyprland/workspaces"],
|
||||||
"modules-center": ["clock", "custom/update", "custom/voxtype", "custom/screenrecording-indicator", "custom/idle-indicator"],
|
"modules-center": ["clock", "custom/update", "custom/voxtype", "custom/screenrecording-indicator", "custom/idle-indicator", "custom/notification-silencing-indicator"],
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"group/tray-expander",
|
"group/tray-expander",
|
||||||
"bluetooth",
|
"bluetooth",
|
||||||
@@ -148,6 +148,12 @@
|
|||||||
"signal": 9,
|
"signal": 9,
|
||||||
"return-type": "json"
|
"return-type": "json"
|
||||||
},
|
},
|
||||||
|
"custom/notification-silencing-indicator": {
|
||||||
|
"on-click": "omarchy-toggle-notification-silencing",
|
||||||
|
"exec": "$OMARCHY_PATH/default/waybar/indicators/notification-silencing.sh",
|
||||||
|
"signal": 10,
|
||||||
|
"return-type": "json"
|
||||||
|
},
|
||||||
"custom/voxtype": {
|
"custom/voxtype": {
|
||||||
"exec": "omarchy-voxtype-status",
|
"exec": "omarchy-voxtype-status",
|
||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ tooltip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#custom-screenrecording-indicator,
|
#custom-screenrecording-indicator,
|
||||||
#custom-idle-indicator {
|
#custom-idle-indicator,
|
||||||
|
#custom-notification-silencing-indicator {
|
||||||
min-width: 12px;
|
min-width: 12px;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
@@ -84,7 +85,8 @@ tooltip {
|
|||||||
color: #a55555;
|
color: #a55555;
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-idle-indicator.active {
|
#custom-idle-indicator.active,
|
||||||
|
#custom-notification-silencing-indicator.active {
|
||||||
color: #a55555;
|
color: #a55555;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ bindd = SUPER SHIFT, BACKSPACE, Toggle workspace gaps, exec, omarchy-hyprland-wo
|
|||||||
# Notifications
|
# Notifications
|
||||||
bindd = SUPER, COMMA, Dismiss last notification, exec, makoctl dismiss
|
bindd = SUPER, COMMA, Dismiss last notification, exec, makoctl dismiss
|
||||||
bindd = SUPER SHIFT, COMMA, Dismiss all notifications, exec, makoctl dismiss --all
|
bindd = SUPER SHIFT, COMMA, Dismiss all notifications, exec, makoctl dismiss --all
|
||||||
bindd = SUPER CTRL, COMMA, Toggle silencing notifications, exec, makoctl mode -t do-not-disturb && makoctl mode | grep -q 'do-not-disturb' && notify-send "Silenced notifications" || notify-send "Enabled notifications"
|
bindd = SUPER CTRL, COMMA, Toggle silencing notifications, exec, omarchy-toggle-notification-silencing
|
||||||
bindd = SUPER ALT, COMMA, Invoke last notification, exec, makoctl invoke
|
bindd = SUPER ALT, COMMA, Invoke last notification, exec, makoctl invoke
|
||||||
bindd = SUPER SHIFT ALT, COMMA, Restore last notification, exec, makoctl restore
|
bindd = SUPER SHIFT ALT, COMMA, Restore last notification, exec, makoctl restore
|
||||||
|
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if makoctl mode | grep -q 'do-not-disturb'; then
|
||||||
|
echo '{"text": "", "tooltip": "Notifications silenced", "class": "active"}'
|
||||||
|
else
|
||||||
|
echo '{"text": ""}'
|
||||||
|
fi
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
echo "Add notification silencing indicator to Waybar"
|
||||||
|
|
||||||
|
STYLE_FILE=~/.config/waybar/style.css
|
||||||
|
CONFIG_FILE=~/.config/waybar/config.jsonc
|
||||||
|
|
||||||
|
# Add notification-silencing-indicator to modules-center if not present
|
||||||
|
if ! grep -q "custom/notification-silencing-indicator" "$CONFIG_FILE"; then
|
||||||
|
sed -i 's/"custom\/idle-indicator"]/"custom\/idle-indicator", "custom\/notification-silencing-indicator"]/' "$CONFIG_FILE"
|
||||||
|
|
||||||
|
sed -i '/"tray": {/i\ "custom/notification-silencing-indicator": {\n "on-click": "omarchy-toggle-notification-silencing",\n "exec": "$OMARCHY_PATH/default/waybar/indicators/notification-silencing.sh",\n "signal": 10,\n "return-type": "json"\n },' "$CONFIG_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add notification-silencing-indicator CSS if not present
|
||||||
|
if ! grep -q "#custom-notification-silencing-indicator" "$STYLE_FILE"; then
|
||||||
|
# Add to the shared indicator rule
|
||||||
|
sed -i 's/#custom-idle-indicator {/#custom-idle-indicator,\n#custom-notification-silencing-indicator {/' "$STYLE_FILE"
|
||||||
|
|
||||||
|
# Add to the shared active color rule
|
||||||
|
sed -i 's/#custom-idle-indicator.active {/#custom-idle-indicator.active,\n#custom-notification-silencing-indicator.active {/' "$STYLE_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
omarchy-restart-waybar
|
||||||
Reference in New Issue
Block a user