aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm
diff options
context:
space:
mode:
Diffstat (limited to '.config/herbstluftwm')
-rwxr-xr-x.config/herbstluftwm/autostart16
-rwxr-xr-x.config/herbstluftwm/panel.sh60
2 files changed, 52 insertions, 24 deletions
diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart
index 500eabf..51dcd9d 100755
--- a/.config/herbstluftwm/autostart
+++ b/.config/herbstluftwm/autostart
@@ -3,7 +3,7 @@
3# this is a simple config for herbstluftwm 3# this is a simple config for herbstluftwm
4 4
5#Wallpaper 5#Wallpaper
6WALLPAPER=/usr/share/backgrounds/gnome/Road.jpg 6WALLPAPER=/home/tom/Pictures/ThDLxEW.jpg
7 7
8#Numix color palette 8#Numix color palette
9LIGHT='#f9f9f9' 9LIGHT='#f9f9f9'
@@ -12,6 +12,9 @@ ACCENT='#d64937'
12LDARK='#333333' 12LDARK='#333333'
13DARK='#2d2d2d' 13DARK='#2d2d2d'
14 14
15#Panel
16PANEL_HEIGHT=24
17
15hc() { 18hc() {
16 herbstclient "$@" 19 herbstclient "$@"
17} 20}
@@ -24,15 +27,13 @@ xsetroot -solid $ACCENT
24hc keyunbind --all 27hc keyunbind --all
25 28
26# keybindings 29# keybindings
27# if you have a super key you will be much happier with Mod set to Mod4
28#Mod=Mod1 # Use alt as the main modifier
29Mod=Mod4 # Use the super key as the main modifier 30Mod=Mod4 # Use the super key as the main modifier
30 31
31hc keybind $Mod-Shift-q quit 32hc keybind $Mod-Shift-q quit
32hc keybind $Mod-Shift-r reload 33hc keybind $Mod-Shift-r reload
33hc keybind $Mod-Shift-c close 34hc keybind $Mod-Shift-c close
34hc keybind $Mod-Return spawn xfce4-terminal 35hc keybind $Mod-Return spawn xfce4-terminal
35hc keybind ~ spawn xfce4-terminal --drop-down 36hc keybind $Mod-grave spawn dmenu_run -h $PANEL_HEIGHT -p "Run:" -nb $DARK -nf $LIGHT -sb $ACCENT -sf $DARK
36 37
37# basic movement 38# basic movement
38# focusing clients 39# focusing clients
@@ -74,7 +75,7 @@ hc keybind $Mod-Control-Up resize up +$resizestep
74hc keybind $Mod-Control-Right resize right +$resizestep 75hc keybind $Mod-Control-Right resize right +$resizestep
75 76
76# tags 77# tags
77tag_names=( {1..9} ) 78tag_names=( I II III IV V VI VII VIII IX X )
78tag_keys=( {1..9} 0 ) 79tag_keys=( {1..9} 0 )
79 80
80# Selecting workspaces 81# Selecting workspaces
@@ -136,7 +137,7 @@ hc attr theme.inner_color $DARK
136hc attr theme.border_width 3 137hc attr theme.border_width 3
137hc attr theme.floating.border_width 4 138hc attr theme.floating.border_width 4
138hc attr theme.floating.outer_width 1 139hc attr theme.floating.outer_width 1
139hc attr theme.floating.outer_color black 140hc attr theme.floating.outer_color $DARk
140hc attr theme.active.inner_color $DARK 141hc attr theme.active.inner_color $DARK
141hc attr theme.active.outer_color $DARK 142hc attr theme.active.outer_color $DARK
142hc attr theme.background_color $DARK 143hc attr theme.background_color $DARK
@@ -171,7 +172,8 @@ herbstclient set tree_style '╾│ ├└╼─┐'
171#Start panel in all monitors 172#Start panel in all monitors
172start_panel() { 173start_panel() {
173 for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do 174 for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
174 "$1" $monitor & 175 "$1" $monitor $PANEL_HEIGHT $LIGHT $LLIGHT $ACCENT $LDARK $DARK
176 $2&
175 done 177 done
176} 178}
177 179
diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh
index cc4fb1e..0dcf370 100755
--- a/.config/herbstluftwm/panel.sh
+++ b/.config/herbstluftwm/panel.sh
@@ -11,11 +11,20 @@ fi
11x=${geometry[0]} 11x=${geometry[0]}
12y=${geometry[1]} 12y=${geometry[1]}
13panel_width=${geometry[2]} 13panel_width=${geometry[2]}
14panel_height=24 14
15panel_height=$2
16light=$3
17llight=$4
18accent=$5
19ldark=$6
20dark=$7
21
15font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" 22font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*"
16bgcolor=$(hc get frame_border_normal_color) 23selected_bg=$accent
17selbg=$(hc get window_border_active_color) 24normal_bg=$dark
18selfg='#101010' 25selected_txt=$dark
26normal_txt=$light
27inactive_txt=$llight
19 28
20######################################################################################## 29########################################################################################
21# Try to find textwidth binary. 30# Try to find textwidth binary.
@@ -65,11 +74,24 @@ hc pad $monitor $panel_height
65 # e.g. 74 # e.g.
66 # date ^fg(#efefef)18:33^fg(#909090), 2013-10-^fg(#efefef)29 75 # date ^fg(#efefef)18:33^fg(#909090), 2013-10-^fg(#efefef)29
67 76
68 #mpc idleloop player &
69 while true ; do 77 while true ; do
70 # "date" output is checked once a second, but an event is only 78 # Network
71 # generated if the output changed compared to the previous run. 79
72 date +$'date\t^fg(#efefef)%H:%M:%S^fg(#909090), %Y-%m-^fg(#efefef)%d' 80
81 # Battery
82 IFS=' ' read -a batinfo <<< $(acpi -b)
83 charge=$(echo ${batinfo[3]} | tr -d '%,')
84 if [ $charge -lt 15 ] ; then
85 bat_color=$accent
86 else
87 bat_color=$normal_txt
88 fi
89 state=$(echo ${batinfo[2]} | tr -d ',')
90 remaining=$(echo ${batinfo[4]})
91 echo -e "battery\t^fg($normal_txt)$state: ^fg($bat_color)$charge^fg($normal_txt)% ^fg($inactive_txt)($remaining)"
92
93 # Time
94 echo -e $(date +$"date\t^fg($normal_txt)%H:%M:%S^fg($inactive_txt), %d-%m-%Y")
73 sleep 1 || break 95 sleep 1 || break
74 done > >(uniq_linebuffered) & 96 done > >(uniq_linebuffered) &
75 childpid=$! 97 childpid=$!
@@ -80,6 +102,7 @@ hc pad $monitor $panel_height
80 IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" 102 IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)"
81 visible=true 103 visible=true
82 date="" 104 date=""
105 battery=""
83 windowtitle="" 106 windowtitle=""
84 while true ; do 107 while true ; do
85 108
@@ -88,24 +111,24 @@ hc pad $monitor $panel_height
88 # and then waits for the next event to happen. 111 # and then waits for the next event to happen.
89 112
90 bordercolor="#26221C" 113 bordercolor="#26221C"
91 separator="^bg()^fg($selbg)|" 114 separator="^bg()^fg($accent)|"
92 # draw tags 115 # draw tags
93 for i in "${tags[@]}" ; do 116 for i in "${tags[@]}" ; do
94 case ${i:0:1} in 117 case ${i:0:1} in
95 '#') 118 '#')
96 echo -n "^bg($selbg)^fg($selfg)" 119 echo -n "^bg($selected_bg)^fg($selected_txt)"
97 ;; 120 ;;
98 '+') 121 '+')
99 echo -n "^bg(#9CA668)^fg(#141414)" 122 echo -n "^bg($accent)^fg($normal_bg)"
100 ;; 123 ;;
101 ':') 124 ':')
102 echo -n "^bg()^fg(#ffffff)" 125 echo -n "^bg()^fg($normal_txt)"
103 ;; 126 ;;
104 '!') 127 '!')
105 echo -n "^bg(#FF0675)^fg(#141414)" 128 echo -n "^bg($normal_txt)^fg($normal_bg)"
106 ;; 129 ;;
107 *) 130 *)
108 echo -n "^bg()^fg(#ababab)" 131 echo -n "^bg()^fg($inactive_txt)"
109 ;; 132 ;;
110 esac 133 esac
111 if [ ! -z "$dzen2_svn" ] ; then 134 if [ ! -z "$dzen2_svn" ] ; then
@@ -122,10 +145,10 @@ hc pad $monitor $panel_height
122 echo -n "$separator" 145 echo -n "$separator"
123 echo -n "^bg()^fg() ${windowtitle//^/^^}" 146 echo -n "^bg()^fg() ${windowtitle//^/^^}"
124 # small adjustments 147 # small adjustments
125 right="$separator^bg() $date $separator" 148 right="$battery $separator^bg() $date "
126 right_text_only=$(echo -n "$right" | sed 's.\^[^(]*([^)]*)..g') 149 right_text_only=$(echo -n "$right" | sed 's.\^[^(]*([^)]*)..g')
127 # get width of right aligned text.. and add some space.. 150 # get width of right aligned text.. and add some space..
128 width=$($textwidth "$font" "$right_text_only ") 151 width=$($textwidth "$font" "$right_text_only")
129 echo -n "^pa($(($panel_width - $width)))$right" 152 echo -n "^pa($(($panel_width - $width)))$right"
130 echo 153 echo
131 154
@@ -145,6 +168,9 @@ hc pad $monitor $panel_height
145 #echo "resetting tags" >&2 168 #echo "resetting tags" >&2
146 IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" 169 IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)"
147 ;; 170 ;;
171 battery)
172 battery="${cmd[@]:1}"
173 ;;
148 date) 174 date)
149 #echo "resetting date" >&2 175 #echo "resetting date" >&2
150 date="${cmd[@]:1}" 176 date="${cmd[@]:1}"
@@ -186,4 +212,4 @@ hc pad $monitor $panel_height
186 212
187} 2> /dev/null | dzen2 -w $panel_width -x $x -y $y -fn "$font" -h $panel_height \ 213} 2> /dev/null | dzen2 -w $panel_width -x $x -y $y -fn "$font" -h $panel_height \
188 -e 'button3=;button4=exec:herbstclient use_index -1;button5=exec:herbstclient use_index +1' \ 214 -e 'button3=;button4=exec:herbstclient use_index -1;button5=exec:herbstclient use_index +1' \
189 -ta l -bg "$bgcolor" -fg '#efefef' 215 -ta l -bg "$normal_bg" -fg "$normal_txt"