Page 22 of 24

Re: dkeg

Posted: Fri Nov 18, 2016 3:49 am
by catfood
Shaded looks nice too. Good bar, Great music on the bar, lol.

Re: dkeg

Posted: Fri Nov 18, 2016 11:52 pm
by dkeg
Snap wrote:That's what I've got.

Any suggestion for boldblack? I'm really crap at matching good well balanced color sets. The ones I'm currently trying suck.
might be an older version you're looking at. A bit lighter, try

Code: Select all

#define bg        #10141a
#define blk       #12161d
if you want it darker, try

Code: Select all

#define bg       #0c1014
#define blk       #0e1217
for dmenu, I always will consume in what is currently in xrdb, so I don't hardcode any color.

Re: dkeg

Posted: Fri Nov 18, 2016 11:53 pm
by dkeg
catfood wrote:Shaded looks nice too. Good bar, Great music on the bar, lol.
Thanks. Shade is a top choice. And, yeah, Bad Brains ... seriously good

Re: dkeg

Posted: Sat Nov 19, 2016 9:21 am
by Snap
Thanks so much, dkeg. Will try those. I ended up with some dark blue that happens to work great for readability, but overall it looks like it doesn't belong there.

Re: dkeg

Posted: Sat Nov 26, 2016 3:26 am
by dkeg
Changing things up, using an infobar again. Updated to stay current. Have a conditional to check for the wm (used pidsley's wm function from env-info), displaying an infobar based on wm, and/or geometry for such.

This is for herbstluftwm, using herbstclient to read the current workspace. I have set highlights for memory and battery when under specified limit.
dangerwillrobinson.png

Re: dkeg

Posted: Sat Nov 26, 2016 10:17 am
by GekkoP
^ Outstanding. Seriously.

More seriously than ever, actually, this is one of my favorite artworks of yours.

Re: dkeg

Posted: Sat Nov 26, 2016 3:48 pm
by ChefIronBelly
awesome

Re: dkeg

Posted: Sat Nov 26, 2016 5:33 pm
by ivanovnegro
^^ Oh yes. Forget Gnome Shell, that minimalism there looks a little bit like the Shell for CLI wizards.

Re: dkeg

Posted: Sat Nov 26, 2016 5:57 pm
by dkeg
Thank you!

Re: dkeg

Posted: Sat Nov 26, 2016 10:27 pm
by wuxmedia
wow. How is it that you don't own a mac (latest one) and hang around hipster bars... I guess because you blow all of those punks out the water.
"Fashion fades, only style remains the same."
Coco Chanel

Re: dkeg

Posted: Sat Nov 26, 2016 11:37 pm
by franksinistra
oh wow... *unzips*

Re: dkeg

Posted: Sun Nov 27, 2016 2:44 am
by dkeg
haha wux, I could be a hipster .... maybe. I do like coffee.

frank, uh, I'll take that as a compliment? haha.

Alright, so I think I've got this thing updated. If things get to hot, too high, or too low, color changes as specified. There is different output and geometry based on wm session, colors of course are taken from xrdb.

It's cool for now, like everything else right? But I am happy with it for what it is. Always have the popup notification info scripts as a fallback.
finaloutcome.png

Re: dkeg

Posted: Sun Nov 27, 2016 6:08 am
by franksinistra
^ unixporn is dead, long live dkegporn!

Re: dkeg

Posted: Sun Nov 27, 2016 6:18 pm
by ivanovnegro
^ Indeed, Viva el Dkeg!

Re: dkeg

Posted: Mon Nov 28, 2016 1:20 pm
by machinebacon
^^^ oh man, that's a whole lot of inspiration -- color changes depending on values. actually there should be something that xsetroots everything red when battery falls below 10% :D nice homework for tonight...

Re: dkeg

Posted: Mon Nov 28, 2016 2:39 pm
by dkeg
Excellent! Had conditionals set previously, this is mainly a change in the output style. Also, the code is cleaner. I got bored over the long weekend, and my back was out, so couldn't do any work in the yard.

When my battery is less than 10, it shows purple (red 11-20), and my window borders also change color.

Let me know what you come up with.

Re: dkeg

Posted: Thu Dec 01, 2016 6:08 pm
by machinebacon
^ Maybe a daemon?

/usr/local/bin/batwatch

Code: Select all

#!/bin/bash

# make notifications appear in X
export DISPLAY=:0

# lsb functions
. /lib/lsb/init-functions

# commands for X session - edit as you wish
# I would not use hsetroot because there is no automated
# way of reverting to the originally set wallpaper.
# I kept it here for demonstration purposes.

LOW_COMMAND_X='hsetroot -solid "#ff0000" && notify-send -u critical "Battery low!"'
CRITICAL_X='hsetroot -solid "#ffffff" && notify-send -u critical "Poweroff!"'

# the path to your battery. It should (!) be BAT0, but kernels sometimes
# count from BAT1, so we use a wildcard. It will work, anyway.

CAP=`cat /sys/class/power_supply/BAT*/charge_now`

while true; do
        # check if X is running and set DISPLAY
        if [ $(($CAP+0)) -le "60000" ]; then
                eval $LOW_COMMAND_X 2>&1
                log_action_msg "Battery low!"
        elif [ $(($CAP+0)) -le "20000" ]; then
                eval $CRITICAL_X 2>&1
                log_action_msg "Prepare for poweroff!"
        fi
        sleep 10s
done
/etc/init.d/batwatch

Code: Select all

#!/bin/sh

### BEGIN INIT INFO
# Provides:          batwatch
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Checks for battery charge
# Description:       Warns user if battery low.
### END INIT INFO

. /lib/lsb/init-functions

[ -f /etc/default/rcS ] && . /etc/default/rcS

PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
DAEMON=/usr/local/bin/batwatch
DESC="battery watcher"
NAME=batwatch
PIDFILE=/var/run/batwatch.pid

# make sure pid is empty
rm -f $PIDFILE

test -f $DAEMON || exit 0

case "$1" in
        start)
                log_action_msg "Starting $DESC" "$NAME"
                start-stop-daemon --start --background --quiet --oknodo --make-pidfile --pidfile $PIDFILE --exec $DAEMON
#               log_end_msg $?
        ;;
        stop)
                log_action_msg "Stopping $DESC" "$NAME"
                start-stop-daemon --stop --quiet --remove-pidfile --pidfile $PIDFILE
                rm -f $PIDFILE
        ;;
        reload|force-reload|restart)
                log_action_msg "Restarting $DESC" "$NAME"
                $0 stop
                $0 start
        ;;
        status)
                status_of_proc $DAEMON $NAME $CONF && exit 0 || exit $?
        ;;
        *)
                log_action_msg "Usage: /etc/init.d/batwatch {start|stop|restart|force-reload|status}"
                exit 2
        ;;
esac

exit 0
then make it available

Code: Select all

sudo update-rc batwatch defaults
and it should be working for X. I would refrain from setting hsetroot because there's no universal way to revert this behaviour after the charger has been plugged in, so we have to live with notifications. No warranty, I don't even know if it works.

Re: dkeg

Posted: Thu Dec 01, 2016 11:51 pm
by dkeg
Wow, great stuff. Especially your warranty. In these forums alone we have so many battery scripts. Just goes to show how many different ways something is possible.

Re: dkeg

Posted: Fri Dec 02, 2016 12:58 am
by ChefIronBelly
^^ cool thanks, something to munch on later.

Re: dkeg

Posted: Fri Dec 02, 2016 6:17 pm
by machinebacon
well apparently "/sys/class/power_supply/BAT0/" is the battery path on newer Linuxen (I have a few boxes that point at BAT1 *sometimes*), and anyway not the damned /proc or where it was stored before.