Created
August 2, 2021 07:38
-
-
Save KokoseiJ/c5802d15dd1ad02dacb772eade312021 to your computer and use it in GitHub Desktop.
Toggle fullscreen on Spotify in Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xwininfo -root -tree | grep '("spotify" "Spotify")' | grep -oE '(0x[0-9a-z]{7,8})' | xargs -I % wmctrl -i -r % -b toggle,fullscreen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works by getting info about every windows using
xwininfo
, get spotify's one by searching ("spotify" "Spotify"), grab Window ID using that regex which matches hexadecimal with length of 7~8, and toggle the fullscreen using wmctrl.Only tested on Fedora Cinnamon, but it should work on other systems. if it doesn't, please report with your output of following command:
xwininfo -root -tree | grep 'spotify'
Suggestions and fixes are welcome, if there's one.