Merge pull request #153 from JannoTjarks/spotify-tui

Added the plugin spotify-tui
This commit is contained in:
Ethan Edwards 2022-11-06 16:02:24 -05:00 committed by GitHub
commit 3943288e0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 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 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

4
scripts/dracula.sh Executable file → Normal file
View file

@ -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)"

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