-
-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Battery status module not working #342
Comments
Does it work if you run run "~/.config/tmux/plugins/tpm/tpm" twice? You also need to set The battery status works by looking for a string in the status line, and then replaces it in-place. If that string isn't set by the time you run the battery plugin, it won't work. Which is why you need to either run TPM twice, or run catppuccin, set the status, and then load the battery module |
It didn't work |
I see the same behavior, complete with |
That makes sense, as you are only running tpm once. The status line is expanded by tmux, which will include the string the battery plugin is looking for. You need to expand it correctly and then load the battery plugin. Please see that plugins docs for more information. But this is working as intended from the perspective of this plugin |
It appears that the battery plugin is loaded correctly, if I replace my status line config with
I do get the right number (the faint This is something that previously worked in 0.3.0. I will continue trying to suss it out, but it seems to be a problem here where you are setting it to the literal string |
Rhetorical question: how does the battery plugin add the percentage to the status line? |
This is working as per what the battery plugin expects.
It's not hope. And the term is not "resolved", format strings are "expanded". There are unit tests, and I've carefully read the tmux man page. Like I said, you need to source catppuccin, set the status-right and left options, and then load the battery plugin. It will not work any other way. |
I got it to work, but the battery icon doesn't appear. ### Terminal
set -g default-terminal "tmux-256color"
set -ag terminal-features ",${TERM}:RGB"
### Mouse Support
set -g mouse on
### Status Bar Position
set -g status-position top
### Window Indexing
set -g base-index 1
set -g renumber-windows on
### Keymaps
unbind %
unbind '"'
bind v split-window -h
bind h split-window -v
bind r source-file $HOME/.config/tmux/tmux.conf \; display-message "Settings reloaded!"
# bind-key -n C-h if -F "#{@pane-is-vim}" 'send-keys C-h' 'select-pane -L'
# bind-key -n C-j if -F "#{@pane-is-vim}" 'send-keys C-j' 'select-pane -D'
# bind-key -n C-k if -F "#{@pane-is-vim}" 'send-keys C-k' 'select-pane -U'
# bind-key -n C-l if -F "#{@pane-is-vim}" 'send-keys C-l' 'select-pane -R'
bind-key -n C-Left if -F "#{@pane-is-vim}" 'send-keys C-Left' 'select-pane -L'
bind-key -n C-Down if -F "#{@pane-is-vim}" 'send-keys C-Down' 'select-pane -D'
bind-key -n C-Up if -F "#{@pane-is-vim}" 'send-keys C-Up' 'select-pane -U'
bind-key -n C-Right if -F "#{@pane-is-vim}" 'send-keys C-Right' 'select-pane -R'
# bind-key -n M-h if -F "#{@pane-is-vim}" 'send-keys M-h' 'resize-pane -L 3'
# bind-key -n M-j if -F "#{@pane-is-vim}" 'send-keys M-j' 'resize-pane -D 3'
# bind-key -n M-k if -F "#{@pane-is-vim}" 'send-keys M-k' 'resize-pane -U 3'
# bind-key -n M-l if -F "#{@pane-is-vim}" 'send-keys M-l' 'resize-pane -R 3'
bind-key -n M-Left if -F "#{@pane-is-vim}" 'send-keys M-Left' 'resize-pane -L 3'
bind-key -n M-Down if -F "#{@pane-is-vim}" 'send-keys M-Down' 'resize-pane -D 3'
bind-key -n M-Up if -F "#{@pane-is-vim}" 'send-keys M-Up' 'resize-pane -U 3'
bind-key -n M-Right if -F "#{@pane-is-vim}" 'send-keys M-Right' 'resize-pane -R 3'
bind-key -n C-\\ if -F "#{@pane-is-vim}" 'send-keys C-\\\\' 'select-pane -l'
# bind-key -T copy-mode-vi 'C-h' select-pane -L
# bind-key -T copy-mode-vi 'C-j' select-pane -D
# bind-key -T copy-mode-vi 'C-k' select-pane -U
# bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-Left' select-pane -L
bind-key -T copy-mode-vi 'C-Down' select-pane -D
bind-key -T copy-mode-vi 'C-Up' select-pane -U
bind-key -T copy-mode-vi 'C-Right' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
### Sesh
bind-key "T" run-shell "sesh connect \"$(
sesh list | fzf-tmux -p 55%,60% \
--no-sort --ansi --border-label ' sesh ' --prompt '⚡ ' \
--header ' ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \
--bind 'tab:down,btab:up' \
--bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list)' \
--bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list -t)' \
--bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c)' \
--bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z)' \
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
--bind 'ctrl-d:execute(tmux kill-session -t {})+change-prompt(⚡ )+reload(sesh list)'
)\""
### Plugins
set -g @plugin "tmux-plugins/tpm"
set -g @plugin "catppuccin/tmux"
set -g @plugin "joshmedeski/tmux-nerd-font-window-name"
set -g @plugin "Freed-Wu/tmux-battery#termux"
set -g @plugin "tmux-plugins/tmux-yank"
### Catppuccin Theme Configuration
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_status_background "#11111b"
set -g @catppuccin_application_color "#11111b"
set -g @catppuccin_application_icon ""
set -g @catppuccin_date_time_text "%d-%m-%y %H:%M"
set -g @catppuccin_status_left_separator "█"
set -g @catppuccin_status_right_separator "█"
# Load catppuccin
run "$HOME/.config/tmux/plugins/tmux/catppuccin.tmux"
set -g status-left ""
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_session}"
set -agF status-right "#{E:@catppuccin_status_battery}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
### TPM Installation
if "test ! -d $HOME/.config/tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm $HOME/.config/tmux/plugins/tpm && $HOME/.config/tmux/plugins/tpm/bin/install_plugins'"
run "$HOME/.config/tmux/plugins/tpm/tpm" |
Yes, I was mistaken,
Does it still work? Fair warning, |
#{l:#{battery_icon}} works for me |
You're right, I just tested it again from a fork I created. I created a PR to fix it. To be clear, I'm just a user like you trying to figure out how to use this plugin since the post-0.3.0 rewrite. Regarding the other question, does your setup still work after you kill all sessions and run clean_plugins? |
works 👍 |
Hmmm... how does it manage to do:
if that file isn't there until you run tpm down on:
That's the problem I'm having with my setup. |
Running TPM doesn't install the plugins. Is the problem that you haven't installed the plugins you need? |
Sorry, meant the line above:
If you start from a clean slate (i.e. after a |
* fix: do not set the status length This was added a few years ago, and does not seem to have any appreciable affect. The setting can be set by users if required. Fixes catppuccin#356, catppuccin#342 catppuccin#347 catppuccin#345 * fix(status): fix status line modules that need external substitution
…ced by the battery plugin (catppuccin#365) Fixes catppuccin#342
Is there an existing issue outlining your problem?
Describe your problem.
Battery status module not working
Paste your configuration.
Attach screenshots.
What tmux version are you seeing the issue on?
tmux 3.5
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: