aboutsummaryrefslogtreecommitdiffstats
path: root/herbstluftwm
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2015-09-03 16:20:45 +0200
committerGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2015-09-03 16:20:45 +0200
commit54f1b34a10aa7815afe27e30f9377d5a68a2d04a (patch)
tree3fb1883ddd0a301b353fb7f977d69022ac95e863 /herbstluftwm
parentb488df4f931c990ee2f754ed359605e5763a833f (diff)
downloaddotfiles-54f1b34a10aa7815afe27e30f9377d5a68a2d04a.tar.gz
dotfiles-54f1b34a10aa7815afe27e30f9377d5a68a2d04a.tar.bz2
dotfiles-54f1b34a10aa7815afe27e30f9377d5a68a2d04a.zip
Added better theming infrastructure to HLWM
Diffstat (limited to 'herbstluftwm')
-rwxr-xr-xherbstluftwm/.config/herbstluftwm/autostart42
-rw-r--r--herbstluftwm/.config/herbstluftwm/hlwm-keybindings2
-rw-r--r--herbstluftwm/.config/herbstluftwm/hlwm-theming42
-rwxr-xr-xherbstluftwm/.config/herbstluftwm/panel_indicators.sh10
-rwxr-xr-xherbstluftwm/.config/herbstluftwm/populate_panel.sh14
-rwxr-xr-xherbstluftwm/.config/herbstluftwm/popup.sh4
-rwxr-xr-xherbstluftwm/.config/herbstluftwm/start_panel.sh12
-rw-r--r--herbstluftwm/.config/herbstluftwm/themes/purpur44
-rw-r--r--herbstluftwm/.config/herbstluftwm/wallpapers/poligons.png (renamed from herbstluftwm/.config/herbstluftwm/poligons.png)bin4592375 -> 4592375 bytes
9 files changed, 98 insertions, 72 deletions
diff --git a/herbstluftwm/.config/herbstluftwm/autostart b/herbstluftwm/.config/herbstluftwm/autostart
index 78a81b4..a436283 100755
--- a/herbstluftwm/.config/herbstluftwm/autostart
+++ b/herbstluftwm/.config/herbstluftwm/autostart
@@ -9,37 +9,38 @@ export -f hc
9# The current directory 9# The current directory
10export HLWM_CONF_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 10export HLWM_CONF_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
11 11
12#Include the theming script 12source "$HLWM_CONF_DIR/hlwm-theming"
13source "$HLWM_CONF_DIR/themes/current"
14
15#Detect monitors
16hc set auto_detect_monitors 1
17hc detect_monitors
18 13
19#Panel and window_p 14#Panel and HLWM_WINDOW_PADDING
20monitor_w=($(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/')) 15monitor_w=($(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/'))
21panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc) 16panel_w=$(echo "$monitor_w - (2 * $HLWM_WINDOW_PADDING)" | bc)
22dmenu_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" 17dmenu_opts="-h $HLWM_PANEL_HEIGHT -w $panel_w -x $HLWM_WINDOW_PADDING -y $HLWM_WINDOW_PADDING -p Run: -nb $HLWM_BG_COLOR -nf $HLWM_FG_COLOR -sb $HLWM_ACCENT_COLOR -sf $HLWM_BG_COLOR"
23 18
24# Tags 19# Tags
25tag_names=() 20tag_names=()
26tag_keys=({1..9} 0) 21tag_keys=({1..9} 0)
27for key in ${tag_keys[@]}; do 22for key in ${tag_keys[@]}; do
28 if [ $key -eq 0 ]; then key=10; fi 23 if [ $key -eq 0 ]; then
29 key=$(echo "$key - 1" | bc) 24 key=10
25 else
26 key=$(echo "$key - 1" | bc)
27 fi
28
30 name=$(echo "obase=2;$key" | bc | awk '{ printf "%04d", $0 }') 29 name=$(echo "obase=2;$key" | bc | awk '{ printf "%04d", $0 }')
31 tag_names+=($name) 30 tag_names+=($name)
32done; 31done;
33 32
34# Source hlwm-config-files 33# Source hlwm-config-files
35source "$HLWM_CONF_DIR/hlwm-keybindings" 34source "$HLWM_CONF_DIR/hlwm-keybindings"
36source "$HLWM_CONF_DIR/hlwm-theming"
37source "$HLWM_CONF_DIR/hlwm-rules" 35source "$HLWM_CONF_DIR/hlwm-rules"
38 36
39# Unlock, just to be sure 37# Unlock, just to be sure
40hc unlock 38hc unlock
41 39
42herbstclient set tree_style '╾│ ├└╼─┐' 40
41#Detect monitors
42hc set auto_detect_monitors 1
43hc detect_monitors
43 44
44# Start panel in all monitors 45# Start panel in all monitors
45panel=$HLWM_CONF_DIR/start_panel.sh 46panel=$HLWM_CONF_DIR/start_panel.sh
@@ -51,11 +52,16 @@ done
51pulseaudio --start 52pulseaudio --start
52 53
53$HLWM_CONF_DIR/start.sh "xautolock -time 5 -locker $HLWM_CONF_DIR/lock.sh" 54$HLWM_CONF_DIR/start.sh "xautolock -time 5 -locker $HLWM_CONF_DIR/lock.sh"
54$HLWM_CONF_DIR/start.sh "feh --bg-fill $wallpaper" 55
55$HLWM_CONF_DIR/start.sh "compton --config $HOME/.compton" 56if $HLWM_COMPOSITING; then
56$HLWM_CONF_DIR/start.sh "xrdb -load $HOME/.Xresources" 57 $HLWM_CONF_DIR/start.sh "compton --config $HOME/.compton"
57$HLWM_CONF_DIR/start.sh "xset +fp /usr/share/fonts/local" 58else
58$HLWM_CONF_DIR/start.sh "xset fp rehash" 59 pkill compton
60fi
61
62xset +fp /usr/share/fonts/local
63xset fp rehash
64
59#$HLWM_CONF_DIR/start.sh "$HLWM_CONF_DIR/notify.sh $HLWM_CONF_DIR/popup.sh" 65#$HLWM_CONF_DIR/start.sh "$HLWM_CONF_DIR/notify.sh $HLWM_CONF_DIR/popup.sh"
60 66
61# vim: set ts=4 sw=4 tw=0 et : 67# vim: set ts=4 sw=4 tw=0 et :
diff --git a/herbstluftwm/.config/herbstluftwm/hlwm-keybindings b/herbstluftwm/.config/herbstluftwm/hlwm-keybindings
index 4a6a614..cc40515 100644
--- a/herbstluftwm/.config/herbstluftwm/hlwm-keybindings
+++ b/herbstluftwm/.config/herbstluftwm/hlwm-keybindings
@@ -7,7 +7,7 @@ hc keyunbind --all
7Mod=Mod4 # Use the super key as the main modifier 7Mod=Mod4 # Use the super key as the main modifier
8 8
9hc keybind $Mod-Shift-q quit 9hc keybind $Mod-Shift-q quit
10hc keybind $Mod-Shift-r reload 10hc keybind $Mod-Shift-r chain , spawn echo "!! HLWM reload config !!" , reload
11hc keybind $Mod-Shift-c close 11hc keybind $Mod-Shift-c close
12hc keybind $Mod-Return spawn xterm 12hc keybind $Mod-Return spawn xterm
13hc keybind $Mod-grave spawn dmenu_run $dmenu_opts 13hc keybind $Mod-grave spawn dmenu_run $dmenu_opts
diff --git a/herbstluftwm/.config/herbstluftwm/hlwm-theming b/herbstluftwm/.config/herbstluftwm/hlwm-theming
index 0ffd366..aca737f 100644
--- a/herbstluftwm/.config/herbstluftwm/hlwm-theming
+++ b/herbstluftwm/.config/herbstluftwm/hlwm-theming
@@ -1,6 +1,29 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2 2
3# Add alpha channel to a hexadecimal color
4add_alpha_channel(){
5 echo "$1" | \
6 sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/"
7}
8
9#Include the theming script
10source "$HLWM_CONF_DIR/themes/current"
11
12feh --bg-scale "$HLWM_WALLPAPER"
13
3# Theme 14# Theme
15xrdb -load $HOME/.Xresources
16
17for color in "${!colors[@]}"; do
18 echo "*$color: ${colors[$color]}" | xrdb -override
19done
20
21echo "XTerm*background: $HLWM_BG_COLOR" | xrdb -override
22
23export HLWM_FG_ACOLOR=$(add_alpha_channel $HLWM_FG_COLOR)
24export HLWM_ACCENT_ACOLOR=$(add_alpha_channel $HLWM_ACCENT_COLOR)
25export HLWM_BG_ACOLOR=$(add_alpha_channel $HLWM_BG_COLOR)
26
4hc attr theme.tiling.reset 1 27hc attr theme.tiling.reset 1
5hc attr theme.floating.reset 1 28hc attr theme.floating.reset 1
6hc set frame_border_width 0 29hc set frame_border_width 0
@@ -11,21 +34,24 @@ hc set frame_active_opacity 0
11hc set frame_transparent_width 0 34hc set frame_transparent_width 0
12hc set frame_gap 0 35hc set frame_gap 0
13 36
14hc attr theme.active.color $color_accent 37hc attr theme.active.color $HLWM_ACCENT_COLOR
15hc attr theme.normal.color $color_bg 38hc attr theme.normal.color $HLWM_BG_COLOR
16hc attr theme.urgent.color orange 39hc attr theme.urgent.color orange
17hc attr theme.inner_width 1 40hc attr theme.inner_width 1
18hc attr theme.inner_color $color_bg 41hc attr theme.inner_color $HLWM_BG_COLOR
19hc attr theme.border_width 3 42hc attr theme.border_width 3
20hc attr theme.floating.border_width 4 43hc attr theme.floating.border_width 4
21hc attr theme.floating.outer_width 1 44hc attr theme.floating.outer_width 1
22hc attr theme.floating.outer_color $color_bg 45hc attr theme.floating.outer_color $HLWM_BG_COLOR
23hc attr theme.active.inner_color $color_bg 46hc attr theme.active.inner_color $HLWM_BG_COLOR
24hc attr theme.active.outer_color $color_bg 47hc attr theme.active.outer_color $HLWM_BG_COLOR
25hc attr theme.background_color $color_bg 48hc attr theme.background_color $HLWM_BG_COLOR
26 49
27hc set window_gap $window_p 50hc set window_gap $HLWM_WINDOW_PADDING
28hc set frame_padding 0 51hc set frame_padding 0
29hc set smart_window_surroundings 0 52hc set smart_window_surroundings 0
30hc set smart_frame_surroundings 1 53hc set smart_frame_surroundings 1
31hc set mouse_recenter_gap 1 54hc set mouse_recenter_gap 1
55hc set tree_style '╾│ ├└╼─┐'
56
57# vim: set ts=4 sw=4 tw=0 et :
diff --git a/herbstluftwm/.config/herbstluftwm/panel_indicators.sh b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh
index a9e71da..487cda3 100755
--- a/herbstluftwm/.config/herbstluftwm/panel_indicators.sh
+++ b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh
@@ -46,11 +46,11 @@ volume()
46 if [ -z $vol ] ; then 46 if [ -z $vol ] ; then
47 vol_status="off" 47 vol_status="off"
48 elif [ $vol -eq 0 ]; then 48 elif [ $vol -eq 0 ]; then
49 vol_status="%{F$acolor_fg}${volume_icon[0]} $vol%%{F-}" 49 vol_status="%{F$HLWM_FG_ACOLOR}${volume_icon[0]} $vol%%{F-}"
50 elif [ $vol -lt 33 ]; then 50 elif [ $vol -lt 33 ]; then
51 vol_status="%{F$acolor_fg}${volume_icon[1]} $vol%%{F-}" 51 vol_status="%{F$HLWM_FG_ACOLOR}${volume_icon[1]} $vol%%{F-}"
52 else 52 else
53 vol_status="%{F$acolor_fg}${volume_icon[2]} $vol%%{F-}" 53 vol_status="%{F$HLWM_FG_ACOLOR}${volume_icon[2]} $vol%%{F-}"
54 fi 54 fi
55 echo -e "volume\t$vol_status" 55 echo -e "volume\t$vol_status"
56 else 56 else
@@ -116,7 +116,7 @@ battery()
116 if [ $bat_state == "Charging" ] ; then 116 if [ $bat_state == "Charging" ] ; then
117 bat_status="${battery_icon[5]}" 117 bat_status="${battery_icon[5]}"
118 elif [ $bat_lvl -lt 10 ] ; then 118 elif [ $bat_lvl -lt 10 ] ; then
119 bat_status="${F$acolor_accent}${battery_icon[0]}${F-}" 119 bat_status="${F$HLWM_ACCENT_ACOLOR}${battery_icon[0]}${F-}"
120 elif [ $bat_ -lt 25 ] ; then 120 elif [ $bat_ -lt 25 ] ; then
121 bat_status="${battery_icon[1]}" 121 bat_status="${battery_icon[1]}"
122 elif [ $bat_ -lt 50 ] ; then 122 elif [ $bat_ -lt 50 ] ; then
@@ -134,7 +134,7 @@ battery()
134 134
135clock() 135clock()
136{ 136{
137 echo -e $(date +$"date\t%{F$acolor_fg}%H:%M:%S %{F$acolor_fg}(%d-%m-%Y)%{F-}") 137 echo -e $(date +$"date\t%{F$HLWM_FG_ACOLOR}%H:%M:%S %{F$HLWM_FG_ACOLOR}(%d-%m-%Y)%{F-}")
138} 138}
139 139
140# vim: set ts=4 sw=4 tw=0 et : 140# vim: set ts=4 sw=4 tw=0 et :
diff --git a/herbstluftwm/.config/herbstluftwm/populate_panel.sh b/herbstluftwm/.config/herbstluftwm/populate_panel.sh
index 7afa0c3..ddeb8c8 100755
--- a/herbstluftwm/.config/herbstluftwm/populate_panel.sh
+++ b/herbstluftwm/.config/herbstluftwm/populate_panel.sh
@@ -1,8 +1,6 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2 2
3source "$HLWM_CONF_DIR/themes/current"
4source "$HLWM_CONF_DIR/panel_indicators.sh" 3source "$HLWM_CONF_DIR/panel_indicators.sh"
5
6monitor=$1 4monitor=$1
7 5
8if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then 6if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then
@@ -50,26 +48,26 @@ fi
50 net="" 48 net=""
51 windowtitle="" 49 windowtitle=""
52 50
53 separator="%{F$acolor_accent}|%{F-}" 51 separator="%{F$HLWM_ACCENT_ACOLOR}|%{F-}"
54 52
55 while true ; do 53 while true ; do
56 54
57 for i in "${tags[@]}" ; do 55 for i in "${tags[@]}" ; do
58 case ${i:0:1} in 56 case ${i:0:1} in
59 '#') 57 '#')
60 echo -n "%{U$acolor_accent+u}%{F$acolor_fg}" 58 echo -n "%{U$HLWM_ACCENT_ACOLOR+u}%{F$HLWM_FG_ACOLOR}"
61 ;; 59 ;;
62 '+') 60 '+')
63 echo -n "%{U$acolor_fg+u}%{F$acolor_fg}" 61 echo -n "%{U$HLWM_FG_ACOLOR+u}%{F$HLWM_FG_ACOLOR}"
64 ;; 62 ;;
65 ':') 63 ':')
66 echo -n "%{F$acolor_fg}" 64 echo -n "%{F$HLWM_FG_ACOLOR}"
67 ;; 65 ;;
68 '!') 66 '!')
69 echo -n "%{B$acolor_accent}%{U$acolor_accent+u}%{F$acolor_bg}" 67 echo -n "%{B$HLWM_ACCENT_ACOLOR}%{U$HLWM_ACCENT_ACOLOR+u}%{F$HLWM_BG_ACOLOR}"
70 ;; 68 ;;
71 *) 69 *)
72 echo -n "%{F$acolor_fg}" 70 echo -n "%{F$HLWM_FG_ACOLOR}"
73 ;; 71 ;;
74 esac 72 esac
75 echo -n "%{A:tag,${i:1}:} ${i:1} %{A}%{F-}%{U-u}%{B-}" 73 echo -n "%{A:tag,${i:1}:} ${i:1} %{A}%{F-}%{U-u}%{B-}"
diff --git a/herbstluftwm/.config/herbstluftwm/popup.sh b/herbstluftwm/.config/herbstluftwm/popup.sh
index eda37f5..b9980e2 100755
--- a/herbstluftwm/.config/herbstluftwm/popup.sh
+++ b/herbstluftwm/.config/herbstluftwm/popup.sh
@@ -29,7 +29,7 @@ if test ! $message; then
29 help 29 help
30else 30else
31 31
32 bar_opts="-f $font,$font_sec -B $acolor_bg -F $acolor_fg -g ${popup_width}x${height}+${popup_x}+${popup_y} -u 2" 32 bar_opts="-f $HLWM_PANEL_FONT,$font_sec -B $HLWM_BG_ACOLOR -F $HLWM_FG_ACOLOR -g ${popup_width}x${height}+${popup_x}+${popup_y} -u 2"
33 33
34 t=$(date +%T) 34 t=$(date +%T)
35 35
@@ -40,7 +40,7 @@ else
40 fi 40 fi
41 41
42 { 42 {
43 echo "%{F$acolor_accent} $prefix %{F$acolor_fg}$message %{F$acolor_fg}($t)%{F-}" 43 echo "%{F$HLWM_ACCENT_ACOLOR} $prefix %{F$HLWM_FG_ACOLOR}$message %{F$HLWM_FG_ACOLOR}($t)%{F-}"
44 sleep $timeout 44 sleep $timeout
45 } | bar $bar_opts 45 } | bar $bar_opts
46fi 46fi
diff --git a/herbstluftwm/.config/herbstluftwm/start_panel.sh b/herbstluftwm/.config/herbstluftwm/start_panel.sh
index 42e33fd..13ea6e2 100755
--- a/herbstluftwm/.config/herbstluftwm/start_panel.sh
+++ b/herbstluftwm/.config/herbstluftwm/start_panel.sh
@@ -1,5 +1,5 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2source "$HLWM_CONF_DIR/themes/current" 2
3source "$HLWM_CONF_DIR/panel_indicators.sh" 3source "$HLWM_CONF_DIR/panel_indicators.sh"
4 4
5# Check for valid monitors 5# Check for valid monitors
@@ -19,16 +19,16 @@ for pid in $pids; do
19done 19done
20 20
21# Geometry has the format W H X Y 21# Geometry has the format W H X Y
22x=$(echo "${geometry[0]} + $window_p" | bc) 22x=$(echo "${geometry[0]} + $HLWM_WINDOW_PADDING" | bc)
23y=$(echo "${geometry[1]} + $window_p" | bc) 23y=$(echo "${geometry[1]} + $HLWM_WINDOW_PADDING" | bc)
24panel_width=$(echo "${geometry[2]} - (2 * $window_p)" | bc) 24panel_width=$(echo "${geometry[2]} - (2 * $HLWM_WINDOW_PADDING)" | bc)
25 25
26# Apply padding to make room for the panel 26# Apply padding to make room for the panel
27hc pad $monitor $(echo "$panel_h + $window_p" | bc) 27hc pad $monitor $(echo "$HLWM_PANEL_HEIGHT + $HLWM_WINDOW_PADDING" | bc)
28 28
29# Start the panel 29# Start the panel
30$HLWM_CONF_DIR/populate_panel.sh $monitor | 30$HLWM_CONF_DIR/populate_panel.sh $monitor |
31lemonbar -g ${panel_width}x${panel_h}+${x}+${y} -f "$font" -f "$icon_font" -u2 -B$acolor_bg -F$acolor_fg | 31lemonbar -g ${panel_width}x${HLWM_PANEL_HEIGHT}+${x}+${y} -f "$HLWM_PANEL_FONT" -f "$icon_font" -u2 -B$HLWM_BG_ACOLOR -F$HLWM_FG_ACOLOR |
32$HLWM_CONF_DIR/panel_handler.sh 32$HLWM_CONF_DIR/panel_handler.sh
33 33
34# vim: set ts=4 sw=4 tw=0 et : 34# vim: set ts=4 sw=4 tw=0 et :
diff --git a/herbstluftwm/.config/herbstluftwm/themes/purpur b/herbstluftwm/.config/herbstluftwm/themes/purpur
index 5fedc6d..88a5758 100644
--- a/herbstluftwm/.config/herbstluftwm/themes/purpur
+++ b/herbstluftwm/.config/herbstluftwm/themes/purpur
@@ -1,34 +1,30 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2 2
3# Get color from ~/.Xresources 3declare -A colors
4get_x_color() { 4colors=(["background"]="#2d2d2d" ["foreground"]="#f9f9f9"
5 xresources=$(cat ~/.Xresources) 5 ["color0"]="#2d2d2d" ["color8"]="#333333"
6 color=$(echo $xresources | sed "s/.*\*color$1: \(\#[0-9A-Fa-f]*\).*/\1/") 6 ["color1"]="#690a03" ["color9"]="#d64937"
7 echo $color 7 ["color2"]="#13a43b" ["color10"]="#6dfb2d"
8} 8 ["color3"]="#f5a711" ["color11"]="#ffdc00"
9 9 ["color4"]="#0f6cc9" ["color12"]="#32abd8"
10# Add alpha channel to a hexadecimal color 10 ["color5"]="#93116b" ["color13"]="#c61f93"
11add_alpha_channel(){ 11 ["color6"]="#3cb691" ["color14"]="#53b4bd"
12 echo "$1" | \ 12 ["color7"]="#d9d9d9" ["color15"]="#f9f9f9")
13 sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/"
14}
15 13
16# Wallpaper 14# Wallpaper
17wallpaper="$HOME/.config/herbstluftwm/poligons.png" 15export HLWM_WALLPAPER="$HOME/.config/herbstluftwm/wallpapers/poligons.png"
16
17# Shadow
18export HLWM_COMPOSITING=true
18 19
19# Padding 20# Padding
20window_p=20 21export HLWM_WINDOW_PADDING=20
21 22
22# Panel 23# Panel
23panel_h=25 24export HLWM_PANEL_HEIGHT=25
24font="DejaVu Sans Mono-10" 25export HLWM_PANEL_FONT="DejaVu Sans Mono-10"
25 26
26# Colors 27# Colors
27color_fg=$(get_x_color 15) 28export HLWM_FG_COLOR=${colors["color15"]}
28color_accent=$(get_x_color 5) 29export HLWM_ACCENT_COLOR=${colors["color5"]}
29color_bg=$(get_x_color 0) 30export HLWM_BG_COLOR=${colors["color0"]}
30
31# Alpha Colors for use with bar
32acolor_fg=$(add_alpha_channel $color_fg)
33acolor_accent=$(add_alpha_channel $color_accent)
34acolor_bg=$(add_alpha_channel $color_bg)
diff --git a/herbstluftwm/.config/herbstluftwm/poligons.png b/herbstluftwm/.config/herbstluftwm/wallpapers/poligons.png
index e5c7cda..e5c7cda 100644
--- a/herbstluftwm/.config/herbstluftwm/poligons.png
+++ b/herbstluftwm/.config/herbstluftwm/wallpapers/poligons.png
Binary files differ