dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 6fbb2a47982ac0d445f2e3704719b8b81d73d42a
parent 29dbbb6c13c0984ae1258ada8899d0d9d014ba39
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date:   Fri, 27 Nov 2015 11:07:52 +0100

add battery script for OSX, use in tmux status line

Diffstat:
M.tmux.conf | 4+++-
Abin/battery-osx | 7+++++++
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.tmux.conf b/.tmux.conf @@ -104,7 +104,9 @@ set -g status-left-length 40 set -g status-left "#[fg=green]s:#S #[fg=yellow]w:#I #[fg=cyan]p:#P" #set -g status-right "#[fg=cyan]#(acpi|sed 's/Battery//; s/0://; s/Discharging//; s/Full, //; s/remaining//; s/ , //; s/Charging, /+/; s/ until charged/ /; s/, / /; s/Unknown //; s/ $//;') #[fg=yellow]#(cat /proc/loadavg|awk '{print $1;}') #[fg=green]%d %b %R" #set -g status-right "#[fg=cyan]#(~/bin/battery) #[fg=yellow]#(cat /proc/loadavg|awk '{print $1;}') #[fg=green]%d %b %R" -set -g status-right "#[fg=cyan]#(~/bin/battery) #[fg=yellow]#(uptime|awk '{print \$NF;}') #[fg=green]%d %b %R" +# +#set -g status-right "#[fg=cyan]#(~/bin/battery) #[fg=yellow]#(uptime|awk '{print \$NF;}') #[fg=green]%d %b %R" +set -g status-right "#[fg=cyan]#(~/bin/battery-osx) #[fg=yellow]#(uptime|awk '{print \$NF;}') #[fg=green]%d %b %R" set -g status-justify centre #set -g status-bg default #set -g status-fg cyan diff --git a/bin/battery-osx b/bin/battery-osx @@ -0,0 +1,7 @@ +#!/bin/bash -e +pmset -g batt | tail -n 1 |\ + awk '{ print $2 $3 $4 }' |\ + sed 's/;/ /g' |\ + sed 's/(no//' |\ + sed 's/ discharging//' |\ + sed 's/ charging/ ☇/'