diff options
| -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 | 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 | ||
| 4 | get_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 | ||
| 11 | add_alpha_channel(){ | ||
| 12 | echo "$1" | \ | ||
| 13 | sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" | ||
| 14 | } | ||
| 15 | |||
| 16 | # Wallpaper | ||
| 17 | wallpaper="/home/tom/Pictures/fall1.jpg" | ||
| 18 | |||
| 19 | # Padding | ||
| 20 | window_p=20 | ||
| 21 | |||
| 22 | # Panel | ||
| 23 | panel_h=24 | ||
| 24 | font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" | ||
| 25 | font_sec="-*-stlarch-medium-*-*-*-10-*-*-*-*-*-*-*" | ||
| 26 | |||
| 27 | # Colors | ||
| 28 | color_fg=$(get_x_color 15) | ||
| 29 | color_accent=$(get_x_color 9) | ||
| 30 | color_bg=$(get_x_color 0) | ||
| 31 | |||
| 32 | # Alpha Colors for use with bar | ||
| 33 | acolor_fg=$(add_alpha_channel $color_fg) | ||
| 34 | acolor_accent=$(add_alpha_channel $color_accent) | ||
| 35 | acolor_bg=$(add_alpha_channel $color_bg) | ||
