28 lines
668 B
Bash
Executable File
28 lines
668 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
now_playing="#($CURRENT_DIR/scripts/get_now_playing.sh)"
|
|
now_playing_interpolation_string="\#{now_playing}"
|
|
|
|
source $CURRENT_DIR/scripts/shared.sh
|
|
|
|
do_interpolation() {
|
|
local string="$1"
|
|
local interpolated="${string/$now_playing_interpolation_string/$now_playing}"
|
|
echo "$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
|