feat(triggershell): add Spotify app start command
Launches Spotify via systemd-run --user so it inherits the graphical session environment (the triggershell service starts before the Wayland session and lacks WAYLAND_DISPLAY/DISPLAY). Idempotent: no-op when spotify.service is already active. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LHvz6Nxkf9SU2EufjWZ3cG
This commit is contained in:
@@ -354,6 +354,30 @@ scripts:
|
||||
passAs: arg
|
||||
argName: --zone
|
||||
|
||||
- id: spotify-start
|
||||
name: "Spotify: Start App"
|
||||
description: >-
|
||||
Launch the Spotify desktop app on the local session. Does nothing if it is
|
||||
already running (Spotify focuses its existing window).
|
||||
command: bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
# triggershell.service starts before the graphical session, so its own
|
||||
# environment has no WAYLAND_DISPLAY/DISPLAY and a stripped-down PATH.
|
||||
# systemd-run --user launches Spotify from the user manager instead,
|
||||
# which does carry the full graphical environment.
|
||||
if systemctl --user --quiet is-active spotify.service; then
|
||||
echo "Spotify is already running."
|
||||
exit 0
|
||||
fi
|
||||
systemctl --user reset-failed spotify.service 2>/dev/null || true
|
||||
exec systemd-run --user --collect --quiet --unit=spotify spotify-launcher
|
||||
- spotify-start
|
||||
cwd: ./
|
||||
timeoutSeconds: 20
|
||||
variables: []
|
||||
|
||||
- id: system-shutdown
|
||||
name: "System: Shutdown"
|
||||
description: >-
|
||||
|
||||
Reference in New Issue
Block a user