aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xherbstluftwm/.config/herbstluftwm/autostart63
-rwxr-xr-xherbstluftwm/.config/herbstluftwm/panel.sh72
-rw-r--r--herbstluftwm/.config/herbstluftwm/theme35
3 files changed, 82 insertions, 88 deletions
diff --git a/herbstluftwm/.config/herbstluftwm/autostart b/herbstluftwm/.config/herbstluftwm/autostart
index 1cce1ba..9ec12f8 100755
--- a/herbstluftwm/.config/herbstluftwm/autostart
+++ b/herbstluftwm/.config/herbstluftwm/autostart
@@ -6,36 +6,17 @@ hc() {
6 herbstclient "$@" 6 herbstclient "$@"
7} 7}
8 8
9get_x_color() { 9dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
10 xresources=$(cat ~/.Xresources) 10source "$dir/theme"
11 color=$(echo $xresources | sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/")
12 echo $color
13}
14
15hlwm_scripts="$HOME/.config/herbstluftwm"
16
17#wallpaper
18wallpaper="/home/tom/Pictures/fall1.jpg"
19
20#Numix color palette
21export WM_LIGHT=$(get_x_color 15)
22export WM_LLIGHT=$(get_x_color 7)
23export WM_ACCENT=$(get_x_color 9)
24export WM_LDARK=$(get_x_color 8)
25export WM_DARK=$(get_x_color 0)
26 11
27#Detect monitors 12#Detect monitors
28hc set auto_detect_monitors 1 13hc set auto_detect_monitors 1
29hc detect_monitors 14hc detect_monitors
30 15
31#Panel and window_p 16#Panel and window_p
32window_p=20
33monitor_w=($(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/')) 17monitor_w=($(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/'))
34panel_h=24
35panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc) 18panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc)
36dmenu_opts="-h $panel_h -w $panel_w -x $window_p -y $window_p -p Run: -nb $WM_DARK -nf $WM_LIGHT -sb $WM_ACCENT -sf $WM_DARK" 19dmenu_opts="-h $panel_h -w $panel_w -x $window_p -y $window_p -p Run: -nb $color_bg -nf $color_fg -sb $color_accent -sf $color_bg"
37
38hc emir_hook reload
39 20
40# remove all existing keybindings 21# remove all existing keybindings
41hc keyunbind --all 22hc keyunbind --all
@@ -135,10 +116,6 @@ hc set focus_follows_mouse 1
135# theme 116# theme
136hc attr theme.tiling.reset 1 117hc attr theme.tiling.reset 1
137hc attr theme.floating.reset 1 118hc attr theme.floating.reset 1
138hc set frame_border_active_color $WM_LDARK
139hc set frame_border_normal_color $WM_DARK
140hc set frame_bg_normal_color $WM_LDARK
141hc set frame_bg_active_color $WM_DARK
142hc set frame_border_width 0 119hc set frame_border_width 0
143hc set always_show_frame 0 120hc set always_show_frame 0
144hc set frame_bg_transparent 1 121hc set frame_bg_transparent 1
@@ -147,18 +124,18 @@ hc set frame_active_opacity 0
147hc set frame_transparent_width 0 124hc set frame_transparent_width 0
148hc set frame_gap 0 125hc set frame_gap 0
149 126
150hc attr theme.active.color $WM_ACCENT 127hc attr theme.active.color $color_accent
151hc attr theme.normal.color $WM_DARK 128hc attr theme.normal.color $color_bg
152hc attr theme.urgent.color orange 129hc attr theme.urgent.color orange
153hc attr theme.inner_width 1 130hc attr theme.inner_width 1
154hc attr theme.inner_color $WM_DARK 131hc attr theme.inner_color $color_bg
155hc attr theme.border_width 3 132hc attr theme.border_width 3
156hc attr theme.floating.border_width 4 133hc attr theme.floating.border_width 4
157hc attr theme.floating.outer_width 1 134hc attr theme.floating.outer_width 1
158hc attr theme.floating.outer_color $WM_DARK 135hc attr theme.floating.outer_color $color_bg
159hc attr theme.active.inner_color $WM_DARK 136hc attr theme.active.inner_color $color_bg
160hc attr theme.active.outer_color $WM_DARK 137hc attr theme.active.outer_color $color_bg
161hc attr theme.background_color $WM_DARK 138hc attr theme.background_color $color_bg
162 139
163hc set window_gap $window_p 140hc set window_gap $window_p
164hc set frame_padding 0 141hc set frame_padding 0
@@ -185,12 +162,12 @@ herbstclient set tree_style '╾│ ├└╼─┐'
185#Start panel in all monitors 162#Start panel in all monitors
186start_panel() { 163start_panel() {
187 for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do 164 for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
188 "$1" $monitor $panel_h $window_p & 165 "$1" $monitor&
189 done 166 done
190} 167}
191 168
192# find the panel 169# find the panel
193panel=$hlwm_scripts/panel.sh 170panel=$dir/panel.sh
194[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh 171[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
195if pgrep panel.sh >> /dev/null 172if pgrep panel.sh >> /dev/null
196then 173then
@@ -202,11 +179,11 @@ fi
202 179
203pulseaudio --start 180pulseaudio --start
204 181
205$hlwm_scripts/start.sh "xautolock -time 5 -locker $hlwm_scripts/lock.sh" 182$dir/start.sh "xautolock -time 5 -locker $dir/lock.sh"
206$hlwm_scripts/start.sh "feh --bg-fill $wallpaper" 183$dir/start.sh "feh --bg-fill $wallpaper"
207$hlwm_scripts/start.sh "compton --config $HOME/.compton" 184$dir/start.sh "compton --config $HOME/.compton"
208$hlwm_scripts/start.sh "xrdb -load $HOME/.Xresources" 185$dir/start.sh "xrdb -load $HOME/.Xresources"
209$hlwm_scripts/start.sh "xset +fp /usr/share/fonts/local" 186$dir/start.sh "xset +fp /usr/share/fonts/local"
210$hlwm_scripts/start.sh "xset fp rehash" 187$dir/start.sh "xset fp rehash"
211$hlwm_scripts/start.sh "dropboxd" 188$dir/start.sh "dropboxd"
212$hlwm_scripts/start.sh "$hlwm_scripts/notify.sh $monitor_w $window_p $panel_h $hlwm_scripts/popup.sh" 189#$dir/start.sh "$dir/notify.sh $monitor_w $window_p $panel_h $dir/popup.sh"
diff --git a/herbstluftwm/.config/herbstluftwm/panel.sh b/herbstluftwm/.config/herbstluftwm/panel.sh
index 3af00c5..9b8fb48 100755
--- a/herbstluftwm/.config/herbstluftwm/panel.sh
+++ b/herbstluftwm/.config/herbstluftwm/panel.sh
@@ -4,28 +4,10 @@ hc() {
4 "${herbstclient_command[@]:-herbstclient}" "$@" ; 4 "${herbstclient_command[@]:-herbstclient}" "$@" ;
5} 5}
6 6
7add_alpha_channel(){ 7dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
8 echo "$1" | \ 8source "$dir/theme"
9 sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/"
10}
11 9
12monitor=${1:-0} 10monitor=${1:-0}
13panel_height=$2
14padding=$3
15
16light=$(add_alpha_channel $WM_LIGHT)
17llight=$(add_alpha_channel $WM_LLIGHT)
18accent=$(add_alpha_channel $WM_ACCENT)
19ldark=$(add_alpha_channel $WM_LDARK)
20dark=$(add_alpha_channel $WM_DARK)
21
22font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*"
23font2="-*-stlarch-medium-*-*-*-10-*-*-*-*-*-*-*"
24selected_bg=$accent
25normal_bg=$dark
26selected_txt=$dark
27normal_txt=$light
28inactive_txt=$llight
29 11
30geometry=( $(herbstclient monitor_rect "$monitor") ) 12geometry=( $(herbstclient monitor_rect "$monitor") )
31if [ -z "$geometry" ] ;then 13if [ -z "$geometry" ] ;then
@@ -33,12 +15,12 @@ if [ -z "$geometry" ] ;then
33 exit 1 15 exit 1
34fi 16fi
35# geometry has the format W H X Y 17# geometry has the format W H X Y
36x=$(echo "${geometry[0]} + $padding" | bc) 18x=$(echo "${geometry[0]} + $window_p" | bc)
37y=$(echo "${geometry[1]} + $padding" | bc) 19y=$(echo "${geometry[1]} + $window_p" | bc)
38panel_width=$(echo "${geometry[2]} - (2 * $padding)" | bc) 20panel_width=$(echo "${geometry[2]} - (2 * $window_p)" | bc)
39bar_opts="-g ${panel_width}x${panel_height}+${x}+${y} -f $font,$font2 -u 2 -B $normal_bg -F $normal_txt" 21bar_opts="-g ${panel_width}x${panel_h}+${x}+${y} -f $font,$font_sec -u 2 -B $acolor_bg -F $acolor_fg"
40 22
41hc pad $monitor $(echo "$panel_height + $padding" | bc) 23hc pad $monitor $(echo "$panel_h + $window_p" | bc)
42 24
43if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then 25if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then
44 # mawk needs "-W interactive" to line-buffer stdout correctly 26 # mawk needs "-W interactive" to line-buffer stdout correctly
@@ -77,9 +59,9 @@ fi
77 scrolling=$current 59 scrolling=$current
78 fi 60 fi
79 61
80 echo -e "music\t\ue05c ${scrolling:0:24}" 62 echo -e "music\t\ue05c ${scrolling:0:24}"
81 else 63 else
82 echo -e "music\toff" 64 echo -e "music\toff"
83 fi 65 fi
84 66
85 # Volume 67 # Volume
@@ -95,9 +77,9 @@ fi
95 if [ -z $vol ] ; then 77 if [ -z $vol ] ; then
96 echo -e "volume\toff" 78 echo -e "volume\toff"
97 else 79 else
98 echo -e "volume\t%{F$normal_txt}\ue05d $vol%%%{F-}" 80 echo -e "volume\t%{F$acolor_fg}\ue05d $vol%%%{F-}"
99 fi 81 fi
100 else 82 else
101 echo -e "volume\toff" 83 echo -e "volume\toff"
102 fi 84 fi
103 85
@@ -106,12 +88,12 @@ fi
106 if iwconfig $int1 >/dev/null 2>&1; then 88 if iwconfig $int1 >/dev/null 2>&1; then
107 wifi=$int1 89 wifi=$int1
108 eth=$int2 90 eth=$int2
109 else 91 else
110 wifi=$int2 92 wifi=$int2
111 eth=$int1 93 eth=$int1
112 fi 94 fi
113 95
114 ip link show $eth | grep 'state UP' >/dev/null && int=$eth || int=$wifi 96 ip link show $eth | grep 'state UP' >/dev/null && int=$eth || int=$wifi
115 97
116 if [ $int == "wlp3s0" ] ; then 98 if [ $int == "wlp3s0" ] ; then
117 iwconfig=$(iwconfig $int) 99 iwconfig=$(iwconfig $int)
@@ -124,12 +106,12 @@ fi
124 106
125 if [ $ssid != "off/any" ] ; then 107 if [ $ssid != "off/any" ] ; then
126 echo -e "net\t\ue0f3 $ssid" 108 echo -e "net\t\ue0f3 $ssid"
127 else 109 else
128 echo -e "net\toff" 110 echo -e "net\toff"
129 fi 111 fi
130 112
131 elif [ $int == "enp2s0" ] ; then 113 elif [ $int == "enp2s0" ] ; then
132 echo -e "net\t\ue0af ethernet" 114 echo -e "net\t\ue0af ethernet"
133 else 115 else
134 echo -e "net\toff" 116 echo -e "net\toff"
135 fi 117 fi
@@ -138,18 +120,18 @@ fi
138 if $(test -e /sys/class/power_supply/BAT1) ; then 120 if $(test -e /sys/class/power_supply/BAT1) ; then
139 bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) 121 bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity)
140 if [ $bat_lvl -lt 15 ] ; then 122 if [ $bat_lvl -lt 15 ] ; then
141 bat_color=$accent 123 bat_color=$acolor_accent
142 else 124 else
143 bat_color=$normal_txt 125 bat_color=$acolor_fg
144 fi 126 fi
145 state=$(cat /sys/class/power_supply/BAT1/status) 127 state=$(cat /sys/class/power_supply/BAT1/status)
146 echo -e "battery\t%{F$normal_txt}\ue03b %{F$bat_color}$bat_lvl%{F$normal_txt}%%%{F-}" 128 echo -e "battery\t%{F$acolor_fg}\ue03b %{F$bat_color}$bat_lvl%{F$acolor_fg}%%%{F-}"
147 else 129 else
148 echo -e "battery\toff" 130 echo -e "battery\toff"
149 fi 131 fi
150 132
151 # Time 133 # Time
152 echo -e $(date +$"date\t%{F$normal_txt}%H:%M:%S %{F$inactive_txt}(%d-%m-%Y)%{F-}") 134 echo -e $(date +$"date\t%{F$acolor_fg}%H:%M:%S %{F$acolor_fg}(%d-%m-%Y)%{F-}")
153 sleep 1 || break 135 sleep 1 || break
154 done > >(uniq_linebuffered) & 136 done > >(uniq_linebuffered) &
155 childpid=$! 137 childpid=$!
@@ -165,24 +147,24 @@ fi
165 net="" 147 net=""
166 windowtitle="" 148 windowtitle=""
167 while true ; do 149 while true ; do
168 separator="%{F$accent}|%{F-}" 150 separator="%{F$acolor_accent}|%{F-}"
169 # draw tags 151 # draw tags
170 for i in "${tags[@]}" ; do 152 for i in "${tags[@]}" ; do
171 case ${i:0:1} in 153 case ${i:0:1} in
172 '#') 154 '#')
173 echo -n "%{U$accent+u}%{F$normal_txt}" 155 echo -n "%{U$acolor_accent+u}%{F$acolor_fg}"
174 ;; 156 ;;
175 '+') 157 '+')
176 echo -n "%{U$normal_txt+u}%{F$normal_txt}" 158 echo -n "%{U$acolor_fg+u}%{F$acolor_fg}"
177 ;; 159 ;;
178 ':') 160 ':')
179 echo -n "%{F$normal_txt}" 161 echo -n "%{F$acolor_fg}"
180 ;; 162 ;;
181 '!') 163 '!')
182 echo -n "%{B$accent}%{U$accent+u}%{F$normal_bg}" 164 echo -n "%{B$acolor_accent}%{U$acolor_accent+u}%{F$acolor_bg}"
183 ;; 165 ;;
184 *) 166 *)
185 echo -n "%{F$inactive_txt}" 167 echo -n "%{F$acolor_fg}"
186 ;; 168 ;;
187 esac 169 esac
188 echo -n "%{A:tag,${i:1}:} ${i:1} %{A}%{F-}%{U-u}%{B-}" 170 echo -n "%{A:tag,${i:1}:} ${i:1} %{A}%{F-}%{U-u}%{B-}"
@@ -196,7 +178,7 @@ fi
196 178
197 #DO NOT REMOVE THIS ECHO 179 #DO NOT REMOVE THIS ECHO
198 echo 180 echo
199 181
200 # wait for next event 182 # wait for next event
201 IFS=$'\t' read -ra cmd || break 183 IFS=$'\t' read -ra cmd || break
202 case "${cmd[0]}" in 184 case "${cmd[0]}" in
diff --git a/herbstluftwm/.config/herbstluftwm/theme b/herbstluftwm/.config/herbstluftwm/theme
new file mode 100644
index 0000000..810c5d2
--- /dev/null
+++ b/herbstluftwm/.config/herbstluftwm/theme
@@ -0,0 +1,35 @@
1#!/bin/bash
2
3# Get color from ~/.Xresources
4get_x_color() {
5 xresources=$(cat ~/.Xresources)
6 color=$(echo $xresources | sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/")
7 echo $color
8}
9
10# Add alpha channel to a hexadecimal color
11add_alpha_channel(){
12 echo "$1" | \
13 sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/"
14}
15
16# Wallpaper
17wallpaper="/home/tom/Pictures/fall1.jpg"
18
19# Padding
20window_p=20
21
22# Panel
23panel_h=24
24font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*"
25font_sec="-*-stlarch-medium-*-*-*-10-*-*-*-*-*-*-*"
26
27# Colors
28color_fg=$(get_x_color 15)
29color_accent=$(get_x_color 9)
30color_bg=$(get_x_color 0)
31
32# Alpha Colors for use with bar
33acolor_fg=$(add_alpha_channel $color_fg)
34acolor_accent=$(add_alpha_channel $color_accent)
35acolor_bg=$(add_alpha_channel $color_bg)