[lemonbar] All about that bar !

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

[lemonbar] All about that bar !

Unread post by stark » Mon May 25, 2015 6:12 pm

Yes, this a lemonbar hacking thread !

Share your or other people's lemonbar scripts or a interesting fork !

Also, Please post a preview of the result of your awesome lemonbar script !
Last edited by stark on Tue May 26, 2015 7:20 am, edited 1 time in total.
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: [lemonbar] All about that bar !

Unread post by rhowaldt » Mon May 25, 2015 8:52 pm

xft-fork of lemonbar: https://github.com/neeasade/bar

herbstluftwm lemonbar panel:

Code: Select all

#!/bin/bash

hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;}
monitor=${1:-0}
geometry=( $(herbstclient monitor_rect "$monitor") )
if [ -z "$geometry" ] ;then
    echo "Invalid monitor $monitor"
    exit 1
fi
# geometry has the format W H X Y
x=${geometry[0]}
y=${geometry[1]}
panel_width=${geometry[2]}
panel_height=12
font='GohuFont-7,-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1'
#font="-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*"
bgcolor=$(hc get frame_border_normal_color)
selbg=$(hc get window_border_active_color)
selfg='#c3c3c3'
separator="%{B-}%{F$selfg}|"

tags_update() {
	    IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)"
	    bordercolor="#3d5a72"
        separator="%{B-}%{F$selbg}|"
        # draw tags
        for i in "${tags[@]}" ; do
            case ${i:0:1} in
                '#')
                    echo -n "%{B$selbg}%{F$selfg}"
                    ;;
                '+')
                    echo -n "%{B#9CA668}%{F#141414}"
                    ;;
                ':')
                    echo -n "%{B-}%{F#ffffff}"
                    ;;
                '!')
                    echo -n "%{B#FF0675}%{F#141414}"
                    ;;
                *)
                    echo -n "%{B-}%{F#ababab}"
                    ;;
            esac
            # non-clickable tags because fuck you, mouse.
            echo -n " ${i:1} "
		done
		#echo "$separator"
}

muz_update() {
		moc_running=$(pidof "mocp" > /dev/null && echo 1)
        if [ $moc_running -eq 1 ]; then
			muz=$(mocp -Q %file | sed -e 's_/.*/__' -e 's/\.[^\.]*$//' -e 's/_/ /g') || muz="?"
        else
			muz=""
        fi
}

vol_update() {
		vol=$(amixer get Master | awk -F'[][]' '/Mono:/ {sub(/%/, ""); print $2; exit}')
}

wifi_interval=50
wifi_update() {
		wifi=$(awk 'NR==3 {printf("%2.2d\n", ($3/70)*100)}' /proc/net/wireless)
}

times_interval=100
times_update() {
		thedate=$(date -u +%d.%m.%y)
		thetime=$(date -u +%H:%M)
}

#initialize
vol_update
muz_update
wifi_count=0; wifi_update
times_count=0; times_update



while true;
do
	muz_update
	vol_update
	if [ $wifi_count -ge $wifi_interval ]; then wifi_update; wifi_count=0; fi
	wifi_count=$((wifi_count+1))
	if [ $times_count -ge $times_interval ]; then times_update; times_count=0; fi
	times_count=$((times_count+1))
	tags_update
	vol_icon=$(echo -e "\uE0FD")
	wifi_icon=$(echo -e "\uE048")
	#wifi_icon=$(echo -e "\uE1AF")
	right="%{r}%{F$selfg}$muz %{F$selbg}$vol_icon %{F$selfg}$vol% %{F$selbg}$wifi_icon %{F$selfg}$wifi% $separator %{F$selfg}$thedate %{F#ffffff}$thetime "
	echo "$right"

done | lemonbar -g ${panel_width}x${panel_height} -f "$font" -B "$bgcolor" -F '#c36666'
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
Dr_Chroot
Alfalfa
Posts: 1100
Joined: Mon Jun 09, 2014 9:49 pm
Location: among the sagebrush
Contact:

Re: [lemonbar] All about that bar !

Unread post by Dr_Chroot » Tue May 26, 2015 2:27 am

Mdoified version of dkeg's older Lemonbar ;)

Code: Select all

#!/bin/bash
BLUE=#FF5D5971
BLACK=#FFCECECE
RED=#FF566FB4
GREEN=#FFA08BA0
YELLOW=#FF8a6d79
WHITE=#FFffffff

function statusbar {

	bat() {
	bat0=$(acpi|cut -d "," -f 2)
	echo $bat0
	}
	
	clock() {
	time=$(date "+%A %b %d %R")
	echo $time
	}

	vol() {
	vol="$(amixer get Master | sed -nr '$ s:.*\[(.+%)].*:\1:p')"
	echo $vol
	}

	cur() {
	cur=$(mpc current)
	test -n "$cur" && echo $cur || echo "you ain't got nuthin' playin' "    
	}

	echo "%{B$YELLOW}%{F$BLACK}  %{B-}%{F-}  %{F$BLACK}$(cur) %{B-}%{F-} %{r}% %{F$BLUE}  %{B-}%{F-} %{F$BLACK}$(vol)% %{F$BLUE}  %{B-}%{F-} %{F$BLACK}$(bat)% %{F$BLUE}  %{B-}%{F-} %{F$BLACK}%$(clock)  "
}
 while true 
 do
	 echo "$(statusbar)"
	sleep 0.5	
 done | lemonbar -g 700x25+275+20 -f "-artwiz-lime-medium-r-normal--10-110-75-75-m-50-iso8859-1" -f "-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1" -B "#FF191716" -F "#FFabacae" -p -d &
Edit: Whoops! Forgot to add a scrot.
Attachments
2015-05-28-162952_700x25_scrot.png
2015-05-28-162952_700x25_scrot.png (1.36 KiB) Viewed 23367 times
Last edited by Dr_Chroot on Thu May 28, 2015 5:31 pm, edited 1 time in total.
Fight internet censorship.
EFF | Tor Project | Bitcoin

"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: [lemonbar] All about that bar !

Unread post by stark » Tue May 26, 2015 7:22 am

Guys I forgot to add the preview tip as it makes it easier for the consumer ( lool ) to understand and make a choice :)

@rho That fork has a branch called slant which allows to set slanted separators which is cool Thanks for sharing !
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: [lemonbar] All about that bar !

Unread post by rhowaldt » Wed May 27, 2015 9:55 pm

@stark: i tried looking for scrots of what the slant would do exactly, but without success. does it simply allow you to make shit italic or is it something different?
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
Dr_Chroot
Alfalfa
Posts: 1100
Joined: Mon Jun 09, 2014 9:49 pm
Location: among the sagebrush
Contact:

Re: [lemonbar] All about that bar !

Unread post by Dr_Chroot » Thu May 28, 2015 5:33 pm

A popup bar! I was just thinking about that this morning :D I didn't know that you could time it too; I was expecting just to toss something in my sxhkd config. Very nice :) So is the second script "popnotify"?
Fight internet censorship.
EFF | Tor Project | Bitcoin

"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden

User avatar
Dr_Chroot
Alfalfa
Posts: 1100
Joined: Mon Jun 09, 2014 9:49 pm
Location: among the sagebrush
Contact:

Re: [lemonbar] All about that bar !

Unread post by Dr_Chroot » Fri Jun 05, 2015 10:31 pm

^ Szép! Köszönöm.
Fight internet censorship.
EFF | Tor Project | Bitcoin

"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: [lemonbar] All about that bar !

Unread post by dkeg » Fri Jun 05, 2015 10:44 pm

Szívesen

Work hard; Complain less

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: [lemonbar] All about that bar !

Unread post by rhowaldt » Fri Jun 05, 2015 11:00 pm

wonderful drew, thanks :)
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: [lemonbar] All about that bar !

Unread post by dkeg » Sun Jun 07, 2015 11:59 pm

Cleaning house. My bar config(s) are on my GH.

Work hard; Complain less

User avatar
simgin
Meme Fodder
Posts: 1167
Joined: Sun Jan 06, 2013 12:07 am
Location: Bradford-on-Avon, UK

Re: [lemonbar] All about that bar !

Unread post by simgin » Mon Jun 08, 2015 9:00 am

I still see some herbstluftwm leftovers hanging around, or are you using it atm, Drew?
Someone told me that I am delusional, I almost fell off my unicorn.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: [lemonbar] All about that bar !

Unread post by dkeg » Mon Jun 08, 2015 11:04 am

I do, I actually used it most of last week. Updated my config and everything. I was really digging it. But if I'm just on irc and putzing around, I really don't need anything more than a simple stacker.

Question: Why the image in my last post is only coming thru as an attachment?

Work hard; Complain less

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: [lemonbar] All about that bar !

Unread post by rhowaldt » Mon Jun 08, 2015 9:15 pm

that's a good question. png? shouldn't matter, oder..?
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: [lemonbar] All about that bar !

Unread post by dkeg » Mon Jun 08, 2015 10:37 pm

I always use .PNG. I remember this happened before, don't remember the reason

Work hard; Complain less

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: [lemonbar] All about that bar !

Unread post by stark » Thu Jun 16, 2016 4:52 pm

Took me longer than I actually anticipated, still a WIP .

Currently it's only useful for mpd users ...

Demo.mkv
Musicbar at Github
Attachments
musicbar.png
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: [lemonbar] All about that bar !

Unread post by wuxmedia » Fri Jun 17, 2016 11:08 am

that is pretty nice, nice and pretty :)
very future retro
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: [lemonbar] All about that bar !

Unread post by ChefIronBelly » Fri Jun 17, 2016 11:26 am

^^ very nice :)
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: [lemonbar] All about that bar !

Unread post by machinebacon » Fri Jun 17, 2016 12:42 pm

dkeg wrote: Question: Why the image in my last post is only coming thru as an attachment?
Better late than never:
because of the file or image size. if it's smaller than 100px (IIRC) in one dimension it is always an attachment. I can check the details if you want. If images are too big, they get resized, if they are too small, they will be attached. Something like that.
..gnutella..

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: [lemonbar] All about that bar !

Unread post by dkeg » Fri Jun 17, 2016 1:09 pm

Almost a necro, but I will still consider as. No worries, you're probably right. Who even remembered this thread existed.

Work hard; Complain less

User avatar
franksinistra
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

Re: [lemonbar] All about that bar !

Unread post by franksinistra » Fri Jun 17, 2016 1:37 pm

very nice stark, cool looking bar.
rice no more.

Post Reply