mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Remove legacy online installer entrypoints, collapse migrations for 4.0, and move setup responsibilities into target-side system, hardware, and user commands.
36 lines
996 B
Bash
Executable File
36 lines
996 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Monitor sleep preparation and lock before suspend
|
|
# omarchy:group=system
|
|
# omarchy:hidden=true
|
|
|
|
monitor_command='exec dbus-monitor --system "type='\''signal'\'',sender='\''org.freedesktop.login1'\'',interface='\''org.freedesktop.login1.Manager'\'',member='\''PrepareForSleep'\''"'
|
|
|
|
consume_sleep_events() {
|
|
local line sleep_lock
|
|
sleep_lock=$(command -v omarchy-system-sleep-lock || true)
|
|
sleep_lock=${sleep_lock:-/usr/bin/omarchy-system-sleep-lock}
|
|
|
|
while IFS= read -r line; do
|
|
if [[ $line == *"boolean true"* ]]; then
|
|
"$sleep_lock"
|
|
exit 0
|
|
fi
|
|
done
|
|
}
|
|
|
|
if [[ ${1:-} == "--consume" ]]; then
|
|
consume_sleep_events
|
|
exit 0
|
|
fi
|
|
|
|
sleep_monitor=$(command -v omarchy-system-sleep-monitor || true)
|
|
sleep_monitor=${sleep_monitor:-/usr/bin/omarchy-system-sleep-monitor}
|
|
|
|
exec systemd-inhibit \
|
|
--what=sleep \
|
|
--mode=delay \
|
|
--who=Omarchy \
|
|
--why="Lock screen before suspend" \
|
|
bash -lc "$monitor_command | \"$sleep_monitor\" --consume"
|