Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSPWM not recognizing Spotify #291

Closed
Brett99 opened this issue Sep 29, 2015 · 30 comments
Closed

BSPWM not recognizing Spotify #291

Brett99 opened this issue Sep 29, 2015 · 30 comments

Comments

@Brett99
Copy link

Brett99 commented Sep 29, 2015

I'm trying to make a rule for Spotify, but it's not working. When I run 'bspc query -T', Spotify appears to have no name. Here's the output of bspc query -T:

HDMI3 1920x1080+0+0 50,0,0,0 *
    1 5 50 0,0,0,0 T - *
        V a 0.500000
            a Google-chrome Google-chrome 0x2000001 5 875x920+990+105 L --------
            H m 0.500000
                a URxvt urxvt 0x1200009 5 484x292+713+389 R -------- *
                V m 0.500000
                    m URxvt urxvt 0xE00009 5 484x292+713+389 R --------
                    m URxvt urxvt 0x1000009 5 484x292+713+389 R --------
    2 5 50 0,0,0,0 T -
        V m 0.500000
            m XFontSel xfontsel 0x1C0002A 5 574x181+668+444 R f------- *
            m   0x1600001 5 1810x920+55+105 R --------
    3 5 50 0,0,0,0 T -
    4 5 50 0,0,0,0 T -
    5 5 50 0,0,0,0 T -

Spotify is the line below XFontSel. It doesn't have a name, so I can't make a rule pertaining to it.

@Brett99
Copy link
Author

Brett99 commented Sep 29, 2015

I was able to make a rule that works with Spotify by using bspc rule -a "" fullscreen=on. Spotify's name is an empty string. Is this a BSPWM or Spotify issue?

@Brett99
Copy link
Author

Brett99 commented Sep 29, 2015

I think this is a BSPWM issue and not a Spotify issue because Spotify's name is recognized by xprop.

@baskerville
Copy link
Owner

What's the output of xprop?

@Brett99
Copy link
Author

Brett99 commented Sep 29, 2015

_NET_WM_ICON(CARDINAL) = 
WM_CLASS(STRING) = "spotify", "Spotify"
WM_NAME(STRING) = "Spotify"
_NET_WM_NAME(UTF8_STRING) = "Spotify"
XdndProxy(WINDOW): window id # 0x1400002
_NET_WM_DESKTOP(CARDINAL) = 4
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified location: 0, 0
        window gravity: Static
_NET_WM_PID(CARDINAL) = 5221
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "Server"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING

@baskerville
Copy link
Owner

What's the output of xlsw?

@Brett99
Copy link
Author

Brett99 commented Oct 3, 2015

0x0400001  ui-  NA           NA
0x0C00001  -io  Xautolock/xautolock  xautolock
0x0800003  u--  NA           xcompmgr
0x0E00001  u--  Google-chrome/google-chrome  google-chrome
0x0E00003  u--  Google-chrome/google-chrome  google-chrome
0x0E0001F  u--  Google-chrome/google-chrome  google-chrome
0x0E00022  u--  Google-chrome/google-chrome  google-chrome
0x1400001  u--  NA           NA
0x1600009  u--  URxvt/urxvt  brett@Server:~
0x1000075  u--  Google-chrome  Some glyphs don't work, some are tiny... don't know what to do. · Issue #889 · powerline/powerline - Google Chrome
0x2000001  u--  Spotify/spotify  Green Day - 21 Guns
0x100007B  u--  Google-chrome  How can I bind something to moving the scroll wheel left/right? · Issue #61 · baskerville/sxhkd - Google Chrome
0x1000001  ---  Google-chrome  baskerville/xlsw - Google Chrome
0x1800009  ---  URxvt/urxvt  brett@Server:~/Downloads/xlsw-master
0x1200004  u--  NA           NA
0x0E00030  u-o  NA           NA
0x1000046  ui-  NA           Chromium clipboard
0x0E0021E  u--  Google-chrome/google-chrome  google-chrome
0x1000078  u-o  NA           NA
0x100007C  u-o  NA           NA
0x1E00001  u--  Spotify/spotify  spotify
0x2A00001  u--  NA           NA
0x1000057  u-o  NA           NA
0x0400000  ui-  NA           bspwm

@baskerville
Copy link
Owner

Spotify sets its WM_CLASS too late. This property should exist when the map request is received.

@Froziph
Copy link

Froziph commented Jul 17, 2016

I get that Spotify should be the ones to fix this. But it worked before i updated bspwm (just did that today, haven't had time to create new configs before now). When it worked before, shouldn't it be fixable from bspwm's site? Any way to have a rule saying Spotify should spawn on a specific desktop? Some workaround?

@d630
Copy link

d630 commented Dec 9, 2016

@Froziph A workaround for spotify is to get the _NET_WM_PID via xprop and then to grep the command name. An example for external_rules_command:

#!/bin/sh

id="${1?}" \
instance="$3" \
class="$2";

case "$class" in
    (foo)
        bar;;
    ("")
        unset -v _NET_WM_PID;
        . /dev/fd/0 2>/dev/null <<IN
        : \"\${$(
            xprop \
                -id "$id" \
                -notype \
                -f _NET_WM_PID 32c '=$0' \
                _NET_WM_PID;
        )}\";
IN
        case "$(ps -p "${_NET_WM_PID:?}" -o comm= 2>/dev/null)" in
            (spotify)
                echo desktop=^5;;
        esac;;
esac;

@navxio
Copy link

navxio commented May 2, 2018

@d630 I'm facing the same problem, can you explain how to use your solution?

@d630
Copy link

d630 commented May 2, 2018

Hey. I have come up with a much simpler solution in the meantime. Have a look at https://github.com/D630/bin/blob/master/bspwm-rules, https://github.com/D630/etc-bspwm/blob/master/etc/bspwm/bspwmrc, and https://github.com/baskerville/xdo

@navxio
Copy link

navxio commented May 2, 2018

Thanks a ton @d630

@deadlysyn
Copy link

For posterity, this seems to be less spotify specific and more about electron apps in general? I have the same problem with slack from aur. Either way, @d630 's solution is a big help. 👍

eliasnorrby added a commit to eliasnorrby/dotfiles that referenced this issue Nov 26, 2020
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.
eliasnorrby added a commit to eliasnorrby/dotfiles that referenced this issue Nov 26, 2020
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.
@exynil
Copy link

exynil commented Dec 14, 2020

external_rules.sh

#!/bin/sh

wid=$1
class=$2
instance=$3
consequences=$4

main() {
	case "$class" in
		firefox)
			if [ "$instance" = "Toolkit" ]; then
				echo "state=floating sticky=on"
			fi
			;;
		Spotify)
			echo "desktop=3"
			;;
		"")
                        sleep 0.5

			wm_class=($(xprop -id $wid | grep "WM_CLASS" | grep -Po '"\K[^,"]+'))

			class=${wm_class[-1]}

			[[ ${#wm_class[@]} == "2" ]] && instance=${wm_class[0]}

			[[ -n "$class" ]] && main
			;;
	esac
}

main

@maniac-en
Copy link

maniac-en commented Jan 7, 2021

Hey, @exynil @d630 Even I'm facing the same issue of not able to add a rule for spotify! You both have mentioned a bash shell script to handle the issue but I'm actually unaware of how to actually implement your solution.

Do I simply call the script in bspwmrc or do I need to do something else about it?

@exynil
Copy link

exynil commented Jan 7, 2021

Hi @maniac-en, Sorry for my English.

You need to use external rules in bspwmrc

bspc config external_rules_command "$HOME/bin/bspwm-external-rules"
bspwm-external-rules must be an executable file

You can look at my dotfiles

@maniac-en
Copy link

Hey @exynil Thanks for your reply!
I tried your solution, it almost works for me as I wanted to put my spotify on desktop 5 but it doesn't take me there! Here's what I'm using from your script: spotify.sh

Do you know what might be the issue?

@exynil
Copy link

exynil commented Jan 7, 2021

@maniac-en
Your code works for me. There is a delay in the script sleep 0.5. I did it because my window class data appears after some time.
You may have a very fast or slow system. Try increasing this delay number, for example, to a second and see if it helps.

In fact, this is not a very good way (to rely on latency), but it turns out that data on the window class appears in the system some time after the program starts. I haven't found another way to quickly get the window class data yet.

P.s. I have a poor level of English, I hope I didn't make any mistakes.

@exynil
Copy link

exynil commented Jan 7, 2021

@maniac-en
What do you mean by "almost works"? Spotify expands to full screen, but just doesn't go to 5 workspace? Can you show me your last bspwmrc and spotify.sh (external-rules)

@maniac-en
Copy link

Your English is completely fine, don't worry about that!
I get how you're fetching the class based on delay! But the thing is other rules for spotify are working in my case except going to Desktop 5.

I say almost because out of all the rules I supplied in spotify.sh , going to Desktop 5 is not working!

I tried changing the delay to 1, 1.5, 2, and even removing it, but no luck!

Here's my bspwmrc which has the external rule for spotify!

@exynil
Copy link

exynil commented Jan 7, 2021

@maniac-en
I think I understand what your mistake is.
Your desktop names are referred to as:

bspc monitor -d I II III IV V VI VII VIII IX X

when creating rules, you should rely on these names.

echo "state=fullscreen desktop=V follow=on"

Hope this helps you!

@maniac-en
Copy link

@exynil
Oh ya that was it! Everything works now.
I just shifted to using BSPWM and therefore I was using the config provided in /usr/share/doc/bspwm/examples/bspwmrc.

Thankyou so much for help!

@exynil
Copy link

exynil commented Jan 7, 2021

@maniac-en You’re welcome

@ghost
Copy link

ghost commented Jan 16, 2021

Alright so spotify has been a mother to work with the bspwm rules but I managed to find a workaround.

  1. Fixing spotify going to the right workspace on startup:

At the top of my bspwmrc I launch polybar then I have a few programs I want to start one of them being spotify:
spotify &

Then I put this command:
wmctrl -r Spotify -t 6

This pretty much says "Take spotify and put it in the 6th workspace (Starting the count from 0, so really the 7th workspace)

You can replace the 6 with whatever workspace you want spotify to go to.

  1. Fixing the spotify rule

I just used @d630 script he posted in 2016 and put this on my bspwmrc.
bspc config external_rules_command "$HOME/.config/bspwm/scripts/spotify.sh"

And now my spotify goes to its assigned workspace at startup and if for whatever reason I close it during the session, if I reopen it it's going to to the assigned workspace.

Phew...

github-actions bot pushed a commit to eliasnorrby/dotfiles that referenced this issue Mar 25, 2021
# [4.0.0](v3.0.0...v4.0.0) (2021-03-25)

### Bug Fixes

* **arch:** remove opacity digits from xresources ([82fa1b0](82fa1b0)), closes [#dd292d3](https://github.com/eliasnorrby/dotfiles/issues/dd292d3)
* **arch:** use correct package for xinput ([c63c076](c63c076))
* **bspwm:** update class used for tmux rule ([a4bd3a3](a4bd3a3))
* **fzf:** change binding for sort toggle ([2f0e0d0](2f0e0d0))
* **fzf:** do not use sudo for yay ([3bfab25](3bfab25))
* **fzf:** fix fuzzy args on MacOS ([5a8f1a1](5a8f1a1))
* **fzf:** source keybindings depending on os ([b3be4c1](b3be4c1))
* **gcloud:** eliminate subshells from env.zsh ([ae66e51](ae66e51))
* **git:** add main to gbpurge exclusion ([55d0b79](55d0b79))
* **intellij:** disable easymotion ([df4830f](df4830f))
* **intellij:** fix windowing on arch ([d497130](d497130))
* **java:** call java version alias separately ([c3b8549](c3b8549))
* **java:** move java aliases to macos block ([ba17866](ba17866))
* **provision:** add check to aur package install ([43efba3](43efba3))
* **provision:** add missing gcloud key root configs ([b5999b3](b5999b3))
* **provision:** fix mktemp spelling ([ac9d1e4](ac9d1e4))
* **provision:** remove do_defaults from setup-linux ([7a14498](7a14498))
* **provision:** set npm prefix in extra-packages ([a329819](a329819))
* **provision:** use coc-nvim's flags on extension install ([076affe](076affe))
* **provision:** use new cask upgrade command ([bc78304](bc78304))
* **scripts:** juggle find arguments ([66350b0](66350b0))
* **ssh:** add macos config file ([ab78e6e](ab78e6e))
* **tmux:** remove load average symbol ([f498251](f498251))
* **vim:** update coc eslint config key ([0d55559](0d55559))
* **work:** patch vpn settings for macos ([8080b21](8080b21))
* **xkb:** add shebang to setup-keybindings.sh ([c2021c9](c2021c9))
* **xkb:** kill xcape before calling ([607cb94](607cb94))

### Features

* **alacritty:** add glyph offsets on arch ([a82c501](a82c501))
* **alacritty:** bind paste ([9b68142](9b68142))
* **alacritty:** create tmux_alacritty wrapper ([622c9f1](622c9f1))
* **alacritty:** make theme setter work on all platforms ([c0ade4a](c0ade4a))
* **alacritty:** make use of alacritty config imports ([6e1dc93](6e1dc93)), closes [#38](#38)
* **alacritty:** use ~ for config imports ([31dad08](31dad08)), closes [#38](#38)
* **alacritty:** use a brighter bright black ([0a09db3](0a09db3))
* **alacritty:** use mononoki font ([aa384ca](aa384ca))
* **arch:** add additional keyserver ([2d5e09c](2d5e09c))
* **arch:** add focus_or_run script ([eec2ca1](eec2ca1))
* **arch:** add Xresources ([68358be](68358be))
* **arch:** set mouse sensitivity with xinput ([c805c91](c805c91))
* **bspwm:** launch dunst on startup ([f0736d1](f0736d1))
* **bspwm:** open chrome on desktop 6 ([f1015f6](f1015f6))
* **bspwm:** set active color to cyan ([3e04baa](3e04baa))
* **cli:** conditionally link different boomrcs ([8a6c3b1](8a6c3b1))
* **dunst:** add topic config ([b6ce8de](b6ce8de))
* **dunst:** rewrite default config ([b7a8468](b7a8468))
* **feh:** create topic config ([6cfba4d](6cfba4d))
* **fzf:** add pf alias for fuzzy pacman search ([b91bb02](b91bb02))
* **fzf:** enlarge pacman preview window ([71f4043](71f4043))
* **fzf:** filter chromium's history ([941a8fe](941a8fe))
* **fzf:** remove file path completion binding ([1ca4f5c](1ca4f5c))
* **fzf:** source completion ([9afad20](9afad20))
* **picom:** add background blurring ([86a6a3d](86a6a3d))
* **picom:** add shadows ([36a78c7](36a78c7))
* **picom:** enable vsync ([7871c05](7871c05))
* **picom:** experiment with fading ([59a950a](59a950a))
* **picom:** run with --experimental-backends ([d6127a3](d6127a3))
* **picom:** slightly reduce alacritty transparency ([e3fac8a](e3fac8a))
* **picom:** use the glx backend ([5fa0c24](5fa0c24))
* **polybar:** hide polybar in bspwm fullscreen ([545e44a](545e44a))
* **polybar:** modify example config ([95f51db](95f51db))
* **polybar:** update module icons ([a6b999a](a6b999a))
* **provision:** add optional condition to links ([2c8f15f](2c8f15f))
* **provision:** add rename option to topic links ([742657a](742657a))
* **provision:** become for pacman ([4934760](4934760))
* **provision:** install ansible roles in post ([a8d9d8c](a8d9d8c))
* **provision:** install aur packages ([c9cae53](c9cae53))
* **rofi:** add topic config ([1fe4167](1fe4167))
* **rofi:** launch rofi with super + space ([5085388](5085388))
* **rofi:** use dank mono font ([7c06945](7c06945))
* **sxhkd:** focus or run alacritty ([e2e6d21](e2e6d21))
* **sxhkd:** focus or run chromium ([040ff9c](040ff9c))
* **sxhkd:** map hyper + {1-9} to tmux windows ([254af0f](254af0f))
* **tmux:** choose copy tool based on platform ([91a4d50](91a4d50))
* **vim:** make cursorline light blue ([d0560cb](d0560cb))
* **vim:** use unnamedplus for clipboard ([5cd5c30](5cd5c30))
* **vscode:** conditionally set vscode_home ([93cae5f](93cae5f))
* **xkb:** add topic config ([cfa6b7f](cfa6b7f))
* **xkb:** map right alt to hyper key (mod3) ([0c41084](0c41084))
* **zsh:** remove '/' from WORDCHARS ([4b95c63](4b95c63))
* add become key to topic config ([798738f](798738f))
* **alacritty:** use some transparency ([7e42ee5](7e42ee5))
* **arch:** add and autostart dropbox ([659dcd9](659dcd9))
* **arch:** add topic base/arch ([ae6be72](ae6be72))
* **arch:** add topic config ([e191329](e191329))
* **arch:** create wrapper script for spotify ([05faf26](05faf26)), closes [/github.com/baskerville/bspwm/issues/291#issuecomment-145329416](https://github.com//github.com/baskerville/bspwm/issues/291/issues/issuecomment-145329416)
* **arch:** enable kafka topic ([c213e5d](c213e5d))
* **arch:** handle focus of withdrawn windows ([afe0962](afe0962))
* **arch:** improve focus_or_run.sh ([0546b90](0546b90))
* **arch:** make aur buider a system user ([ec28d99](ec28d99))
* **bspm:** remove example config defaults ([796b3c4](796b3c4))
* **bspwm:** add 1password desktop rule ([689eac8](689eac8))
* **bspwm:** add checks for dependencies ([47ed18e](47ed18e))
* **bspwm:** add desktop rule for slack ([2eed97a](2eed97a))
* **bspwm:** add intellij desktop rule ([0b0b33e](0b0b33e))
* **bspwm:** add topic config ([07f76be](07f76be))
* **bspwm:** add topic wm/bspwm ([f8a6c2b](f8a6c2b))
* **bspwm:** make use of multiple monitors ([f8126d4](f8126d4))
* **bspwm:** reduce window gap to 10 ([d66c0f5](d66c0f5))
* **bspwm:** update for triple monitor setup ([16d0cfd](16d0cfd))
* **bspwm:** update window rules ([d2a125b](d2a125b))
* **bspwmrc:** configure monitors with xrandr ([01b1ab2](01b1ab2))
* **dotnet:** add lang/dotnet topic ([4decabc](4decabc))
* **dunst:** only show notifications on main monitor ([9db7f7b](9db7f7b))
* **emacs:** set font based on _os ([c1fa2b0](c1fa2b0))
* **fzf:** add fuzzy argument selection ([ebd53b7](ebd53b7))
* **gcloud:** source path and completion ([4568545](4568545))
* **git:** add gl and glnr aliases ([1f83273](1f83273))
* **git:** add gprd function ([641cf78](641cf78))
* **git:** add grv alias ([801f574](801f574))
* **hammerspoon:** add rider app mapping ([72ecb57](72ecb57))
* **hammerspoon:** add umlauts to app mode ([b7c2c04](b7c2c04))
* **intellij:** add compile project mapping ([b654e0c](b654e0c))
* **intellij:** add go mapping for file outline ([bfcde52](bfcde52))
* **intellij:** add hide coverage mapping ([9d74f44](9d74f44))
* **intellij:** add keybinds for navigating changes ([22aae08](22aae08))
* **intellij:** add mapping to create class ([d5fdf21](d5fdf21))
* **intellij:** add mapping to insert semicolon ([bc0e519](bc0e519))
* **intellij:** add mappings for hippie completion ([b651f3f](b651f3f))
* **intellij:** default to no line numbers ([f925564](f925564))
* **intellij:** harmonize ]d / ]e mappings ([66ba046](66ba046))
* **intellij:** map double space to GotoFile ([dd77421](dd77421))
* **intellij:** refine line number toggles ([6adb51f](6adb51f))
* **intellij:** revamp window closing mappings ([c4272d3](c4272d3))
* **intellij:** sort sections alphabetically ([16acda6](16acda6))
* **intellij:** switch to intellij ultimate ([7136da5](7136da5))
* **intellij:** try to mimic unimpaired's ]<space> ([350c5be](350c5be))
* **java:** rework JAVA_HOME env ([6de7264](6de7264))
* **kubernetes:** add aliases.zsh ([c87e801](c87e801))
* **macos:** add balenaetcher ([c350b2e](c350b2e))
* **macos:** enable kafka topic ([19b6660](19b6660))
* **node:** add npm to pacman_packages ([9e643fe](9e643fe))
* **node:** create a dir for global npm packages ([e80888d](e80888d))
* **picom:** add topic config ([1073b6a](1073b6a))
* **picom:** launch picom on login ([ebbec14](ebbec14))
* **picom:** make emacs transparent ([a9280bd](a9280bd))
* **polybar:** add alsa module ([4a79612](4a79612))
* **polybar:** add suspend to power menu ([c1ccbd9](c1ccbd9))
* **polybar:** add topic config ([1371137](1371137))
* **polybar:** add topic panel/polybar ([b972739](b972739))
* **polybar:** add vpn modules ([ef3f6c7](ef3f6c7))
* **polybar:** blacklist num lock indicator ([1a8b444](1a8b444))
* **polybar:** hide the tray ([88fead9](88fead9))
* **polybar:** join vpn modules ([bbd34ad](bbd34ad))
* **polybar:** try to make tray behave ([83657d1](83657d1))
* **polybar:** use desktop %name% for labels ([cc48586](cc48586))
* **polybar:** use mononoki font ([14ab7a2](14ab7a2))
* **polybar:** use systemctl poweroff ([ff7634e](ff7634e))
* **provision:** add custom setup script for linux ([15230d6](15230d6))
* **provision:** add platform check to update-all ([6090cea](6090cea))
* **provision:** add support for pacman packages ([4538dfc](4538dfc))
* **provision:** check for executables in post-install ([1be0e93](1be0e93))
* **provision:** create ssh config dirs ([cd75749](cd75749))
* **provision:** ensure list of dirs exist ([80b82c8](80b82c8))
* **provision:** install coc extensions in post ([c3a4aa6](c3a4aa6))
* **provision:** make setup-linux executable ([d3ee543](d3ee543))
* **scripts:** add update-remote.sh ([80823a1](80823a1))
* **scripts:** add work to git changes dirs ([e4fc645](e4fc645))
* **shell:** remove newline from _os helper ([a031eab](a031eab))
* **ssh:** add topic config ([b57b658](b57b658))
* **ssh:** include configs in config.d ([10e6e1a](10e6e1a))
* **ssh:** remove lifetime of unlocked keys ([af79d33](af79d33))
* **ssh:** use keychain ([8ce01b6](8ce01b6))
* **sxhkd:** add 1password keybind ([46b64a1](46b64a1))
* **sxhkd:** add binding to launch konsole ([641c5e3](641c5e3))
* **sxhkd:** add intellij keybind ([42a2e19](42a2e19))
* **sxhkd:** add slack keybind ([c370db2](c370db2))
* **sxhkd:** add topic config ([f76c89b](f76c89b))
* **sxhkd:** add topic keyboard/sxhkd ([e8f6602](e8f6602))
* **sxhkd:** add wallpaper swap keybind ([5b391bf](5b391bf))
* **sxhkd:** launch emacs with hyper + s ([347d84d](347d84d))
* **sxhkd:** launch ranger with hyper + r ([b74fc27](b74fc27))
* **sxhkd:** launch spotify with hyper + u ([6dd0847](6dd0847))
* **sxhkd:** quit apps with super + q ([7ac3118](7ac3118))
* **sxhkd:** use super + p to pin window ([2c47aa1](2c47aa1))
* **tmux:** add binding to highlight last link ([d4de5ba](d4de5ba))
* **tmux:** add scratch and dotfiles bindings ([6906b40](6906b40))
* **tmux:** add session list to status and keybinds ([ff3518a](ff3518a))
* **tmux:** disable active pane highlighting ([46d2999](46d2999))
* **tmux:** do not use session id for switching ([e4ba48a](e4ba48a))
* **tmux:** move session prompt to keybind ([8668943](8668943))
* **tmux:** relocate status elements ([0477fe6](0477fe6))
* **tmux:** skip the initial rename session prompt ([8fdbf62](8fdbf62))
* **vim:** add coc-groovy to coc-extensions ([4a3d3a3](4a3d3a3))
* **vim:** add CursorColumn highlight ([b172cb0](b172cb0))
* **vim:** add keybind to search project for selection ([dc90052](dc90052))
* **vim:** add keybind to toggle diff of windows ([af16609](af16609))
* **vim:** add scrollbind toggle ([4142c57](4142c57))
* **vim:** add tabular plugin ([ef9bb8e](ef9bb8e))
* **vim:** add vlog alias ([a82daa6](a82daa6))
* **vim:** brighten fzf's border ([8f53e36](8f53e36))
* **vim:** disable double cmdheight ([b479208](b479208))
* **vim:** enable coc-explorer file icons ([300c608](300c608))
* **vim:** map leader , to :History ([856ef05](856ef05))
* **vim:** update project-wide search functions ([9cef954](9cef954)), closes [/github.com/junegunn/fzf/issues/1109#issuecomment-339983902](https://github.com//github.com/junegunn/fzf/issues/1109/issues/issuecomment-339983902) [/github.com/junegunn/fzf.vim/issues/346#issuecomment-288483704](https://github.com//github.com/junegunn/fzf.vim/issues/346/issues/issuecomment-288483704)
* **vim:** use editorconfig for shfmt settings ([67f34a6](67f34a6)), closes [#32](#32)
* **vim:** use standard tabline ([f0bf112](f0bf112))
* **work:** add base/work topic ([41adbdd](41adbdd))
* **work:** add vpn connection scripts ([a7d9c89](a7d9c89))
* **work:** add vpn_disconnect and provision sudo ([00ff1d0](00ff1d0))
* **zsh:** add chx and ns aliases ([5c754cb](5c754cb))
* **zsh:** add fuzzy ascii art font picker ([90525d6](90525d6))
* **zsh:** add sudoedit alias ([d74e781](d74e781))
* **zsh:** only attach to tmux on macos ([e38eaac](e38eaac))
* **zsh:** only use gls on macos ([2f5969a](2f5969a))
* **zsh:** remove . from WORDCHARS ([53ee31a](53ee31a))
* **zsh:** remove line numbers from fzf preview ([a4754c9](a4754c9))
* **zsh:** start ssh-agent on launch ([8181d45](8181d45))
* **zsh:** switch yq implementation on arch ([438f929](438f929))
* add linux.config.yml ([c891af2](c891af2))
* add pacman_packages to topics ([069ae0c](069ae0c))

* refactor!: rename root.config.yml ([c9cead7](c9cead7))

### BREAKING CHANGES

* Instead of a singular root.config.yml, use
<os>.config.yml's. This will force an update to the CLI.
nnorakk added a commit to nnorakk/dotfiles that referenced this issue Apr 19, 2021
A principal motivacao aqui foi resolver o problema do aplicativo snap
Spotify que nao responde a rules simples do bspwm.

Principal referencia sobre o problema: baskerville/bspwm#291
nnorakk added a commit to nnorakk/dotfiles that referenced this issue May 12, 2021
A principal motivacao aqui foi resolver o problema do aplicativo snap
Spotify que nao responde a rules simples do bspwm.

Principal referencia sobre o problema: baskerville/bspwm#291
fluxth added a commit to fluxth/dotfiles that referenced this issue Aug 15, 2021
However, the bspwm rule to bind Spotify window class to av workspace doesn't
work just yet. The main reason being that the spotify X window sets the
WindowClass too late, making bspwm doesn't pick it up and assign it to
the correct workspace.

More info here: baskerville/bspwm#291
fluxth added a commit to fluxth/dotfiles that referenced this issue Aug 16, 2021
However, the bspwm rule to bind Spotify window class to av workspace doesn't
work just yet. The main reason being that the spotify X window sets the
WindowClass too late, making bspwm to not recognize it and assign it to
the correct workspace.

More info here: baskerville/bspwm#291
@p0ryae
Copy link

p0ryae commented Dec 17, 2021

I can fully confirm @lyonelz96 's solution and @d630 's script still work till this day.

@d630 's script lack focus and follow so when you open the window, it doesn't switch workspace.

To add that feature, simply add follow=on and focus=on after echo desktop=^5
So it looks like this:

echo desktop=^5 follow=on focus=on;;

Instead of

echo desktop=^5;;

@BlueInt32
Copy link

A little note to anyone struggling to make @d630's script work: do not forget to add execution permissions to the bspwm-rules file. I have been stuck on this for like an hour... 😏

@vaygr
Copy link

vaygr commented Jul 29, 2022

My problem with external rules is that on every window launch the script is going to be executed, which seems much heavier on resources. I ended up writing a devilspie2 rule after taking a look at dasJ/spotifywm#8:

-- Move spotify to the designated desktop
local spotify_desktop = 5

if (get_application_name() == "Untitled window" and get_window_name() == "Untitled window") then
  if get_process_name() == "spotify" then set_window_workspace(spotify_desktop) end
end

@PolGZ
Copy link

PolGZ commented Sep 3, 2022

Neither of the two solutions offered by @d630 nor @exynil seem to work for me. Even copy-pasting d630 config files from his second reply.

I have bspc config external_rules_command "$HOME/.config/bspwm/scripts/external_rules.sh" on my bspwmrc and the external_rules.sh script has execute permissions. Any idea what should I test?

I also tried changing the desktop=5 to desktop=V, since I have them named like that, as pointed by exynil to @maniac-en.

I am using Debian stable + spotify flatpak. Could it be because of being a flatpak?

@exynil
Copy link

exynil commented Sep 4, 2022

Hello @PolGZ . I checked my solution is still working. If you still haven't solved the problem. Send me your bspwmrc and bspwmrc_extarnal_rules.sh file.

@bo1929
Copy link

bo1929 commented May 6, 2023

They have finally fixed this. The latest version of the Spotify client now sets everything on time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests