diff --git a/AGENTS.md b/AGENTS.md index 5e227ff2..4f514fe2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -107,9 +107,9 @@ When testing layer-shell UI, capture the reference and candidate states as separ # Omarchy shell The Quickshell desktop runs as a single long-running process out of -`shell/`. The `omarchy-shell.service` user unit -keeps it running for the graphical session; do not start additional -standalone `quickshell -p` instances for individual components. +`shell/`. Hyprland autostart launches it directly with `quickshell -p`; do +not start additional standalone `quickshell -p` instances for individual +components. Run `omarchy-restart-shell` after making changes to QML files. @@ -130,8 +130,8 @@ Plugin contract: IPC: - `bin/omarchy-shell` is the canonical IPC entry point. It forwards to - the running shell service and does not start it. Prefer it over - re-implementing direct Quickshell socket calls in every CLI. + the running shell and does not start it. Prefer it over re-implementing + direct Quickshell socket calls in every CLI. - The `shell` IPC target exposes `ping`, `summon`, `hide`, `toggle`, `rescanPlugins`, `setPluginEnabled`, and `listPlugins`. Individual plugins can register additional IPC targets (the bar registers `bar`, diff --git a/bin/omarchy-first-run b/bin/omarchy-first-run index 737e1a3b..9f48eb3d 100755 --- a/bin/omarchy-first-run +++ b/bin/omarchy-first-run @@ -12,7 +12,6 @@ if [[ -f $FIRST_RUN_MODE ]]; then bash "$OMARCHY_PATH/install/first-run/battery-monitor.sh" bash "$OMARCHY_PATH/install/first-run/recover-internal-monitor.sh" - bash "$OMARCHY_PATH/install/first-run/omarchy-shell.sh" bash "$OMARCHY_PATH/install/first-run/cleanup-reboot-sudoers.sh" bash "$OMARCHY_PATH/install/first-run/firewall.sh" bash "$OMARCHY_PATH/install/first-run/dns-resolver.sh" diff --git a/bin/omarchy-restart-shell b/bin/omarchy-restart-shell index d00be603..a63a2a46 100755 --- a/bin/omarchy-restart-shell +++ b/bin/omarchy-restart-shell @@ -3,5 +3,8 @@ # omarchy:summary=Restart the Omarchy shell # omarchy:examples=omarchy restart shell -systemctl --user enable omarchy-shell.service >/dev/null -systemctl --user restart omarchy-shell.service +CONFIG_DIR="$OMARCHY_PATH/shell" + +if ! quickshell reload -p "$CONFIG_DIR" >/dev/null 2>&1; then + setsid quickshell -n -p "$CONFIG_DIR" >/dev/null 2>&1 & +fi diff --git a/bin/omarchy-shell b/bin/omarchy-shell index 213f1461..03c57558 100755 --- a/bin/omarchy-shell +++ b/bin/omarchy-shell @@ -8,8 +8,8 @@ if [[ $# -eq 0 || $1 == "-h" || $1 == "--help" ]]; then cat < [args...] -Forwards an IPC call to the supervised omarchy-shell service. The shell is -expected to already be running; this command does not start it. +Forwards an IPC call to the running Omarchy shell. The shell is expected +to already be running; this command does not start it. Examples: omarchy-shell shell ping diff --git a/config/systemd/user/omarchy-shell.service b/config/systemd/user/omarchy-shell.service deleted file mode 100644 index 96fd1a31..00000000 --- a/config/systemd/user/omarchy-shell.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Omarchy Shell -PartOf=graphical-session.target -After=graphical-session.target -StartLimitIntervalSec=30 -StartLimitBurst=5 - -[Service] -Type=exec -Environment=OMARCHY_PATH=%h/.local/share/omarchy -ExecStart=/usr/bin/quickshell -p %h/.local/share/omarchy/shell -Restart=always -RestartSec=2 -Slice=session-graphical.slice - -[Install] -WantedBy=graphical-session.target diff --git a/default/hypr/autostart.lua b/default/hypr/autostart.lua index 14700187..29cfd3b7 100644 --- a/default/hypr/autostart.lua +++ b/default/hypr/autostart.lua @@ -3,7 +3,7 @@ hl.on("hyprland.start", function() hl.exec_cmd("systemctl --user import-environment $(env | cut -d'=' -f 1)") hl.exec_cmd("dbus-update-activation-environment --systemd --all") - hl.exec_cmd("systemctl --user start omarchy-shell.service") + hl.exec_cmd("quickshell -n -p $HOME/.local/share/omarchy/shell") hl.exec_cmd("uwsm-app -- hypridle") hl.exec_cmd("uwsm-app -- fcitx5 --disable notificationitem") hl.exec_cmd("omarchy-first-run") diff --git a/install/first-run/omarchy-shell.sh b/install/first-run/omarchy-shell.sh deleted file mode 100644 index 2d1636b6..00000000 --- a/install/first-run/omarchy-shell.sh +++ /dev/null @@ -1,4 +0,0 @@ -mkdir -p ~/.config/systemd/user -cp "$OMARCHY_PATH/config/systemd/user/omarchy-shell.service" ~/.config/systemd/user/omarchy-shell.service -systemctl --user daemon-reload -systemctl --user enable --now omarchy-shell.service diff --git a/migrations/1779047753.sh b/migrations/1779047753.sh index 7222788b..d430a45f 100644 --- a/migrations/1779047753.sh +++ b/migrations/1779047753.sh @@ -1,17 +1,8 @@ -echo "Run omarchy-shell as a supervised user service" - -mkdir -p ~/.config/systemd/user -cp "$OMARCHY_PATH/config/systemd/user/omarchy-shell.service" ~/.config/systemd/user/omarchy-shell.service -systemctl --user daemon-reload +echo "Use omarchy-shell as the Quickshell IPC entry point" for file in ~/.config/hypr/bindings.lua ~/.config/hypr/bindings/*.lua; do [[ -f $file ]] || continue sed -i 's/omarchy-shell-ipc-fast/omarchy-shell/g; s/omarchy-shell-ipc/omarchy-shell/g; s/omarchy-shell[[:space:]]\+--if-running/omarchy-shell/g' "$file" done -if ! systemctl --user is-active --quiet omarchy-shell.service && omarchy-cmd-present quickshell; then - quickshell kill -p "$OMARCHY_PATH/shell" >/dev/null 2>&1 || true - quickshell kill -p "$OMARCHY_PATH/default/quickshell"/omarchy-shell >/dev/null 2>&1 || true -fi - -systemctl --user enable --now omarchy-shell.service || true +omarchy-restart-shell diff --git a/migrations/1779107651.sh b/migrations/1779107651.sh index 4f492f3e..f8b83016 100644 --- a/migrations/1779107651.sh +++ b/migrations/1779107651.sh @@ -1,13 +1,7 @@ echo "Move omarchy-shell to the top-level shell directory" -mkdir -p ~/.config/systemd/user -cp "$OMARCHY_PATH/config/systemd/user/omarchy-shell.service" ~/.config/systemd/user/omarchy-shell.service -systemctl --user daemon-reload - if omarchy-cmd-present quickshell; then quickshell kill -p "$OMARCHY_PATH/default/quickshell"/omarchy-shell >/dev/null 2>&1 || true fi -if systemctl --user is-enabled --quiet omarchy-shell.service || systemctl --user is-active --quiet omarchy-shell.service; then - systemctl --user restart omarchy-shell.service || true -fi +omarchy-restart-shell diff --git a/migrations/1779180647.sh b/migrations/1779180647.sh new file mode 100644 index 00000000..1d0ceefe --- /dev/null +++ b/migrations/1779180647.sh @@ -0,0 +1,7 @@ +echo "Remove the omarchy-shell user service" + +systemctl --user disable --now omarchy-shell.service >/dev/null 2>&1 || true +rm -f ~/.config/systemd/user/omarchy-shell.service +systemctl --user daemon-reload >/dev/null 2>&1 || true + +omarchy-restart-shell diff --git a/shell/README.md b/shell/README.md index 0f15a8a4..c1bf3bf3 100644 --- a/shell/README.md +++ b/shell/README.md @@ -1,10 +1,10 @@ # Omarchy shell `omarchy-shell` is a single long-running [Quickshell](https://quickshell.org/) -instance that hosts the Omarchy desktop. A supervised user systemd service -keeps one shell running per graphical session; everything else — the bar, -the bar settings UI, the background switcher, future panels and overlays — -runs **inside** the shell as a plugin. +instance that hosts the Omarchy desktop. Hyprland autostart launches one shell +per graphical session; everything else — the bar, the bar settings UI, the +background switcher, future panels and overlays — runs **inside** the shell as +a plugin. Hosting everything inside one shell means: @@ -119,13 +119,12 @@ Direct invocation: quickshell ipc -p $OMARCHY_PATH/shell call shell ping ``` -The `omarchy-shell.service` user unit starts the shell for the graphical -session and restarts it if it exits. Use `omarchy-restart-shell` to reload -the long-running shell process. +Hyprland autostart launches the shell directly with `quickshell -p +$OMARCHY_PATH/shell`. Use `omarchy-restart-shell` (`quickshell reload`) to +reload the long-running shell process. -A convenience wrapper, [`omarchy-shell`](../bin/omarchy-shell), -forwards IPC calls to the running service. It does not start the shell; the -systemd unit owns the shell lifecycle. +A convenience wrapper, [`omarchy-shell`](../bin/omarchy-shell), forwards IPC +calls to the running shell. It does not start the shell. ``` omarchy-shell shell ping