On Wed, Sep 21, 2016 at 8:48 AM, Nick Warne <n...@linicks.net> wrote:
> Hi all,
>
> Was going to use this to monitor battery, but HUNK #10 fails - looking
> at the patch and dwm.c, the code is totally different at around line
> 664:
>
> Hunk #7 succeeded at 292.
> Hunk #8 succeeded at 516.
> Hunk #9 succeeded at 566.
> Hunk #10 FAILED at 664.
> Hunk #11 succeeded at 744 (offset -5 lines).
> Hunk #12 succeeded at 798 (offset -5 lines).
>
> All other HUNKS 1->33 apply nicely.
>
> Nick

Here's a snippet from my .xsession that show the battery state on the
top bar (there's some volume stuff in here as well that
could be chopped out:

while true; do

    if [ -e /tmp/dwm_show_sound_stat_request ]; then
        SOUND_STAT=$(amixer get Master,0 | perl -ne
'm/(\d+%).*\[(on|off)\]/ and print "$1 $2   " and exit')
        rm -f /tmp/dwm_show_sound_stat_request
    else
        SOUND_STAT=""
    fi

    xsetroot -name "${SOUND_STAT}$(acpi -i | perl -n -e
'm/.+(Charging|Discharging|Full|Unknown),\s+(\d+%)(?:,\s+(\d\d:\d\d)?:?\d*)?/
and print "$1 $2 $3 ";') $(date +'%F %I:%M %p')"
    sleep 1
    ps ax | grep -q '^\s*'$$ || exit

done &



> --
> "Gosh that takes me back... or is it forward?  That's the trouble with
> time travel, you never can tell."
>                 -- Doctor Who "Androids of Tara"
>

Reply via email to