Super hacky shell wrapper around lemonbar that aims to poll as little as possible, minimising bar updates to the screen and reduce resource usage.
git clone https://mcol.xyz/code/lemontools
Log | Files | Refs | README | LICENSE

commit 2c9de65f832cae3153fa590591c3752b9454f8f6
parent adb16aecd0fc677e364e8e95f99878b21bb65e80
Author: mcol <mcol@posteo.net>
Date:   Fri, 15 Feb 2019 18:13:25 +0000

update_* functions that were not sourced are not run. Reordered kill function commands to put fifo closer to end

Diffstat:
Mlemontools | 22++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/lemontools b/lemontools @@ -12,9 +12,9 @@ # A lemonbar helper script that uses theme files to build bars from modules # -##---------------------------------------------------------------------------------- -# Helper functions -##---------------------------------------------------------------------------------- +#----------------------------------------------------------------------------------- +## Helper functions +#----------------------------------------------------------------------------------- print_help() { cat << EOF @@ -123,10 +123,10 @@ kill_lemonbar() { then if [[ -e $dir/run/fifo-$1 ]] then - rm $dir/run/fifo-$1 - rm $dir/run/log-$1 _pid=$(cat $dir/run/pid-$1) rm $dir/run/pid-$1 + rm $dir/run/log-$1 + rm $dir/run/fifo-$1 kill -TERM -- -$_pid else return 1 @@ -142,8 +142,8 @@ kill_lemonbar() { done [[ -n "$dir" ]] && { rm -f $dir/run/pid-* - rm -f $dir/run/fifo-* rm -f $dir/run/log-* + rm -f $dir/run/fifo-* } else return 1 @@ -184,11 +184,13 @@ start_feed() { IFS=$'\n' while read -r line ; do # each line received is a statement assigning a string to a variable - eval $line if [[ "$line" = update_* ]] then + type "$line" &> /dev/null && eval $line continue + else + eval $line fi # £ in $line delimits outputs per monitor @@ -238,9 +240,9 @@ start_bar() { } -##---------------------------------------------------------------------------------- -# Parse inputs -##---------------------------------------------------------------------------------- +#----------------------------------------------------------------------------------- +## Parse inputs +#----------------------------------------------------------------------------------- # Lemonbar directory dir=$(dirname $(readlink -f $0))