Skip to content

Commit

Permalink
feat(arch): create wrapper script for spotify
Browse files Browse the repository at this point in the history
Spotify will not follow rules set by bspc, because WM_CLASS is not set
at the right time:

baskerville/bspwm#291 (comment)

As a workaround, navigate to the desired workspace before launching it.
  • Loading branch information
eliasnorrby committed Nov 26, 2020
1 parent d2a125b commit 05faf26
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions base/arch/run_spotify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

DESKTOP=${1:-7}
bspc desktop --focus "^$DESKTOP"
spotify
3 changes: 3 additions & 0 deletions base/arch/topic.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ arch_config:
- src: focus_or_run.sh
dest: "{{ xdg_bin_home }}/"
rename: focus_or_run
- src: run_spotify.sh
dest: "{{ xdg_bin_home }}/"
rename: run_spotify
- src: gpg.conf
dest: ~/.gnupg/
- autostart.sh
Expand Down
2 changes: 1 addition & 1 deletion keyboard/sxhkd/sxhkdrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ hyper + shift + t
focus_or_run alacritty

hyper + u
focus_or_run spotify
focus_or_run run_spotify spotify

hyper + s
focus_or_run emacs
Expand Down
5 changes: 5 additions & 0 deletions wm/bspwm/bspwmrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ bspc rule -a Emacs desktop='^4' state=fullscreen follow=on
bspc rule -a Chromium desktop='^6'
bspc rule -a TmuxAlacritty desktop='^5' follow=on

# This won't work - see:
# https://github.com/baskerville/bspwm/issues/291#issuecomment-145329416
bspc rule -a spotify desktop='^7'
# Check base/arch/run_spotify.sh for a workaround

_run_if_present () {
case $1 in
"/"*) script="$1" ;;
Expand Down

0 comments on commit 05faf26

Please sign in to comment.