Added the plugin spotify-tui

This commit is contained in:
Janno Tjarks 2022-02-11 17:38:01 +01:00
parent a966029b99
commit fb043e3ac2
3 changed files with 30 additions and 0 deletions

View file

@ -29,6 +29,7 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul
* When prefix is enabled smiley face turns from green to yellow * When prefix is enabled smiley face turns from green to yellow
* When charging, 'AC' is displayed * When charging, 'AC' is displayed
* If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature * If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature
* Spotify playback (needs the tool spotify-tui installed)
## Compatibility ## Compatibility

View file

@ -168,6 +168,11 @@ main()
script="#($current_dir/network_ping.sh)" script="#($current_dir/network_ping.sh)"
fi fi
if [ $plugin = "spotify-tui" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-spotify-tui-colors" "green dark_gray")
script="#($current_dir/spotify-tui.sh)"
fi
if [ $plugin = "weather" ]; then if [ $plugin = "weather" ]; then
# wait unit $datafile exists just to avoid errors # wait unit $datafile exists just to avoid errors
# this should almost never need to wait unless something unexpected occurs # this should almost never need to wait unless something unexpected occurs

24
scripts/spotify-tui.sh Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $current_dir/utils.sh
main()
{
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
if ! command -v spt &> /dev/null
then
exit 1
fi
spotify_playback=$(spt playback)
echo ${spotify_playback}
}
# run the main driver
main