diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2020-12-18 11:56:46 -0500 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2020-12-18 11:56:46 -0500 |
| commit | 741e9298bd7b0dabeea26dfe039274afca572f6d (patch) | |
| tree | 19ea50d67534354197c89a7554504083100a76b7 | |
| parent | 29c8156e66c1c880a977c6feb36ebe1d6a54b9be (diff) | |
| download | eibhear-741e9298bd7b0dabeea26dfe039274afca572f6d.tar.gz eibhear-741e9298bd7b0dabeea26dfe039274afca572f6d.tar.zst eibhear-741e9298bd7b0dabeea26dfe039274afca572f6d.zip | |
battery warning fix; zsh beam simplified
| -rw-r--r-- | .config/zsh/.zshrc | 15 | ||||
| -rwxr-xr-x | .local/bin/statusbar/battery | 4 |
2 files changed, 7 insertions, 12 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index d6b3cc8..22a166e 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -36,16 +36,11 @@ bindkey -M menuselect 'j' vi-down-line-or-history bindkey -v '^?' backward-delete-char # Change cursor shape for different vi modes. -function zle-keymap-select { - if [[ ${KEYMAP} == vicmd ]] || - [[ $1 = 'block' ]]; then - echo -ne '\e[1 q' - elif [[ ${KEYMAP} == main ]] || - [[ ${KEYMAP} == viins ]] || - [[ ${KEYMAP} = '' ]] || - [[ $1 = 'beam' ]]; then - echo -ne '\e[5 q' - fi +function zle-keymap-select () { + case $KEYMAP in + vicmd) echo -ne '\e[1 q';; # block + viins|main) echo -ne '\e[5 q';; # beam + esac } zle -N zle-keymap-select zle-line-init() { diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index c484286..d0272ec 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -33,7 +33,7 @@ do esac capacity=$(cat "$battery/capacity") # Will make a warn variable if discharging and low - [ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && local warn="❗" + [ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗" # Prints the info - printf "%s%s%d%%\n" "$status" "$warn" "$capacity" + printf "%s%s%d%%\n" "$status" "$warn" "$capacity"; unset warn done && return 0 |
