diff --git a/README.md b/README.md index 22e06bf..a6536d0 100644 --- a/README.md +++ b/README.md @@ -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 charging, 'AC' is displayed - 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) - Current kubernetes context ## Compatibility diff --git a/scripts/dracula.sh b/scripts/dracula.sh old mode 100755 new mode 100644 index 2c571cc..5cd4124 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -169,6 +169,10 @@ main() script="#($current_dir/network_ping.sh)" 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)" + if [ $plugin = "kubernetes-context" ]; then IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-kubernetes-context-colors" "cyan dark_gray") script="#($current_dir/kubernetes_context.sh $show_kubernetes_context_label)" diff --git a/scripts/spotify-tui.sh b/scripts/spotify-tui.sh new file mode 100755 index 0000000..dc07206 --- /dev/null +++ b/scripts/spotify-tui.sh @@ -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