Page 1 of 2
[lemonbar] All about that bar !
Posted: Mon May 25, 2015 6:12 pm
by stark
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 !
Re: [lemonbar] All about that bar !
Posted: Mon May 25, 2015 8:52 pm
by rhowaldt
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'
Re: [lemonbar] All about that bar !
Posted: Tue May 26, 2015 2:27 am
by Dr_Chroot
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.
Re: [lemonbar] All about that bar !
Posted: Tue May 26, 2015 7:22 am
by stark
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 !
Re: [lemonbar] All about that bar !
Posted: Wed May 27, 2015 9:55 pm
by rhowaldt
@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?
Re: [lemonbar] All about that bar !
Posted: Thu May 28, 2015 5:33 pm
by Dr_Chroot
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"?
Re: [lemonbar] All about that bar !
Posted: Fri Jun 05, 2015 10:31 pm
by Dr_Chroot
^ Szép! Köszönöm.
Re: [lemonbar] All about that bar !
Posted: Fri Jun 05, 2015 10:44 pm
by dkeg
Szívesen
Re: [lemonbar] All about that bar !
Posted: Fri Jun 05, 2015 11:00 pm
by rhowaldt
wonderful drew, thanks :)
Re: [lemonbar] All about that bar !
Posted: Sun Jun 07, 2015 11:59 pm
by dkeg
Cleaning house. My bar config(s) are on my
GH.
Re: [lemonbar] All about that bar !
Posted: Mon Jun 08, 2015 9:00 am
by simgin
I still see some herbstluftwm leftovers hanging around, or are you using it atm, Drew?
Re: [lemonbar] All about that bar !
Posted: Mon Jun 08, 2015 11:04 am
by dkeg
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?
Re: [lemonbar] All about that bar !
Posted: Mon Jun 08, 2015 9:15 pm
by rhowaldt
that's a good question. png? shouldn't matter, oder..?
Re: [lemonbar] All about that bar !
Posted: Mon Jun 08, 2015 10:37 pm
by dkeg
I always use .PNG. I remember this happened before, don't remember the reason
Re: [lemonbar] All about that bar !
Posted: Thu Jun 16, 2016 4:52 pm
by stark
Took me longer than I actually anticipated, still a WIP .
Currently it's only useful for mpd users ...
Demo.mkv
Musicbar at Github
Re: [lemonbar] All about that bar !
Posted: Fri Jun 17, 2016 11:08 am
by wuxmedia
that is pretty nice, nice and pretty :)
very future retro
Re: [lemonbar] All about that bar !
Posted: Fri Jun 17, 2016 11:26 am
by ChefIronBelly
^^ very nice :)
Re: [lemonbar] All about that bar !
Posted: Fri Jun 17, 2016 12:42 pm
by machinebacon
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.
Re: [lemonbar] All about that bar !
Posted: Fri Jun 17, 2016 1:09 pm
by dkeg
Almost a necro, but I will still consider as. No worries, you're probably right. Who even remembered this thread existed.
Re: [lemonbar] All about that bar !
Posted: Fri Jun 17, 2016 1:37 pm
by franksinistra
very nice stark, cool looking bar.