Compare commits
1 Commits
master
...
remove-sta
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1da249fef6 |
@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Status indicator daemon for waybar
|
||||
# Calls individual status scripts and caches results
|
||||
|
||||
STATE_DIR=~/.local/state/omarchy/status
|
||||
DAEMON_PID_FILE="$STATE_DIR/daemon.pid"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
|
||||
|
||||
mkdir -p "$STATE_DIR"
|
||||
|
||||
# Update all status files by calling individual scripts
|
||||
update_all_status_files() {
|
||||
"$SCRIPT_DIR/omarchy-status-dnd" >"$STATE_DIR/dnd"
|
||||
"$SCRIPT_DIR/omarchy-status-nightlight" >"$STATE_DIR/nightlight"
|
||||
"$SCRIPT_DIR/omarchy-status-idle" >"$STATE_DIR/idle"
|
||||
}
|
||||
|
||||
# Generate hash for change detection
|
||||
get_status_hash() {
|
||||
echo "$($(makoctl mode 2>/dev/null | grep -c 'do-not-disturb')$(hyprctl hyprsunset temperature 2>/dev/null)"
|
||||
}
|
||||
|
||||
# Start background monitoring daemon
|
||||
start_daemon() {
|
||||
if [ -f "$DAEMON_PID_FILE" ] && kill -0 $(cat "$DAEMON_PID_FILE") 2>/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
{
|
||||
last_hash=""
|
||||
while true; do
|
||||
current_hash=$(get_status_hash)
|
||||
|
||||
if [ "$current_hash" != "$last_hash" ]; then
|
||||
update_all_status_files
|
||||
last_hash="$current_hash"
|
||||
fi
|
||||
|
||||
sleep 0.5
|
||||
done
|
||||
} &
|
||||
|
||||
echo $! >"$DAEMON_PID_FILE"
|
||||
}
|
||||
|
||||
# Main execution
|
||||
MODULE="$1"
|
||||
|
||||
if [ -z "$MODULE" ]; then
|
||||
echo "Usage: $0 [dnd|nightlight|idle]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
start_daemon
|
||||
|
||||
# Return cached status for requested module
|
||||
if [ -f "$STATE_DIR/$MODULE" ]; then
|
||||
cat "$STATE_DIR/$MODULE"
|
||||
else
|
||||
update_all_status_files
|
||||
cat "$STATE_DIR/$MODULE" 2>/dev/null || echo '{"text": "", "tooltip": "", "class": "hidden"}'
|
||||
fi
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# DND status indicator
|
||||
|
||||
if makoctl mode 2>/dev/null | grep -q 'do-not-disturb'; then
|
||||
echo '{"text": "", "tooltip": "Notifications silenced", "class": "status-dnd"}'
|
||||
else
|
||||
echo '{"text": "", "tooltip": "", "class": "hidden"}'
|
||||
fi
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Idle lock status indicator
|
||||
|
||||
if command -v hypridle >/dev/null 2>&1 && ! pgrep -x hypridle >/dev/null 2>&1; then
|
||||
echo '{"text": "", "tooltip": "Idle lock disabled", "class": "status-idle"}'
|
||||
else
|
||||
echo '{"text": "", "tooltip": "", "class": "hidden"}'
|
||||
fi
|
@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Nightlight status indicator
|
||||
|
||||
if pgrep -x hyprsunset >/dev/null 2>&1; then
|
||||
temp=$(hyprctl hyprsunset temperature 2>/dev/null | grep -oE '[0-9]+')
|
||||
if [ -n "$temp" ] && [ "$temp" -lt 6000 ]; then
|
||||
echo '{"text": "", "tooltip": "Night light active", "class": "status-nightlight"}'
|
||||
else
|
||||
echo '{"text": "", "tooltip": "", "class": "hidden"}'
|
||||
fi
|
||||
else
|
||||
echo '{"text": "", "tooltip": "", "class": "hidden"}'
|
||||
fi
|
@ -119,32 +119,6 @@
|
||||
},
|
||||
"modules": ["custom/expand-icon", "tray"]
|
||||
},
|
||||
"group/status-cluster": {
|
||||
"orientation": "inherit",
|
||||
"modules": [
|
||||
"custom/status-dnd",
|
||||
"custom/status-nightlight",
|
||||
"custom/status-idle"
|
||||
]
|
||||
},
|
||||
"custom/status-dnd": {
|
||||
"exec": "omarchy-status-daemon dnd",
|
||||
"return-type": "json",
|
||||
"interval": 1,
|
||||
"on-click": "makoctl mode -t do-not-disturb"
|
||||
},
|
||||
"custom/status-nightlight": {
|
||||
"exec": "omarchy-status-daemon nightlight",
|
||||
"return-type": "json",
|
||||
"interval": 1,
|
||||
"on-click": "omarchy-toggle-nightlight"
|
||||
},
|
||||
"custom/status-idle": {
|
||||
"exec": "omarchy-status-daemon idle",
|
||||
"return-type": "json",
|
||||
"interval": 1,
|
||||
"on-click": "omarchy-toggle-idle"
|
||||
},
|
||||
"custom/expand-icon": {
|
||||
"format": " ",
|
||||
"tooltip": false
|
||||
|
@ -4,7 +4,7 @@ windowrule = center, tag:floating-window
|
||||
windowrule = size 800 600, tag:floating-window
|
||||
|
||||
windowrule = tag +floating-window, class:(blueberry.py|Impala|Wiremix|org.gnome.NautilusPreviewer|com.gabm.satty|Omarchy|About|TUI.float)
|
||||
windowrule = tag +floating-window, class:(xdg-desktop-portal-gtk|sublime_text), title:^(Open.*Files?|Save.*Files?|All Files|Save)
|
||||
windowrule = tag +floating-window, class:(xdg-desktop-portal-gtk|sublime_text|DesktopEditors), title:^(Open.*Files?|Save.*Files?|Save.*As|All Files|Save)
|
||||
|
||||
# Fullscreen screensaver
|
||||
windowrule = fullscreen, class:Screensaver
|
||||
|
@ -1,4 +1,4 @@
|
||||
echo "Add status indicators for nightlight, dnd, idle lock, and new icon to Waybar"
|
||||
echo "Add new Omarchy Menu icon to Waybar"
|
||||
|
||||
mkdir -p ~/.local/share/fonts
|
||||
cp ~/.local/share/omarchy/config/omarchy.ttf ~/.local/share/fonts/
|
||||
|
Loading…
x
Reference in New Issue
Block a user