diff options
| author | 2014-11-12 23:09:37 +0100 | |
|---|---|---|
| committer | 2014-11-12 23:09:37 +0100 | |
| commit | ba4a9bca449de7e0f9ad0b1d2ebc104a45036638 (patch) | |
| tree | 2300daf0eb0e69b35093f45a09071b7552145c47 /herbstluftwm | |
| parent | 3efac7403aeb3448a41faaa9a8e65d37475172b9 (diff) | |
| download | dotfiles-ba4a9bca449de7e0f9ad0b1d2ebc104a45036638.tar.gz dotfiles-ba4a9bca449de7e0f9ad0b1d2ebc104a45036638.tar.bz2 dotfiles-ba4a9bca449de7e0f9ad0b1d2ebc104a45036638.zip | |
Put theme vars in a separate file
Diffstat (limited to 'herbstluftwm')
| -rwxr-xr-x | herbstluftwm/.config/herbstluftwm/autostart | 63 | ||||
| -rwxr-xr-x | herbstluftwm/.config/herbstluftwm/panel.sh | 72 | ||||
| -rw-r--r-- | herbstluftwm/.config/herbstluftwm/theme | 35 |
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 | ||
| 9 | get_x_color() { | 9 | dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 10 | xresources=$(cat ~/.Xresources) | 10 | source "$dir/theme" |
| 11 | color=$(echo $xresources | sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/") | ||
| 12 | echo $color | ||
| 13 | } | ||
| 14 | |||
| 15 | hlwm_scripts="$HOME/.config/herbstluftwm" | ||
| 16 | |||
| 17 | #wallpaper | ||
| 18 | wallpaper="/home/tom/Pictures/fall1.jpg" | ||
| 19 | |||
| 20 | #Numix color palette | ||
| 21 | export WM_LIGHT=$(get_x_color 15) | ||
| 22 | export WM_LLIGHT=$(get_x_color 7) | ||
| 23 | export WM_ACCENT=$(get_x_color 9) | ||
| 24 | export WM_LDARK=$(get_x_color 8) | ||
| 25 | export WM_DARK=$(get_x_color 0) | ||
| 26 | 11 | ||
| 27 | #Detect monitors | 12 | #Detect monitors |
| 28 | hc set auto_detect_monitors 1 | 13 | hc set auto_detect_monitors 1 |
| 29 | hc detect_monitors | 14 | hc detect_monitors |
| 30 | 15 | ||
| 31 | #Panel and window_p | 16 | #Panel and window_p |
| 32 | window_p=20 | ||
| 33 | monitor_w=($(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/')) | 17 | monitor_w=($(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/')) |
| 34 | panel_h=24 | ||
| 35 | panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc) | 18 | panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc) |
| 36 | dmenu_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" | 19 | dmenu_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 | |||
| 38 | hc emir_hook reload | ||
| 39 | 20 | ||
| 40 | # remove all existing keybindings | 21 | # remove all existing keybindings |
| 41 | hc keyunbind --all | 22 | hc keyunbind --all |
| @@ -135,10 +116,6 @@ hc set focus_follows_mouse 1 | |||
| 135 | # theme | 116 | # theme |
| 136 | hc attr theme.tiling.reset 1 | 117 | hc attr theme.tiling.reset 1 |
| 137 | hc attr theme.floating.reset 1 | 118 | hc attr theme.floating.reset 1 |
| 138 | hc set frame_border_active_color $WM_LDARK | ||
| 139 | hc set frame_border_normal_color $WM_DARK | ||
| 140 | hc set frame_bg_normal_color $WM_LDARK | ||
| 141 | hc set frame_bg_active_color $WM_DARK | ||
| 142 | hc set frame_border_width 0 | 119 | hc set frame_border_width 0 |
| 143 | hc set always_show_frame 0 | 120 | hc set always_show_frame 0 |
| 144 | hc set frame_bg_transparent 1 | 121 | hc set frame_bg_transparent 1 |
| @@ -147,18 +124,18 @@ hc set frame_active_opacity 0 | |||
| 147 | hc set frame_transparent_width 0 | 124 | hc set frame_transparent_width 0 |
| 148 | hc set frame_gap 0 | 125 | hc set frame_gap 0 |
| 149 | 126 | ||
| 150 | hc attr theme.active.color $WM_ACCENT | 127 | hc attr theme.active.color $color_accent |
| 151 | hc attr theme.normal.color $WM_DARK | 128 | hc attr theme.normal.color $color_bg |
| 152 | hc attr theme.urgent.color orange | 129 | hc attr theme.urgent.color orange |
| 153 | hc attr theme.inner_width 1 | 130 | hc attr theme.inner_width 1 |
| 154 | hc attr theme.inner_color $WM_DARK | 131 | hc attr theme.inner_color $color_bg |
| 155 | hc attr theme.border_width 3 | 132 | hc attr theme.border_width 3 |
| 156 | hc attr theme.floating.border_width 4 | 133 | hc attr theme.floating.border_width 4 |
| 157 | hc attr theme.floating.outer_width 1 | 134 | hc attr theme.floating.outer_width 1 |
| 158 | hc attr theme.floating.outer_color $WM_DARK | 135 | hc attr theme.floating.outer_color $color_bg |
| 159 | hc attr theme.active.inner_color $WM_DARK | 136 | hc attr theme.active.inner_color $color_bg |
| 160 | hc attr theme.active.outer_color $WM_DARK | 137 | hc attr theme.active.outer_color $color_bg |
| 161 | hc attr theme.background_color $WM_DARK | 138 | hc attr theme.background_color $color_bg |
| 162 | 139 | ||
| 163 | hc set window_gap $window_p | 140 | hc set window_gap $window_p |
| 164 | hc set frame_padding 0 | 141 | hc set frame_padding 0 |
| @@ -185,12 +162,12 @@ herbstclient set tree_style '╾│ ├└╼─┐' | |||
| 185 | #Start panel in all monitors | 162 | #Start panel in all monitors |
| 186 | start_panel() { | 163 | start_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 |
| 193 | panel=$hlwm_scripts/panel.sh | 170 | panel=$dir/panel.sh |
| 194 | [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh | 171 | [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh |
| 195 | if pgrep panel.sh >> /dev/null | 172 | if pgrep panel.sh >> /dev/null |
| 196 | then | 173 | then |
| @@ -202,11 +179,11 @@ fi | |||
| 202 | 179 | ||
| 203 | pulseaudio --start | 180 | pulseaudio --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 | ||
| 7 | add_alpha_channel(){ | 7 | dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 8 | echo "$1" | \ | 8 | source "$dir/theme" |
| 9 | sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" | ||
| 10 | } | ||
| 11 | 9 | ||
| 12 | monitor=${1:-0} | 10 | monitor=${1:-0} |
| 13 | panel_height=$2 | ||
| 14 | padding=$3 | ||
| 15 | |||
| 16 | light=$(add_alpha_channel $WM_LIGHT) | ||
| 17 | llight=$(add_alpha_channel $WM_LLIGHT) | ||
| 18 | accent=$(add_alpha_channel $WM_ACCENT) | ||
| 19 | ldark=$(add_alpha_channel $WM_LDARK) | ||
| 20 | dark=$(add_alpha_channel $WM_DARK) | ||
| 21 | |||
| 22 | font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" | ||
| 23 | font2="-*-stlarch-medium-*-*-*-10-*-*-*-*-*-*-*" | ||
| 24 | selected_bg=$accent | ||
| 25 | normal_bg=$dark | ||
| 26 | selected_txt=$dark | ||
| 27 | normal_txt=$light | ||
| 28 | inactive_txt=$llight | ||
| 29 | 11 | ||
| 30 | geometry=( $(herbstclient monitor_rect "$monitor") ) | 12 | geometry=( $(herbstclient monitor_rect "$monitor") ) |
| 31 | if [ -z "$geometry" ] ;then | 13 | if [ -z "$geometry" ] ;then |
| @@ -33,12 +15,12 @@ if [ -z "$geometry" ] ;then | |||
| 33 | exit 1 | 15 | exit 1 |
| 34 | fi | 16 | fi |
| 35 | # geometry has the format W H X Y | 17 | # geometry has the format W H X Y |
| 36 | x=$(echo "${geometry[0]} + $padding" | bc) | 18 | x=$(echo "${geometry[0]} + $window_p" | bc) |
| 37 | y=$(echo "${geometry[1]} + $padding" | bc) | 19 | y=$(echo "${geometry[1]} + $window_p" | bc) |
| 38 | panel_width=$(echo "${geometry[2]} - (2 * $padding)" | bc) | 20 | panel_width=$(echo "${geometry[2]} - (2 * $window_p)" | bc) |
| 39 | bar_opts="-g ${panel_width}x${panel_height}+${x}+${y} -f $font,$font2 -u 2 -B $normal_bg -F $normal_txt" | 21 | bar_opts="-g ${panel_width}x${panel_h}+${x}+${y} -f $font,$font_sec -u 2 -B $acolor_bg -F $acolor_fg" |
| 40 | 22 | ||
| 41 | hc pad $monitor $(echo "$panel_height + $padding" | bc) | 23 | hc pad $monitor $(echo "$panel_h + $window_p" | bc) |
| 42 | 24 | ||
| 43 | if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then | 25 | if 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 | |||
