Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion config/waybar/config.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"spacing": 0,
"height": 26,
"modules-left": ["custom/omarchy", "hyprland/workspaces"],
"modules-center": ["clock", "custom/update", "custom/screenrecording-indicator"],
"modules-center": ["custom/do-not-disturb-indicator","clock", "custom/update", "custom/screenrecording-indicator"],
"modules-right": [
"group/tray-expander",
"bluetooth",
Expand Down Expand Up @@ -134,5 +134,11 @@
"tray": {
"icon-size": 12,
"spacing": 17
},
"custom/do-not-disturb-indicator": {
"on-click": "makoctl mode -t do-not-disturb && notify-send 'Enabled notifications'",
"exec": "$OMARCHY_PATH/default/waybar/indicators/do-not-disturb.sh",
"signal": 9,
"return-type": "json"
}
}
2 changes: 2 additions & 0 deletions config/waybar/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#pulseaudio,
#custom-omarchy,
#custom-screenrecording-indicator,
#custom-do-not-disturb-indicator,
#custom-update {
min-width: 12px;
margin: 0 7.5px;
Expand Down Expand Up @@ -72,6 +73,7 @@ tooltip {
opacity: 0;
}

#custom-do-not-disturb-indicator,
#custom-screenrecording-indicator {
min-width: 12px;
margin-left: 8.75px;
Expand Down
2 changes: 1 addition & 1 deletion default/hypr/bindings/utilities.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bindd = SUPER, BACKSPACE, Toggle window transparency, exec, hyprctl dispatch set
# Notifications
bindd = SUPER, COMMA, Dismiss last notification, exec, makoctl dismiss
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, makoctl mode -t do-not-disturb && makoctl mode | grep -q 'do-not-disturb' && notify-send "Silenced notifications" || notify-send "Enabled notifications" && pkill -RTMIN+9 waybar

# Toggle idling
bindd = SUPER CTRL, I, Toggle locking on idle, exec, omarchy-toggle-idle
Expand Down
9 changes: 9 additions & 0 deletions default/waybar/indicators/do-not-disturb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

current_mode=$(makoctl mode | grep "do-not-disturb")

if [[ "$current_mode" == "do-not-disturb" ]]; then
echo '{"text": "", "tooltip": "All notifications are silenced", "class": "active"}'
else
echo '{"text": ""}'
fi
43 changes: 43 additions & 0 deletions migrations/1760683013.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# Migration script to add do-not-disturb indicator to waybar

CONFIG_FILE="$HOME/.config/waybar/config.jsonc"
STYLE_FILE="$HOME/.config/waybar/style.css"

# Backup files
cp "$CONFIG_FILE" "$CONFIG_FILE.bak"
cp "$STYLE_FILE" "$STYLE_FILE.bak"

# Update modules-center to include do-not-disturb-indicator
sed -i 's/"modules-center": \["clock", "custom\/update", "custom\/screenrecording-indicator"\]/"modules-center": ["custom\/do-not-disturb-indicator","clock", "custom\/update", "custom\/screenrecording-indicator"]/' "$CONFIG_FILE"

# Add custom/do-not-disturb-indicator configuration after tray section
sed -i '/"tray": {/,/^[[:space:]]*"spacing": 12$/{
/^[[:space:]]*"spacing": 12$/a\
},\
"custom/do-not-disturb-indicator": {\
"on-click": "makoctl mode -t do-not-disturb && notify-send '\''Enabled notifications'\''",\
"exec": "$OMARCHY_PATH/default/waybar/indicators/do-not-disturb.sh",\
"signal": 9,\
"return-type": "json"
}' "$CONFIG_FILE"

# Add styles for do-not-disturb-indicator
sed -i '/#custom-update {$/{
N
/\n min-width: 12px;/{
i\
#custom-do-not-disturb-indicator,
}
}' "$STYLE_FILE"

sed -i '/#custom-screenrecording-indicator {$/{
N
/\n min-width: 12px;/{
i\
#custom-do-not-disturb-indicator,
}
}' "$STYLE_FILE"

echo "waybar configs updated. Backups created at $CONFIG_FILE.bak and $STYLE_FILE.bak"