Package: i3blocks-spotify-persist
i3blocks-spotify-persistA persistenti3blocksblocklet for the Spotify desktop app.Click the image above to watch ascreencast.Featuresnear-immediate updates thanks to the event-driven model: the blocket is a constantly running process receiving D-Bus signalsconfigurable outputconfigurable mouse click actions (i3blocksversion 1.5or later is required)InstallationPython version 3.5 or later is required.The blocket can be installed from PyPI usingpip:python3-mpipinstall[--user]i3blocks-spotify-persistOnce the package is installed, there will be a blocket script namedi3blocks-spotify-persistsomewhere depending on the presence of a--userpip flag (e.g.,/usr/local/bin/i3blocks-spotify-persistor~/.local/bin/i3blocks-spotify-persist).To avoid dependecy hell,pipxcan be used:pipxinstalli3blocks-spotify-persistIn this case the blocket script will be placed in~/.local/bindirectory.DependenciesRequired (installed automatically):PyGObjectdbus-pythonOptional (installed manually):Font Awesome(for status icons)UsageAdd the following lines to your i3blocks config:[spotify]
command=/path/to/bin/i3blocks-spotify-persist [-c /path/to/config.json]
interval=persistConfigurationThe blocket can be configured using a JSON config file. The config itself and all its options are optional.Config optionsformatType:stringDefault value:{status}: {artist} – {title}A template string with placeholders. Placeholder formats are{field}and{field:filter}.Supported fields:status, one ofenumvalues:Playing,Paused,StoppedartisttitleSupported fitlers:upper— converts a string to uppercaselower— converts a string to lowercasecapitalize— converts the first character of a string to uppercase and the rest to lowercaseicon— forstatusfield only: converts a textual status to an icon (see thestatus_iconsoption below)markup_escapeType:booleanDefault value:falseThis option specifies whether to escape special characters (such as<,>,&) using corresponding XML entities. Set totrueif Pango markup is used (markup=pangoin youri3blocksconfig),falseotherwise.status_iconsType:objectDefault value:{"Playing": "\uf04b", "Paused": "\uf04c", "Stopped": "\uf04d"}This option provides a mapping for theiconfilter (see above). The default value uses icons fromFont Awesome.mouse_buttonsType:objectDefault value:{"1": "PlayPause"}This option provides a mapping of X11 mouse buttons numbers toMPRIS methods. You can use thexevprogram to determine button numbers.dedupeType:booleanDefault value:trueFor some reason, the Spotify app emits several identical signals for one action/event (e.g., it producesfourPropertiesChangedsignals when a track is played or paused). If this option is settrue, the blocklet will compare the updated message with the previous one and print it only if it has changed. There is no reason to turn off deduplication except for debugging.Config example{"format":"<span font_family='monospace' color='#ffa651' weight='bold'>{status:icon} {status:upper}</span> <span color='#72bf44' weight='bold'>{artist}</span><span color='#ffa651'>᛫</span><span color='#b2d235'>{title}</span>","markup_escape":true,"status_icons":{"Playing":"|>","Paused":"||","Stopped":"[]"},"mouse_buttons":{"1":"PlayPause","9":"Previous","8":"Next"}}Command line arguments-h,--help— show all command line arguments and exit-c,--config— a path to the config file (see above)The following arguments override corresponding config options or defaults (that is, command line arguments have the highest precedence):--format--markup-escape/--no-markup-escape--dedupe/--no-dedupeLicenseTheMIT License.