mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
22 lines
594 B
Bash
Executable File
22 lines
594 B
Bash
Executable File
#!/bin/bash
|
|
|
|
pkill elephant
|
|
pkill walker
|
|
|
|
# Detect if we're running as root (from pacman hook)
|
|
if [[ $EUID -eq 0 ]]; then
|
|
# Get the owner of this script to determine which user to run as
|
|
SCRIPT_OWNER=$(stat -c '%U' "$0")
|
|
USER_UID=$(id -u "$SCRIPT_OWNER")
|
|
|
|
# Restart services as the script owner
|
|
systemd-run --uid="$SCRIPT_OWNER" --setenv=XDG_RUNTIME_DIR="/run/user/$USER_UID" \
|
|
bash -c "
|
|
setsid uwsm-app -- elephant &
|
|
setsid uwsm-app -- walker --gapplication-service &
|
|
"
|
|
else
|
|
setsid uwsm-app -- elephant &
|
|
setsid uwsm-app -- walker --gapplication-service &
|
|
fi
|