Skip to content

Commit

Permalink
fix(status): use a literal string for battery_icon so it can be repla…
Browse files Browse the repository at this point in the history
…ced by the battery plugin (#365)

Fixes #342
  • Loading branch information
davidfmatheson authored Oct 9, 2024
1 parent 41ee0b8 commit 06fff2f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/default_options.sh --expected "${script_dir}"/tests/default_options_expected.txt "$@"

"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/application_module.sh --expected "${script_dir}"/tests/application_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/battery_module.sh --expected /dev/null "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/battery_module.sh --expected "${script_dir}"/tests/battery_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/cpu_module.sh --expected "${script_dir}"/tests/cpu_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/pane_styling.sh --expected "${script_dir}"/tests/pane_styling_expected.txt "$@"
2 changes: 1 addition & 1 deletion status/battery.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -ogq @batt_icon_status_discharging "󰂃"
set -ogq @batt_icon_status_unknown "󰂑"
set -ogq @batt_icon_status_attached "󱈑"

set -ogq "@catppuccin_${MODULE_NAME}_icon" "#{battery_icon} "
set -ogq "@catppuccin_${MODULE_NAME}_icon" "#{l:#{battery_icon}} "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_yellow}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#{l:#{battery_percentage}}"

Expand Down
3 changes: 1 addition & 2 deletions tests/battery_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ source "${script_dir}/helpers.sh"
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"

print_option @catppuccin_battery_icon | grep -q "#{battery_icon}" ||
echo "@catppuccin_status_battery expanded #{battery_icon} in @catppuccin_battery_icon"
print_option @catppuccin_status_battery
1 change: 1 addition & 0 deletions tests/battery_module_expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@catppuccin_status_battery #[fg=#f9e2af,nobold,nounderscore,noitalics]#[fg=#11111b,bg=#f9e2af]#{l:#{battery_icon}} #[fg=#f9e2af,bg=#45475a]#[fg=#cdd6f4] #{E:@catppuccin_battery_text}#[fg=#45475a]█

0 comments on commit 06fff2f

Please sign in to comment.