mirror of
https://github.com/arcan1s/dotfiles.git
synced 2025-04-25 00:17:17 +00:00
Merge branch 'master' of github.com:arcan1s/dotfiles
This commit is contained in:
commit
75df5ba69d
22
zsh/prompt
22
zsh/prompt
@ -19,15 +19,23 @@ fi
|
||||
precmd() {
|
||||
# battery charge
|
||||
function batcharge {
|
||||
bat_perc=$(acpi | awk {'print $4;'} | sed -e "s/\s//" -e "s/%.*//")
|
||||
if [[ ${bat_perc} < 15 ]]; then
|
||||
col="%{$fg_bold[red]%}"
|
||||
elif [[ ${bat_perc} < 50 ]]; then
|
||||
col="%{$fg_bold[yellow]%}"
|
||||
local _bat_perc=0
|
||||
local _num=0
|
||||
local _bat
|
||||
for _bat in /sys/class/power_supply/BAT*; do
|
||||
let "_bat_perc += $(cat ${_bat}/capacity)"
|
||||
let "_num += 1"
|
||||
done
|
||||
_bat_perc=$((${_bat_perc}/${_num}))
|
||||
local _col
|
||||
if [[ ${_bat_perc} < 15 ]]; then
|
||||
_col="%{$fg_bold[red]%}"
|
||||
elif [[ ${_bat_perc} < 50 ]]; then
|
||||
_col="%{$fg_bold[yellow]%}"
|
||||
else
|
||||
col="%{$fg_bold[green]%}"
|
||||
_col="%{$fg_bold[green]%}"
|
||||
fi
|
||||
echo "%{$fg_bold[white]%}["$col$bat_perc"%{$fg_bold[white]%}%%]%{$reset_color%}"
|
||||
echo "%{$fg_bold[white]%}["${_col}${_bat_perc}"%{$fg_bold[white]%}%%]%{$reset_color%}"
|
||||
}
|
||||
# last command
|
||||
returncode="%(?.%{$fg[green]%}.%{$fg[red]%})%?%{$resetcolor%}"
|
||||
|
@ -22,7 +22,7 @@ projctl() {
|
||||
echo "Using resolution: ${RESOLUTION}"
|
||||
xrandr --output ${FIRSTMON} --mode ${RESOLUTION} --output ${SECONDMON} --mode ${RESOLUTION}
|
||||
fi
|
||||
xinput set-prop 10 137 $(get-coord-matrix.py)
|
||||
xinput set-prop "ELAN Touchscreen" 140 $(get-coord-matrix.py)
|
||||
}
|
||||
|
||||
twinmon() {
|
||||
@ -46,5 +46,5 @@ twinmon() {
|
||||
echo "Enable ${SECONDMON}"
|
||||
xrandr --output ${FIRSTMON} --auto --primary --output ${SECONDMON} --auto --left-of ${FIRSTMON}
|
||||
fi
|
||||
xinput set-prop 10 137 $(get-coord-matrix.py)
|
||||
xinput set-prop "ELAN Touchscreen" 140 $(get-coord-matrix.py)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user