Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 35 lines (26 sloc) 787 Bytes
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/scripts/helpers.sh"
spotify_song="#($CURRENT_DIR/scripts/spotify.sh)"
spotify_song_interpolation="\#{spotify_song}"
set_tmux_option() {
local option="$1"
local value="$2"
tmux set-option -gq "$option" "$value"
}
do_interpolation() {
local string=$1
local spotify_song_interpolated=${string/$spotify_song_interpolation/$spotify_song}
echo $spotify_song_interpolated
}
update_tmux_option() {
local option="$1"
local option_value="$(get_tmux_option "$option")"
local new_option_value="$(do_interpolation "$option_value")"
set_tmux_option "$option" "$new_option_value"
}
main() {
update_tmux_option "status-right"
update_tmux_option "status-left"
}
main