diff --git a/bin/omarchy-install-service-spotify b/bin/omarchy-install-service-spotify new file mode 100755 index 00000000..beae9939 --- /dev/null +++ b/bin/omarchy-install-service-spotify @@ -0,0 +1,15 @@ +#!/bin/bash + +# omarchy:summary=Install Spotify. +# omarchy:requires-sudo=true + +set -e + +echo "Installing Spotify..." +omarchy-pkg-add spotify + +echo "Opening Spotify..." +setsid uwsm-app -- /usr/bin/spotify >/dev/null 2>&1 & + +echo "" +echo "Spotify has been installed." diff --git a/bin/omarchy-launch-spotify b/bin/omarchy-launch-spotify new file mode 100755 index 00000000..d94202a3 --- /dev/null +++ b/bin/omarchy-launch-spotify @@ -0,0 +1,15 @@ +#!/bin/bash + +# omarchy:summary=Launch Spotify or start its installer when missing. + +set -e + +WINDOW_ADDRESS=$(hyprctl clients -j | jq -r '.[]|select((.class|test("\\bspotify\\b";"i")) or (.title|test("\\bspotify\\b";"i")))|.address' | head -n1) + +if [[ -n $WINDOW_ADDRESS ]]; then + hyprctl dispatch "hl.dsp.focus({ window = \"address:$WINDOW_ADDRESS\" })" >/dev/null 2>&1 || hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS" +elif [[ -x /usr/bin/spotify ]]; then + exec setsid uwsm-app -- /usr/bin/spotify +else + exec omarchy-launch-floating-terminal-with-presentation omarchy-install-service-spotify +fi diff --git a/bin/omarchy-remove-service-spotify b/bin/omarchy-remove-service-spotify new file mode 100755 index 00000000..d503bc86 --- /dev/null +++ b/bin/omarchy-remove-service-spotify @@ -0,0 +1,9 @@ +#!/bin/bash + +# omarchy:summary=Remove Spotify. +# omarchy:requires-sudo=true + +omarchy-pkg-drop spotify + +echo "" +echo "Spotify has been removed." diff --git a/config/hypr/bindings.lua b/config/hypr/bindings.lua index f455357e..b0c94dbd 100644 --- a/config/hypr/bindings.lua +++ b/config/hypr/bindings.lua @@ -6,7 +6,7 @@ o.bind("SUPER + SHIFT + F", "File manager", { omarchy = "nautilus" }) o.bind("SUPER + ALT + SHIFT + F", "File manager (cwd)", { omarchy = "nautilus-cwd" }) o.bind("SUPER + SHIFT + B", "Browser", { omarchy = "browser" }) o.bind("SUPER + SHIFT + ALT + B", "Browser (private)", { omarchy = "browser --private" }) -o.bind("SUPER + SHIFT + M", "Music", { omarchy = "or-focus spotify" }) +o.bind("SUPER + SHIFT + M", "Music", { omarchy = "spotify" }) o.bind("SUPER + SHIFT + ALT + M", "Music TUI", { tui = "cliamp", focus = true }) o.bind("SUPER + SHIFT + N", "Editor", { omarchy = "editor" }) o.bind("SUPER + SHIFT + D", "Docker", { tui = "lazydocker" }) diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 146361b4..b8af0dce 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -172,6 +172,7 @@ "install.browser.zen": {"icon":"󰖟","label":"Zen","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser zen'"}, "install.service.1password": {"icon":"󰢁","label":"1Password","keywords":"password","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-1password"}, "install.service.dropbox": {"icon":"","label":"Dropbox","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-dropbox"}, + "install.service.spotify": {"icon":"󰓇","label":"Spotify","keywords":"music","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-spotify"}, "install.service.tailscale": {"icon":"","label":"Tailscale","keywords":"vpn","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-tailscale"}, "install.service.nordvpn": {"icon":"󱇱","label":"NordVPN [AUR]","keywords":"vpn","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-nordvpn"}, "install.service.once": {"icon":"󰏖","label":"ONCE","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-once"}, diff --git a/install/omarchy-base.packages b/install/omarchy-base.packages index 8151cdda..a0c29299 100644 --- a/install/omarchy-base.packages +++ b/install/omarchy-base.packages @@ -108,7 +108,6 @@ satty sddm signal-desktop slurp -spotify socat starship sushi