Closed nerdpad closed 7 years ago
tm_battery="$battery_icon $battery_percentage $battery_remain"
This should be changed to
tm_battery="#{battery_icon} #{battery_percentage} #{battery_remain}"
I have tried that but I still don't see any indicator, it's completely empty.
in my tmux.conf I source the plugin.sh before the theme.sh, so the variables should be available, right?
when I echo the variables I see the following.
~/.dotfiles
⇨ echo $tm_icon # This works
🙊
~/.dotfiles
⇨ echo $battery_percent # this doesn't. all variables related to the plugin return empty
How did you install the plugin? I recommend using tpm. Follow their README to install tpm. After installing tpm, add set -g @plugin 'tmux-plugins/tmux-battery
to your tmux configuration file. Source your configuration file, and check if it works now.
I do not understand what you are doing exactly. Try by doing exactly what the README of tpm
and tmux-battery
say.
@martinbeentjes I do have tmp installed, and installed the plugin via tpm (Prefix+I), and I am following the instructions properly, the plugin is also installed.
Instead of adding the plugins in my tmux config, I created another file for them, and I am sourcing that file in my tmux.conf before I source another file (theme.sh) that actually sets the tmux status line.
tmux.plugin.sh (https://github.com/NerdPad/dotfiles/blob/master/tmux/tmux.plugins.sh)
###########################
### Tmux Plugin Manager ###
###########################
# List of plugins
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-battery \
'
# Initialize TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'
This file is sourced in my tmux.conf
tmux.conf (https://github.com/NerdPad/dotfiles/blob/master/tmux/tmux.conf.symlink)
...
...
# load tmux plugin manager
source ~/.dotfiles/tmux/tmux.plugins.sh
#######################
### Color & Style Settings ###
#######################
source ~/.dotfiles/tmux/theme.sh # this is the last line in my tmux.conf
Theme.sh that customizes tmux look. https://github.com/NerdPad/dotfiles/blob/master/tmux/theme.sh
First of all, @tpm_plugins
is deprecated. Please change this to:
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-battery'
Second, run '~/.tmux/plugins/tpm/tpm'
should be ran at last. (So just at the end of the tmux configuration file.
Third, maybe it is me but the followings looks like it is missing some quotes:
set -g status-left $tm_session_name' '
set -g status-right $tm_tunes' '$battery_icon' '$tm_date' '$tm_host
I personally did the following:
set -g status-right "#{battery_status_bg} #{battery_percentage} #[bg=default,fg=default] #H %d/%m %H:%M"
What is the reason that you split the configuration into several different files? I personally can't find anything now in your config even with this small amount of files. I really recommend just sticking to one .tmux.conf
which lives in your $HOME
folder (~
).
Hey @nerdpad, can you tell if the above has worked? Do you still have problems?
@martinbeentjes I have currently stopped using tmux-plugins. Will close the issue for now, will open it later when I test it.
I am sure something is wrong with my config. I am very new to shell scripting, and not sure if I am constructing the battery template right.
Can you please take a look at this change set. https://github.com/NerdPad/dotfiles/commit/4b430caca65ff9ed581cbf3b58ba0232b53e8632#diff-e4a99bf3a7fbdabd6456dad3160011e3
I added the following lines to my theme.sh, which is sourced in tmux.config after tmp is loaded.
I am running OSX Sierra
Theme.sh
Tmux Plugin
Tmux.conf
All the plugins are installed.