Add battery hearts to tmux, enable gaps for everything.

This commit is contained in:
Érico Rolim 2019-05-12 08:45:40 -03:00
parent 0ec82ee43b
commit b05f7ddab2
3 changed files with 66 additions and 1 deletions

46
script/.local/bin/battmux Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
# from https://github.com/NerdyPepper/dotfiles
red="\e[31m"
grn="\e[32m"
ylw="\e[33m"
cyn="\e[36m"
blu="\e[34m"
prp="\e[35m"
bprp="\e[35;1m"
rst="\e[0m"
icon="$( ~/scripts/get_xres color2 )"
fg="$( ~/scripts/get_xres color7 )"
bat_status=""
bat_status=$( cat /sys/class/power_supply/BAT1/capacity )
charging_status=$( cat /sys/class/power_supply/BAT1/status )
health() {
for i in {0..4}
do
if [[ $i -le $(( $bat_status/20 )) ]]; then
echo -ne "#[fg=colour1]♥ "
else
echo -ne "#[fg=colour8]♥ "
fi
done
echo
}
while getopts qi options
do
case $options in
i)
echo "$bat_status $charging_status"
;;
q)
if [[ "$charging_status" = *Charging* ]]; then
echo -ne "+ $(health)"
else
health
fi
esac
done

View File

@ -1,6 +1,7 @@
new-session -A -s standard
kill-session -tstandard -a
# windows
new-window -tstandard -n text-editor emacsclient -c -nw
split-window -h -p 35 -P
split-window -v -P
@ -15,6 +16,7 @@ split-window -v
select-pane -tstandard:multishell.0
# bindings
unbind-key C-b
set -g prefix "C-a"
bind-key C-a send-prefix
@ -27,4 +29,21 @@ bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind r source-file ~/.tmux.conf
set -sg escape-time 0
set -g mouse on
# appearance
set -g status-justify right
set -g status-style "bg=colour0"
set -ag status-style "fg=colour7"
# ░ ▒ ▓ █
set -g window-status-current-format "#[fg=colour15, italics] #W "
set -g window-status-format "#[fg=colour8, italics] #W "
set -g status-left-length 100
set -g status-left "#[fg=colour15]#(date +"%H:%M") #[fg=colour8]hrs "
set -ag status-left "#[fg=colour15]#(date +"%d/%m")#[fg=colour8] #(date +"%Y") "
set -ag status-left "#[fg=colour7]#(battmux -q)#[fg=colour12] "

View File

@ -30,7 +30,7 @@ font pango:monospace 8
for_window [class=".*"] border pixel 0
gaps outer 2
gaps inner 4
smart_gaps on
#smart_gaps on
# init environment
exec i3_init