From 6c4c5513618105ea4ce081b04e0545c7c05431d8 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Tue, 24 Nov 2015 00:29:00 -0300 Subject: Update --- herbstluftwm/autostart | 7 +++--- herbstluftwm/bin/dmenu_wrapper | 3 ++- herbstluftwm/fn.sh | 1 - herbstluftwm/log | 2 ++ herbstluftwm/panel.sh | 49 ++++++++++++++++++++++++++++++------------ herbstluftwm/popups.sh | 2 +- 6 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 herbstluftwm/log (limited to 'herbstluftwm') diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index 89842c6..2ff5939 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -68,7 +68,7 @@ hc keybind $Mod-Control-Right resize right +$resizestep # tags #tag_names=( {1..9} ) -tag_names=( "web" "editors" "chat" "games" "misc" ) +tag_names=( "web" "ed" "more-ed" "chat" "games" "misc" ) tag_keys=( {1..9} 0 ) hc rename default "${tag_names[0]}" || true @@ -124,7 +124,7 @@ hc keybind $Mod-i jumpto urgent #hc set always_show_frame 1 hc set frame_bg_transparent 1 hc set frame_transparent_width 1 -hc set frame_gap 2 +hc set frame_gap 3 hc set frame_border_active_color '#000000' hc set frame_border_normal_color '#1d1f21' hc set frame_bg_normal_color '#151515' @@ -132,7 +132,7 @@ hc set frame_bg_active_color '#151515' hc set frame_border_width 0 hc set window_border_width 2 hc set window_border_normal_color '#3a3a3a' -hc set window_border_active_color "$(xrdb -q | grep color4 | awk '{ print $2; }')" +hc set window_border_active_color "$(xrdb -q | grep color12 | awk '{ print $2; }')" #hc attr theme.active.color '#9E003A' #hc attr theme.normal.color '#252525' @@ -157,6 +157,7 @@ hc set frame_padding 0 # rules hc unrule -F #hc rule class=XTerm tag=3 # move all xterms to tag 3 +hc rule class=Steam tag="games" # move all xterms to tag 3 hc rule focus=on # normally focus new clients #hc rule focus=off # normally do not focus new clients # give focus to most common terminals diff --git a/herbstluftwm/bin/dmenu_wrapper b/herbstluftwm/bin/dmenu_wrapper index 7d9dccf..fbb608d 100755 --- a/herbstluftwm/bin/dmenu_wrapper +++ b/herbstluftwm/bin/dmenu_wrapper @@ -7,5 +7,6 @@ get_xresources() { echo -n "${arr[@]:1}" } -dmenu_run -b -p $(hostname) -nb $(get_xresources background) -sb $(get_xresources color4) -sf $(get_xresources foreground) -fn "$(get_xresources face | sed 's/ /\\ /g')" +echo "'$(get_xresources font | sed 's/ /\\ /g')'" > ~/lgo +dmenu_run -b -p $(hostname) -nb $(get_xresources background) -sb $(get_xresources color4) -sf $(get_xresources background) -fn "$(get_xresources face | sed 's/ /\\ /g')" diff --git a/herbstluftwm/fn.sh b/herbstluftwm/fn.sh index dd7b4ce..0599b1f 100644 --- a/herbstluftwm/fn.sh +++ b/herbstluftwm/fn.sh @@ -1,4 +1,3 @@ - get_xresources() { arr=( $(xrdb -q | grep $1 | head -1) ) echo -n "${arr[@]:1}" diff --git a/herbstluftwm/log b/herbstluftwm/log new file mode 100644 index 0000000..25cedfa --- /dev/null +++ b/herbstluftwm/log @@ -0,0 +1,2 @@ +date ^fg(#efefef)04:15^fg(#909090), 2015-11-^fg(#efefef)05panel width: 1366 and widht 72 for '-*-fixed-medium-r-semicondensed-*-12-*-*-*-*-*-iso8859-*' and ' | 76%% | ' +panel width: 1366 and widht 72 for '-*-fixed-medium-r-semicondensed-*-12-*-*-*-*-*-iso8859-*' and ' | 76%% | ' diff --git a/herbstluftwm/panel.sh b/herbstluftwm/panel.sh index b17eb6d..ad7efbe 100755 --- a/herbstluftwm/panel.sh +++ b/herbstluftwm/panel.sh @@ -1,5 +1,7 @@ #!/bin/bash +source ${HOME}/.config/herbstluftwm/fn.sh + hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;} monitor=${1:-0} geometry=( $(herbstclient monitor_rect "$monitor") ) @@ -12,12 +14,25 @@ x=${geometry[0]} y=${geometry[1]} panel_width=${geometry[2]} panel_height=16 -#font="-Misc-Termsyn.Icons-Medium-R-Normal--11-79-100-100-C-60-ISO8859-1" #font="-*-envy code r-*-*-*-*-11-*-*-*-*-*-*-*" -font="-*-fira mono-*-*-*-*-10-*-*-*-*-*-*-*" -bgcolor=$(hc get frame_border_normal_color) -selbg=$(hc get window_border_active_color) -selfg='#efefef' +xfont=$(get_xresources font) +echo "${xfont}" > log +escaped="${xfont//[a-z 0-9\*-]/}" +if [[ ${#escaped} -gt 0 ]] +then + font="-Misc-Termsyn.Icons-Medium-R-Normal--11-79-100-100-C-60-ISO8859-1" +else + font="${xfont}" + + if [[ "${xfont}" =~ fixed ]] + then + font="${xfont/13/12}" + fi +fi +bgcolor=$(get_xresources background) +fgcolor=$(get_xresources foreground) +selbg=$(get_xresources color12) +selfg=$(get_xresources background) popups="/home/matias/.config/herbstluftwm/popups.sh" #### @@ -74,7 +89,7 @@ hc pad $monitor $panel_height while true ; do # "date" output is checked once a second, but an event is only # generated if the output changed compared to the previous run. - date +$'date\t^fg(#efefef)%H:%M^fg(#909090), %Y-%m-^fg(#efefef)%d' + date +$'date\t^fg('"$fgcolor"')%H:%M^fg(#707070), %Y-%m-^fg('"$fgcolor"')%d' sleep 3 || break done > >(uniq_linebuffered) & childpid=$! @@ -106,19 +121,24 @@ hc pad $monitor $panel_height for i in "${tags[@]}" ; do case ${i:0:1} in '#') + # Current tag echo -n "^bg($selbg)^fg($selfg)" ;; '+') + # Dunno echo -n "^bg(#9CA668)^fg(#141414)" ;; ':') - echo -n "^bg()^fg(#ffffff)" + # with something + echo -n "^bg()^fg($fgcolor)" ;; '!') + # urgent echo -n "^bg(#FF0675)^fg(#141414)" ;; *) - echo -n "^bg()^fg(#ababab)" + # Empty + echo -n "^bg()^fg(#797979)" ;; esac if [ ! -z "$dzen2_svn" ] ; then @@ -139,22 +159,23 @@ hc pad $monitor $panel_height if [ "$battery" = "/" ] ;then right="$separator^bg($hintcolor) $date $separator" else - right="^bg($hintcolor) ^fg(#efefef)$song $separator " + right="^bg($hintcolor) ^fg($fgcolor)$song $separator " if [[ $battery -lt 20 ]] then - right="$right^fg(#ef7f7f)$battery%% $separator $date" + right="$right^fg($(get_xresources color1))$battery%% $separator $date" elif [[ $battery -lt 50 ]] then - right="$right^fg(#e1e17f)$battery%% $separator $date" + right="$right^fg($(get_xresources color3))$battery%% $separator $date" else - right="$right^fg(#efefef)$battery%% $separator $date" + right="$right^fg($fgcolor)$battery%% $separator $date" fi fi right_text_only=$(echo -n "$right" | sed 's.\^[^(]*([^)]*)..g') # get width of right aligned text.. and add some space.. width=$($textwidth "$font" "$right_text_only ") - echo -n "^pa($(($panel_width - $width + 4)))$(printf "$right")" + echo "panel width: $panel_width and widht $width for '$font' and '$right_text_only'" >> log + echo -n "^pa($(($panel_width - $width + 175)))$(printf "$right")" echo ### Data handling ### @@ -220,4 +241,4 @@ hc pad $monitor $panel_height } 2> /dev/null | dzen2 -w $panel_width -x $x -y $y -fn "$font" -h $panel_height \ -e 'button3=;button4=exec:herbstclient use_index -1;button5=exec:herbstclient use_index +1' \ - -ta l -bg "$bgcolor" -fg '#efefef' + -ta l -bg "$bgcolor" -fg "$fgcolor" diff --git a/herbstluftwm/popups.sh b/herbstluftwm/popups.sh index db75c0b..d1dde29 100755 --- a/herbstluftwm/popups.sh +++ b/herbstluftwm/popups.sh @@ -14,7 +14,7 @@ calendary() { position(){ pos=$(mpc | awk 'NR==2' | awk '{print $4}' | sed 's/(//' | sed 's/%)//') - bar=$(echo $pos | gdbar -w $1 -h 3.5 -fg "$(get_xresources color4)" -bg "$(get_xresources color8)") + bar=$(echo $pos | gdbar -w $1 -h 3.5 -fg "$(get_xresources color12)" -bg "$(get_xresources color8)") echo -n "$bar" return } -- cgit v1.2.3-70-g09d2