From a43c304d212a6753f8973d93f3dc39276a17a5e1 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 8 May 2026 08:39:25 +0200 Subject: [PATCH] Add post-boot.d hooks and give daily weather as an example --- config/omarchy/hooks/post-boot.d/weather.sample | 10 ++++++++++ default/hypr/autostart.conf | 3 +++ migrations/1778222128.sh | 7 +++++++ 3 files changed, 20 insertions(+) create mode 100644 config/omarchy/hooks/post-boot.d/weather.sample create mode 100644 migrations/1778222128.sh diff --git a/config/omarchy/hooks/post-boot.d/weather.sample b/config/omarchy/hooks/post-boot.d/weather.sample new file mode 100644 index 00000000..60a1c88f --- /dev/null +++ b/config/omarchy/hooks/post-boot.d/weather.sample @@ -0,0 +1,10 @@ +#!/bin/bash + +# Show the weather status notification after Omarchy has started. +# To put it into use, remove .sample from this file name. + +weather=$(omarchy-weather-status 2>/dev/null) || true + +if [[ -n $weather && $weather != "Weather unavailable" ]]; then + notify-send -u low "$weather" +fi diff --git a/default/hypr/autostart.conf b/default/hypr/autostart.conf index 5cdb875d..0a226db1 100644 --- a/default/hypr/autostart.conf +++ b/default/hypr/autostart.conf @@ -11,3 +11,6 @@ exec-once = uwsm-app -- omarchy-hyprland-monitor-watch # Slow app launch fix -- set systemd vars exec-once = systemctl --user import-environment $(env | cut -d'=' -f 1) exec-once = dbus-update-activation-environment --systemd --all + +# Run post-boot hooks after startup config has loaded +exec-once = sleep 2 && omarchy-hook post-boot diff --git a/migrations/1778222128.sh b/migrations/1778222128.sh new file mode 100644 index 00000000..d348b389 --- /dev/null +++ b/migrations/1778222128.sh @@ -0,0 +1,7 @@ +echo "Add sample post-boot hook" + +mkdir -p ~/.config/omarchy/hooks/post-boot.d + +if [[ ! -f ~/.config/omarchy/hooks/post-boot.d/weather.sample ]]; then + cp "$OMARCHY_PATH/config/omarchy/hooks/post-boot.d/weather.sample" ~/.config/omarchy/hooks/post-boot.d/weather.sample +fi