├── .github └── stale.yml ├── LICENSE.md ├── README.md ├── get_spotify_status.sh ├── screenshots ├── demo.gif └── demo_mini.gif └── scroll_spotify_status.sh /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 15 3 | 4 | # Number of days of inactivity before a stale issue is closed 5 | daysUntilClose: 15 6 | 7 | # Issues with these labels will never be considered stale 8 | exemptLabels: 9 | - "Big Picture" 10 | - "TODO" 11 | 12 | # Label to use when marking an issue as stale 13 | staleLabel: stale 14 | 15 | # Comment to post when marking an issue as stale. Set to `false` to disable 16 | markComment: > 17 | This issue has been automatically marked as stale because it has not had 18 | recent activity. It will be closed if no further activity occurs. Thank you 19 | for your contributions. 20 | 21 | # Comment to post when closing a stale issue. Set to `false` to disable 22 | closeComment: false 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Prayag Savsani 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # polybar-spotify 2 | 3 | This polybar module shows details regarding the currently playing song on Spotify. The unique feature of this module is that the text displayed is constantly scrolled to save space on the bar. This is something that is not found in other spotify modules I came across. Also, this module uses [playerctl](https://github.com/altdesktop/playerctl) to do all the work and hence, no >100 line scripts which do all the work themselves. Only one line to fetch the required metadata in the format that you like and another line to scroll the fetched text using [zscroll](https://github.com/noctuid/zscroll). 4 | 5 | ![](screenshots/demo_mini.gif) 6 | ![](screenshots/demo.gif) 7 | 8 | ## Dependencies 9 | 10 | - [playerctl](https://github.com/altdesktop/playerctl#installing) - To interface with Spotify and other MPRIS supporting players 11 | - [zscroll](https://github.com/noctuid/zscroll#installation) - To scroll the fetched text 12 | 13 | ## Setup 14 | 15 | - Make sure to go through and edit the required variables in [get_spotify_status.sh](get_spotify_status.sh) as shown below. Especially the `PARENT_BAR` one as without its correct value, toggling the play-pause symbol wouldn't work. 16 | ```sh 17 | # The name of polybar bar which houses the main spotify module and the control modules. 18 | PARENT_BAR="now-playing" 19 | 20 | # Set the source audio player here. 21 | # Players supporting the MPRIS spec are supported. 22 | # Examples: spotify, vlc, chrome, mpv and others. 23 | # Use `playerctld` to detect the latest player. 24 | # See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control 25 | PLAYER="playerctld" 26 | 27 | # Format of the information displayed 28 | # Eg. {{ artist }} - {{ album }} - {{ title }} 29 | # See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata 30 | FORMAT="{{ title }} - {{ artist }}" 31 | ``` 32 | - Add the following in your polybar config. 33 | Make sure to place the desired symbols for each module. You can get them from like [Font Awesome](https://fontawesome.com/cheatsheet) or [Nerd Fonts](https://www.nerdfonts.com/cheat-sheet). 34 | ```ini 35 | [module/spotify] 36 | type = custom/script 37 | tail = true 38 | interval = 1 39 | ; prefix symbol is shown before the text 40 | format-prefix = "" 41 | format =