Skip to content

Commit 3943288

Browse files
Merge pull request dracula#153 from JannoTjarks/spotify-tui
Added the plugin spotify-tui
2 parents aa14996 + 62b1a6d commit 3943288

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul
2929
- When prefix is enabled smiley face turns from green to yellow
3030
- When charging, 'AC' is displayed
3131
- If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature
32+
- Spotify playback (needs the tool spotify-tui installed)
3233
- Current kubernetes context
3334

3435
## Compatibility

scripts/dracula.sh

100755100644
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ main()
169169
script="#($current_dir/network_ping.sh)"
170170
fi
171171

172+
if [ $plugin = "spotify-tui" ]; then
173+
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-spotify-tui-colors" "green dark_gray")
174+
script="#($current_dir/spotify-tui.sh)"
175+
172176
if [ $plugin = "kubernetes-context" ]; then
173177
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-kubernetes-context-colors" "cyan dark_gray")
174178
script="#($current_dir/kubernetes_context.sh $show_kubernetes_context_label)"

scripts/spotify-tui.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
# setting the locale, some users have issues with different locales, this forces the correct one
3+
export LC_ALL=en_US.UTF-8
4+
5+
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
source $current_dir/utils.sh
7+
8+
main()
9+
{
10+
# storing the refresh rate in the variable RATE, default is 5
11+
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
12+
13+
if ! command -v spt &> /dev/null
14+
then
15+
exit 1
16+
fi
17+
18+
spotify_playback=$(spt playback)
19+
echo ${spotify_playback}
20+
21+
}
22+
23+
# run the main driver
24+
main

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy