aboutsummaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rwxr-xr-x.config/herbstluftwm/autostart118
-rwxr-xr-x.config/herbstluftwm/notify.sh30
-rwxr-xr-x.config/herbstluftwm/panel.sh27
-rwxr-xr-x.config/herbstluftwm/popup.sh60
-rwxr-xr-x.config/herbstluftwm/start.sh13
5 files changed, 155 insertions, 93 deletions
diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart
index b5115cf..fb6d2e0 100755
--- a/.config/herbstluftwm/autostart
+++ b/.config/herbstluftwm/autostart
@@ -6,33 +6,30 @@ hc() {
6 herbstclient "$@" 6 herbstclient "$@"
7} 7}
8 8
9#get colors from .Xresources 9get_x_color() {
10get_xcolor(){ 10 xresources=$(cat ~/.Xresources)
11 xresources=$(\ 11 color=$(echo $xresources | sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/")
12 cat ~/.Xresources\ 12 echo $color
13 )
14 color=$(\
15 echo $xresources | \
16 sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/"\
17 )
18 echo $color
19} 13}
20 14
21#Wallpaper 15hlwm_scripts="$HOME/.config/herbstluftwm"
22WALLPAPER=/home/tom/Pictures/rocks.jpg 16
17#wallpaper
18wallpaper=/home/tom/Pictures/rocks.jpg
23 19
24#Numix color palette 20#Numix color palette
25LIGHT=$(get_xcolor 15) 21export WM_LIGHT=$(get_x_color 15)
26LLIGHT=$(get_xcolor 7) 22export WM_LLIGHT=$(get_x_color 7)
27ACCENT=$(get_xcolor 12) 23export WM_ACCENT=$(get_x_color 12)
28LDARK=$(get_xcolor 8) 24export WM_LDARK=$(get_x_color 8)
29DARK=$(get_xcolor 0) 25export WM_DARK=$(get_x_color 0)
30 26
31#Panel and padding 27#Panel and window_p
32padding=20 28window_p=20
33monitor_width=$(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/') 29monitor_w=$(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/')
34panel_height=24 30panel_h=24
35panel_width=$(echo "$monitor_width - (2 * $padding)" | bc) 31panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc)
32dmenu_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"
36 33
37hc emir_hook reload 34hc emir_hook reload
38 35
@@ -46,7 +43,7 @@ hc keybind $Mod-Shift-q quit
46hc keybind $Mod-Shift-r reload 43hc keybind $Mod-Shift-r reload
47hc keybind $Mod-Shift-c close 44hc keybind $Mod-Shift-c close
48hc keybind $Mod-Return spawn xterm 45hc keybind $Mod-Return spawn xterm
49hc keybind $Mod-grave spawn dmenu_run -h $panel_height -w $panel_width -x $padding -y $padding -p "Run:" -nb $DARK -nf $LIGHT -sb $ACCENT -sf $DARK 46hc keybind $Mod-grave spawn dmenu_run $dmenu_opts
50hc keybind XF86AudioLowerVolume spawn amixer set Master 5%- 47hc keybind XF86AudioLowerVolume spawn amixer set Master 5%-
51hc keybind XF86AudioRaiseVolume spawn amixer set Master 5%+ 48hc keybind XF86AudioRaiseVolume spawn amixer set Master 5%+
52 49
@@ -134,30 +131,30 @@ hc set focus_follows_mouse 1
134# theme 131# theme
135hc attr theme.tiling.reset 1 132hc attr theme.tiling.reset 1
136hc attr theme.floating.reset 1 133hc attr theme.floating.reset 1
137hc set frame_border_active_color $LDARK 134hc set frame_border_active_color $WM_LDARK
138hc set frame_border_normal_color $DARK 135hc set frame_border_normal_color $WM_DARK
139hc set frame_bg_normal_color $LDARK 136hc set frame_bg_normal_color $WM_LDARK
140hc set frame_bg_active_color $DARK 137hc set frame_bg_active_color $WM_DARK
141hc set frame_border_width 0 138hc set frame_border_width 0
142hc set always_show_frame 0 139hc set always_show_frame 0
143hc set frame_bg_transparent 1 140hc set frame_bg_transparent 1
144hc set frame_transparent_width 0 141hc set frame_transparent_width 0
145hc set frame_gap 0 142hc set frame_gap 0
146 143
147hc attr theme.active.color $ACCENT 144hc attr theme.active.color $WM_ACCENT
148hc attr theme.normal.color $DARK 145hc attr theme.normal.color $WM_DARK
149hc attr theme.urgent.color orange 146hc attr theme.urgent.color orange
150hc attr theme.inner_width 1 147hc attr theme.inner_width 1
151hc attr theme.inner_color $DARK 148hc attr theme.inner_color $WM_DARK
152hc attr theme.border_width 3 149hc attr theme.border_width 3
153hc attr theme.floating.border_width 4 150hc attr theme.floating.border_width 4
154hc attr theme.floating.outer_width 1 151hc attr theme.floating.outer_width 1
155hc attr theme.floating.outer_color $DARk 152hc attr theme.floating.outer_color $WM_DARK
156hc attr theme.active.inner_color $DARK 153hc attr theme.active.inner_color $WM_DARK
157hc attr theme.active.outer_color $DARK 154hc attr theme.active.outer_color $WM_DARK
158hc attr theme.background_color $DARK 155hc attr theme.background_color $WM_DARK
159 156
160hc set window_gap $padding 157hc set window_gap $window_p
161hc set frame_padding 0 158hc set frame_padding 0
162hc set smart_window_surroundings 0 159hc set smart_window_surroundings 0
163hc set smart_frame_surroundings 1 160hc set smart_frame_surroundings 1
@@ -179,20 +176,15 @@ hc unlock
179 176
180herbstclient set tree_style '╾│ ├└╼─┐' 177herbstclient set tree_style '╾│ ├└╼─┐'
181 178
182# do multi monitor setup here, e.g.:
183# hc set_monitors 1280x1024+0+0 1280x1024+1280+0
184# or simply:
185# hc detect_monitors
186
187#Start panel in all monitors 179#Start panel in all monitors
188start_panel() { 180start_panel() {
189 for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do 181 for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
190 "$1" $monitor $panel_height $padding $LIGHT $LLIGHT $ACCENT $LDARK $DARK $2& 182 "$1" $monitor $panel_h $window_p &
191 done 183 done
192} 184}
193 185
194# find the panel 186# find the panel
195panel=~/.config/herbstluftwm/panel.sh 187panel=$hlwm_scripts/panel.sh
196[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh 188[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
197if pgrep panel.sh >> /dev/null 189if pgrep panel.sh >> /dev/null
198then 190then
@@ -202,37 +194,9 @@ else
202 start_panel $panel 194 start_panel $panel
203fi 195fi
204 196
205#Wallpaper 197$hlwm_scripts/start.sh feh --bg-fill $wallpaper
206feh --bg-fill $WALLPAPER 198$hlwm_scripts/start.sh compton --config ~/.compton
207 199$hlwm_scripts/start.sh xrdb -load ~/.Xresources
208#Start compton if not running 200$hlwm_scripts/start.sh pulseaudio --start
209start_compton(){ compton --config ~/.compton & } 201$hlwm_scripts/start.sh xscreensaver -no-splash
210if pgrep compton >> /dev/null 202$hlwm_scripts/start.sh $hlwm_scripts/notify.sh $monitor_w $window_p $panel_h $hlwm_scripts/popup.sh
211then
212 kill $(pgrep compton)
213 start_compton
214else
215 start_compton
216fi
217
218#Load .Xresources
219xrdb -load ~/.Xresources
220
221#Start pulseaudio
222if pgrep pulseaudio >> /dev/null
223then
224 kill $(pgrep pulseaudio)
225 pulseaudio --start
226else
227 pulseaudio --start
228fi
229
230#Start xscreensaver
231if pgrep xscreensaver >> /dev/null
232then
233 kill $(pgrep xscreensaver)
234 xscreensaver -no-splash&
235else
236 xscreensaver -no-splash&
237fi
238
diff --git a/.config/herbstluftwm/notify.sh b/.config/herbstluftwm/notify.sh
new file mode 100755
index 0000000..190d496
--- /dev/null
+++ b/.config/herbstluftwm/notify.sh
@@ -0,0 +1,30 @@
1#!/bin/bash
2
3monitor_w=$1
4window_p=$2
5panel_h=$3
6
7popup_w=$(echo "$monitor_w - (2 * $window_p)" | bc)
8popup_h=$panel_h
9popup_x=$window_p
10popup_y=$window_p
11
12popup_opts="-w $popup_w -h $popup_h -x $popup_x -y $popup_y"
13
14while true; do
15
16 bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity)
17 bat_stat=$(cat /sys/class/power_supply/BAT1/status)
18
19 if [[ $bat_lvl -le 5 && $bat_stat == "Discharging" ]]; then
20 $4 -m "Battery level critical: $bat_lvl%%" -u "high" $popup_opts
21 elif [[ $bat_lvl -eq 10 && $bat_stat == "Discharging" ]]; then
22 $4 -m "Battery level low: $bat_lvl%%" $popup_opts
23 elif [[ $bat_lvl -eq 50 && $bat_stat == "Discharging" ]]; then
24 $4 -m "Battery level at $bat_lvl%%" $popup_opts
25 elif [[ $bat_lvl -eq 100 && $bat_stat == "Charging" ]]; then
26 $4 -m "Battery fully charged"
27 fi
28
29 sleep 60;
30done
diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh
index 4e35d0d..ac06100 100755
--- a/.config/herbstluftwm/panel.sh
+++ b/.config/herbstluftwm/panel.sh
@@ -13,11 +13,11 @@ monitor=${1:-0}
13panel_height=$2 13panel_height=$2
14padding=$3 14padding=$3
15 15
16light=$(add_alpha_channel $4) 16light=$(add_alpha_channel $WM_LIGHT)
17llight=$(add_alpha_channel $5) 17llight=$(add_alpha_channel $WM_LLIGHT)
18accent=$(add_alpha_channel $6) 18accent=$(add_alpha_channel $WM_ACCENT)
19ldark=$(add_alpha_channel $7) 19ldark=$(add_alpha_channel $WM_LDARK)
20dark=$(add_alpha_channel $8) 20dark=$(add_alpha_channel $WM_DARK)
21 21
22font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" 22font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*"
23#font="" 23#font=""
@@ -36,6 +36,7 @@ fi
36x=$(