dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 7384382228b423f4c2eec3a12d4da7219b81b78c
parent fb93a671323b41181ad0b31817ba68295464b3db
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date:   Mon,  3 Feb 2014 20:46:28 +0100

windelicato's bar

Diffstat:
M.config/bspwm/bspwmrc | 3++-
A.config/bspwm/panel/launcher | 7+++++++
A.config/bspwm/panel/launcher_apps | 15+++++++++++++++
A.config/bspwm/panel/launcher_conky | 10++++++++++
A.config/bspwm/panel/launcher_menu | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/bspwm/panel/panel | 31+++++++++++++++++++++++++++++++
A.config/bspwm/panel/panel_bar | 49+++++++++++++++++++++++++++++++++++++++++++++++++
A.config/bspwm/panel/panel_battery | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/bspwm/panel/panel_conky | 10++++++++++
A.config/bspwm/panel/panel_wifi | 32++++++++++++++++++++++++++++++++
10 files changed, 271 insertions(+), 1 deletion(-)

diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc @@ -48,5 +48,6 @@ bspc config focus_follows_pointer true # Move focus to the primary monitor bspc monitor -f primary -/home/adc/bin/panel > ~/.panel.log 2> ~/.panel.err & +#/home/adc/bin/panel > ~/.panel.log 2> ~/.panel.err & #/home/adc/bin/panel dzen2 > ~/.panel.log 2> ~/.panel.err & +/home/adc/.config/bspwm/panel/panel & diff --git a/.config/bspwm/panel/launcher b/.config/bspwm/panel/launcher @@ -0,0 +1,7 @@ +#!/bin/bash + +font="-*-tamsyn-medium-r-normal-*-12-110-75-75-m-50-iso8859-*" +background="#181512" +foreground="#9a875f" + +conky -qc ./launcher_conky | dzen2 -x '0' -w '100' -h '14' -ta 'l' -bg $background -fg $foreground -y '0' -fn $font -dock & diff --git a/.config/bspwm/panel/launcher_apps b/.config/bspwm/panel/launcher_apps @@ -0,0 +1,15 @@ + ^fg(#504339)^i(/home/sunn/.dzen/arch.xbm)^fg() term:urxvtc + ^fg(#504339)^i(/home/sunn/.dzen/fs_01.xbm)^fg() www:firefox + ^fg(#504339)^i(/home/sunn/.dzen/fwd.xbm)^fg() thunar:thunar + ^fg(#504339)^i(/home/sunn/.dzen/diskette.xbm)^fg() pdf:zathura + ^fg(#504339)^i(/home/sunn/.dzen/plug.xbm)^fg() doc:lowriter + ^fg(#504339)^i(/home/sunn/.dzen/stop.xbm)^fg() xls:localc + ^fg(#504339)^i(/home/sunn/.dzen/ac.xbm)^fg() ppt:loimpress + ^fg(#504339)^i(/home/sunn/.dzen/fox.xbm)^fg() gimp:gimp + ^fg(#504339)^i(/home/sunn/.dzen/note.xbm)^fg() ario:ario + ^fg(#504339)^i(/home/sunn/.dzen/mem.xbm)^fg() matlab:urxvt -e matlab -nodesktop -nosplash +---------- + ^fg(#504339)^i(/home/sunn/.dzen/play.xbm)^fg() run:gmrun + ^fg(#504339)^i(/home/sunn/.dzen/full.xbm)^fg() suspend:systemctl suspend + ^fg(#504339)^i(/home/sunn/.dzen/half.xbm)^fg() restart:systemctl reboot + ^fg(#504339)^i(/home/sunn/.dzen/empty.xbm)^fg() shutdown:systemctl poweroff diff --git a/.config/bspwm/panel/launcher_conky b/.config/bspwm/panel/launcher_conky @@ -0,0 +1,10 @@ +short_units yes +background yes +out_to_console yes +out_to_x no +# Update interval in seconds +update_interval 99999 +update_interval_on_battery 999999 + +TEXT +^ca(1,./launcher_menu launcher_apps) ^fg(\#504339) ^i(/home/sunn/.dzen/arch_10x10.xbm)^fg(\#9a875f) bspwm ^ca() diff --git a/.config/bspwm/panel/launcher_menu b/.config/bspwm/panel/launcher_menu @@ -0,0 +1,53 @@ +#!/bin/sh + +WIDTH=85 +#FONT="-artwiz-limey-medium-r-normal-*-10-110-75-75-m-50-iso8859-*" +#FONT='sans:size=11' +#FONT='sawasdee:size=10' +#FONT='-*-gohufontmod11-*-*-*-*-*-*-*-*-*-*-*-*' +#FONT='-*-suxus-*-*-normal-*-10-100-75-75-c-50-iso8859-1' +#FONT='-*-nu-*-*-normal-*-10-100-75-75-c-50-iso8859-1' +FONT='-*-tewi-medium-*-normal-*-*-*-*-*-*-*-*-*' + + +# Width of the graphical separator (default 80% of window's width) +SEPARATOR_WIDTH=`expr $WIDTH - \( $WIDTH / 100 \) \* 20` + +#Position +X=48 +Y=0 + +MENUFILE=$1 + +# number of visible menu entries (access the others through scrolling up/down) +LINES=`wc -l "$MENUFILE"|sed -e 's/ .*//'` +[ $LINES -gt 20 ] && LINES=20 + +execute () { + read PROG + + while read LINE; do + LBL=;APP= + LBL=$(echo $LINE|sed -e 's/:.*$//' -e 's/^[ \t]*//' -e 's/[ \t]*$//') + APP=$(echo $LINE|sed -e 's/^.*://' -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + if [ x"$APP" = x"exit" ]; then + exit + elif [ x"$LBL" = x"$PROG" ]; then + if [ x"$APP" = x"" ]; then + $LBL& + else + $APP& + fi + exit + fi + done < "$MENUFILE" +} + + +( +echo " " +sed -e 's/:.*$//' \ + -e 's/^.--*/^r('${SEPARATOR_WIDTH}'x1)/' "$MENUFILE" +) | \ + dzen2 -tw 1 -l $LINES -w $WIDTH -x $X -y $Y -fn $FONT -bg '#181512' -fg '#9a875f' -p -m -sa l -e 'onstart=uncollapse;leaveslave=exit;button1=menuprint_noparse,exit' | execute diff --git a/.config/bspwm/panel/panel b/.config/bspwm/panel/panel @@ -0,0 +1,31 @@ +#! /bin/sh + +cd $(dirname $0) +#./launcher + +if [ $(pgrep -cx panel) -gt 1 ] ; then + printf "%s\n" "The panel is already running." >&2 + exit 1 +fi + +trap 'trap - TERM; kill 0' INT TERM QUIT EXIT + +flavor=${1:-bar} + +bspc control --subscribe > "$PANEL_FIFO" & +#xtitle -sf 'T%s' > "$PANEL_FIFO" & +#clock -sf 'S%a %H:%M' > "$PANEL_FIFO" & +echo "T" > "$PANEL_FIFO" & +conky -c ./panel_conky > "$PANEL_FIFO" & + +case "$flavor" in + bar) + cat "$PANEL_FIFO" | ./panel_bar | bar + ;; + dzen2) + PANEL_HEIGHT=24 + FONT_FAMILY='DejaVu Sans' + FONT_SIZE=11 + cat "$PANEL_FIFO" | panel_dzen2 -f "$FONT_FAMILY" -s "$FONT_SIZE" | dzen2 -h $PANEL_HEIGHT -dock -ta l -title-name panel -fn "${FONT_FAMILY}:pixelsize=${FONT_SIZE}" -fg "$COLOR_FOREGROUND" -bg "$COLOR_BACKGROUND" + ;; +esac diff --git a/.config/bspwm/panel/panel_bar b/.config/bspwm/panel/panel_bar @@ -0,0 +1,49 @@ +#! /bin/sh +# +# Example panel for LemonBoy's bar + +while read -r line ; do + case $line in + S*) + sys_infos="\\r${line#?}\\fr" + ;; + T*) + title="\\f8  \\f9 bspwm" + ;; + W*) + wm_infos="\\c" + IFS=':' + set -- ${line#?} + while [ $# -gt 0 ] ; do + item=$1 + name=${item#?} + case $item in + [OFU]*) + # active desktop + wm_infos="$wm_infos\\f9 • \\fr\\br" + ;; + o*) + # inactive but occupied desktop + wm_infos="$wm_infos\\f8 • \\fr" + ;; + f*) + # inactive desktop + wm_infos="$wm_infos\\f8 ○ \\fr" + ;; + u*) + # urgent desktop + wm_infos="$wm_infos \\f3•\\fr " + ;; + L*) + # layout +# layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/') + layout="" + wm_infos="$wm_infos \\b4\\f0$layout\\br\\fr" + ;; + esac + shift + done + ;; + esac + printf "%s\n" "$title $wm_infos $sys_infos" +done diff --git a/.config/bspwm/panel/panel_battery b/.config/bspwm/panel/panel_battery @@ -0,0 +1,62 @@ +#!/bin/bash + +# BATTERY ICONS: +#      + +BAT=`acpi -b | awk '{gsub(/%,/,""); print $4}' | sed 's/%//g'` +STATUS=`acpi -b | awk '{gsub(/,/,""); print $3}'` + +# Set Icon +icon="" +if [[ $STATUS != "Discharging" ]]; then + icon="" +elif [[ $BAT -lt 10 ]]; then + icon="" +elif [[ $BAT -lt 40 ]]; then + icon="" +elif [[ $BAT -lt 70 ]]; then + icon="" +else + icon="" +fi + +bar="" +case $BAT in + 100) + bar="" + ;; + [0-5]) + bar="\f8—————————" + ;; + [5-9]) + bar="\f3—\f8————————" + ;; + [1-2]*) + bar="——\f8———————" + ;; + 3*) + bar="———\f8——————" + ;; + 4*) + bar="————\f8—————" + ;; + 5*) + bar="—————\f8————" + ;; + 6*) + bar="——————\f8———" + ;; + 7*) + bar="———————\f8——" + ;; + 8*) + bar="————————\f8—" + ;; + *) + bar="—————————" + ;; +esac + +# Create Bar + +echo "$icon \f9$bar" diff --git a/.config/bspwm/panel/panel_conky b/.config/bspwm/panel/panel_conky @@ -0,0 +1,10 @@ +short_units yes +background yes +out_to_console yes +out_to_x no +# Update interval in seconds +update_interval 3 +update_interval_on_battery 3 + +TEXT +S\f8${execi 1 ./panel_wifi} \f9${wireless_essid wlan0} \f8${execi 1 ./panel_battery} \fr${time %Y-%m-%d %H:%M } diff --git a/.config/bspwm/panel/panel_wifi b/.config/bspwm/panel/panel_wifi @@ -0,0 +1,32 @@ +#!/bin/bash + +# WIFI ICONS +#  + +QUAL=`iwconfig wlan0 | grep 'Link Quality=' | awk '{gsub(/[=/]/," "); print $3}'` +MAX=`iwconfig wlan0 | grep 'Link Quality=' | awk '{gsub(/[=/]/," "); print $4}'` +PERC=`echo $QUAL*100/$MAX | bc` + +icon="" +case $PERC in + [0-4]) + icon="" + ;; + [4-9]) + icon="" + ;; + [2-3]*) + icon="" + ;; + [4-5]*) + icon="" + ;; + [6-7]*) + icon="" + ;; + *) + icon="" + ;; +esac + +echo "$icon"