diff options
| author | 2014-10-25 22:26:54 +0200 | |
|---|---|---|
| committer | 2014-10-25 22:26:54 +0200 | |
| commit | 3e94a3e724c36267fa2e4039e3759473c59e8510 (patch) | |
| tree | 379d0598c0d26d3b0c746604d80bb9e803371fb0 /.config/herbstluftwm | |
| parent | 8ecace69cb3b35ac6b72859ebf0be70d11d2d71e (diff) | |
| download | dotfiles-3e94a3e724c36267fa2e4039e3759473c59e8510.tar.gz dotfiles-3e94a3e724c36267fa2e4039e3759473c59e8510.tar.bz2 dotfiles-3e94a3e724c36267fa2e4039e3759473c59e8510.zip | |
Restructured dotfile repo to take advantage of GNU Stow
Diffstat (limited to '.config/herbstluftwm')
| -rwxr-xr-x | .config/herbstluftwm/autostart | 203 | ||||
| -rw-r--r-- | .config/herbstluftwm/dependencylist | 12 | ||||
| -rwxr-xr-x | .config/herbstluftwm/lock.sh | 7 | ||||
| -rwxr-xr-x | .config/herbstluftwm/notify.sh | 30 | ||||
| -rwxr-xr-x | .config/herbstluftwm/panel.sh | 219 | ||||
| -rwxr-xr-x | .config/herbstluftwm/popup.sh | 60 | ||||
| -rwxr-xr-x | .config/herbstluftwm/start.sh | 13 |
7 files changed, 0 insertions, 544 deletions
diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart deleted file mode 100755 index 109ea43..0000000 --- a/.config/herbstluftwm/autostart +++ /dev/null | |||
| @@ -1,203 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # this is a simple config for herbstluftwm | ||
| 4 | |||
| 5 | hc() { | ||
| 6 | herbstclient "$@" | ||
| 7 | } | ||
| 8 | |||
| 9 | get_x_color() { | ||
| 10 | xresources=$(cat ~/.Xresources) | ||
| 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 | |||
| 27 | #Panel and window_p | ||
| 28 | window_p=20 | ||
| 29 | monitor_w=$(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/') | ||
| 30 | panel_h=24 | ||
| 31 | panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc) | ||
| 32 | 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" | ||
| 33 | |||
| 34 | hc emir_hook reload | ||
| 35 | |||
| 36 | # remove all existing keybindings | ||
| 37 | hc keyunbind --all | ||
| 38 | |||
| 39 | # keybindings | ||
| 40 | Mod=Mod4 # Use the super key as the main modifier | ||
| 41 | |||
| 42 | hc keybind $Mod-Shift-q quit | ||
| 43 | hc keybind $Mod-Shift-r reload | ||
| 44 | hc keybind $Mod-Shift-c close | ||
| 45 | hc keybind $Mod-Return spawn xterm | ||
| 46 | hc keybind $Mod-grave spawn dmenu_run $dmenu_opts | ||
| 47 | hc keybind XF86AudioLowerVolume spawn amixer set Master 5%- | ||
| 48 | hc keybind XF86AudioRaiseVolume spawn amixer set Master 5%+ | ||
| 49 | |||
| 50 | # basic movement | ||
| 51 | # focusing clients | ||
| 52 | hc keybind $Mod-Left focus left | ||
| 53 | hc keybind $Mod-Down focus down | ||
| 54 | hc keybind $Mod-Up focus up | ||
| 55 | hc keybind $Mod-Right focus right | ||
| 56 | hc keybind $Mod-h focus left | ||
| 57 | hc keybind $Mod-j focus down | ||
| 58 | hc keybind $Mod-k focus up | ||
| 59 | hc keybind $Mod-l focus right | ||
| 60 | |||
| 61 | # moving clients | ||
| 62 | hc keybind $Mod-Shift-Left shift left | ||
| 63 | hc keybind $Mod-Shift-Down shift down | ||
| 64 | hc keybind $Mod-Shift-Up shift up | ||
| 65 | hc keybind $Mod-Shift-Right shift right | ||
| 66 | hc keybind $Mod-Shift-h shift left | ||
| 67 | hc keybind $Mod-Shift-j shift down | ||
| 68 | hc keybind $Mod-Shift-k shift up | ||
| 69 | hc keybind $Mod-Shift-l shift right | ||
| 70 | |||
| 71 | # splitting frames | ||
| 72 | # create an empty frame at the specified direction | ||
| 73 | hc keybind $Mod-u split bottom 0.5 | ||
| 74 | hc keybind $Mod-o split right 0.5 | ||
| 75 | # let the current frame explode into subframes | ||
| 76 | hc keybind $Mod-Control-space split explode | ||
| 77 | |||
| 78 | # resizing frames | ||
| 79 | resizestep=0.05 | ||
| 80 | hc keybind $Mod-Control-h resize left +$resizestep | ||
| 81 | hc keybind $Mod-Control-j resize down +$resizestep | ||
| 82 | hc keybind $Mod-Control-k resize up +$resizestep | ||
| 83 | hc keybind $Mod-Control-l resize right +$resizestep | ||
| 84 | hc keybind $Mod-Control-Left resize left +$resizestep | ||
| 85 | hc keybind $Mod-Control-Down resize down +$resizestep | ||
| 86 | hc keybind $Mod-Control-Up resize up +$resizestep | ||
| 87 | hc keybind $Mod-Control-Right resize right +$resizestep | ||
| 88 | |||
| 89 | # tags | ||
| 90 | tag_names=( I II III IV V VI VII VIII IX X ) | ||
| 91 | tag_keys=( {1..9} 0 ) | ||
| 92 | |||
| 93 | # Selecting workspaces | ||
| 94 | hc keybind Alt-Control-Left use_index -1 | ||
| 95 | hc keybind Alt-Control-Right use_index +1 | ||
| 96 | hc rename default "${tag_names[0]}" || true | ||
| 97 | for i in ${!tag_names[@]} ; do | ||
| 98 | hc add "${tag_names[$i]}" | ||
| 99 | key="${tag_keys[$i]}" | ||
| 100 | if ! [ -z "$key" ] ; then | ||
| 101 | hc keybind "$Mod-$key" use_index "$i" | ||
| 102 | hc keybind "$Mod-Shift-$key" move_index "$i" | ||
| 103 | fi | ||
| 104 | done | ||
| 105 | |||
| 106 | # cycle through tags | ||
| 107 | hc keybind $Mod-period use_index +1 --skip-visible | ||
| 108 | hc keybind $Mod-comma use_index -1 --skip-visible | ||
| 109 | |||
| 110 | # layouting | ||
| 111 | hc keybind $Mod-r remove | ||
| 112 | hc keybind $Mod-space cycle_layout 1 | ||
| 113 | hc keybind $Mod-s floating toggle | ||
| 114 | hc keybind $Mod-f fullscreen toggle | ||
| 115 | hc keybind $Mod-p pseudotile toggle | ||
| 116 | |||
| 117 | # mouse | ||
| 118 | hc mouseunbind --all | ||
| 119 | hc mousebind $Mod-Button1 move | ||
| 120 | hc mousebind $Mod-Button2 zoom | ||
| 121 | hc mousebind $Mod-Button3 resize | ||
| 122 | |||
| 123 | # focus | ||
| 124 | hc keybind $Mod-BackSpace cycle_monitor | ||
| 125 | hc keybind $Mod-Tab cycle_all +1 | ||
| 126 | hc keybind $Mod-Shift-Tab cycle_all -1 | ||
| 127 | hc keybind $Mod-c cycle | ||
| 128 | hc keybind $Mod-i jumpto urgent | ||
| 129 | hc set focus_follows_mouse 1 | ||
| 130 | |||
| 131 | # theme | ||
| 132 | hc attr theme.tiling.reset 1 | ||
| 133 | hc attr theme.floating.reset 1 | ||
| 134 | hc set frame_border_active_color $WM_LDARK | ||
| 135 | hc set frame_border_normal_color $WM_DARK | ||
| 136 | hc set frame_bg_normal_color $WM_LDARK | ||
| 137 | hc set frame_bg_active_color $WM_DARK | ||
| 138 | hc set frame_border_width 0 | ||
| 139 | hc set always_show_frame 0 | ||
| 140 | hc set frame_bg_transparent 1 | ||
| 141 | hc set frame_transparent_width 0 | ||
| 142 | hc set frame_gap 0 | ||
| 143 | |||
| 144 | hc attr theme.active.color $WM_ACCENT | ||
| 145 | hc attr theme.normal.color $WM_DARK | ||
| 146 | hc attr theme.urgent.color orange | ||
| 147 | hc attr theme.inner_width 1 | ||
| 148 | hc attr theme.inner_color $WM_DARK | ||
| 149 | hc attr theme.border_width 3 | ||
| 150 | hc attr theme.floating.border_width 4 | ||
| 151 | hc attr theme.floating.outer_width 1 | ||
| 152 | hc attr theme.floating.outer_color $WM_DARK | ||
| 153 | hc attr theme.active.inner_color $WM_DARK | ||
| 154 | hc attr theme.active.outer_color $WM_DARK | ||
| 155 | hc attr theme.background_color $WM_DARK | ||
| 156 | |||
| 157 | hc set window_gap $window_p | ||
| 158 | hc set frame_padding 0 | ||
| 159 | hc set smart_window_surroundings 0 | ||
| 160 | hc set smart_frame_surroundings 1 | ||
| 161 | hc set mouse_recenter_gap 1 | ||
| 162 | |||
| 163 | # rules | ||
| 164 | hc unrule -F | ||
| 165 | #hc rule class=XTerm tag=3 # move all xterms to tag 3 | ||
| 166 | hc rule focus=on # normally focus new clients | ||
| 167 | #hc rule focus=off # normally do not focus new clients | ||
| 168 | # give focus to most common terminals | ||
| 169 | #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on | ||
| 170 | hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on | ||
| 171 | hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on | ||
| 172 | hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off | ||
| 173 | |||
| 174 | # unlock, just to be sure | ||
| 175 | hc unlock | ||
| 176 | |||
| 177 | herbstclient set tree_style '╾│ ├└╼─┐' | ||
| 178 | |||
| 179 | #Start panel in all monitors | ||
| 180 | start_panel() { | ||
| 181 | for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do | ||
| 182 | "$1" $monitor $panel_h $window_p & | ||
| 183 | done | ||
| 184 | } | ||
| 185 | |||
| 186 | # find the panel | ||
| 187 | panel=$hlwm_scripts/panel.sh | ||
| 188 | [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh | ||
| 189 | if pgrep panel.sh >> /dev/null | ||
| 190 | then | ||
| 191 | kill $(pgrep panel.sh) | ||
| 192 | start_panel $panel | ||
| 193 | else | ||
| 194 | start_panel $panel | ||
| 195 | fi | ||
| 196 | |||
| 197 | $hlwm_scripts/start.sh "xautolock -time 5 -locker $hlwm_scripts/lock.sh" | ||
| 198 | $hlwm_scripts/start.sh "feh --bg-fill $wallpaper" | ||
| 199 | $hlwm_scripts/start.sh "compton --config $HOME/.compton" | ||
| 200 | $hlwm_scripts/start.sh "xrdb -load $HOME/.Xresources" | ||
| 201 | $hlwm_scripts/start.sh "pulseaudio --start" | ||
| 202 | $hlwm_scripts/start.sh "dropboxd" | ||
| 203 | $hlwm_scripts/start.sh "$hlwm_scripts/notify.sh $monitor_w $window_p $panel_h $hlwm_scripts/popup.sh" | ||
diff --git a/.config/herbstluftwm/dependencylist b/.config/herbstluftwm/dependencylist deleted file mode 100644 index a18055d..0000000 --- a/.config/herbstluftwm/dependencylist +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | compton | ||
| 2 | bar-aint-recursive | ||
| 3 | bc | ||
| 4 | wireless_tools | ||
| 5 | dmenu2 | ||
| 6 | feh | ||
| 7 | pulseaudio | ||
| 8 | alsa-utils | ||
| 9 | sed | ||
| 10 | i3lock | ||
| 11 | scrot | ||
| 12 | xautolock | ||
diff --git a/.config/herbstluftwm/lock.sh b/.config/herbstluftwm/lock.sh deleted file mode 100755 index 04c4638..0000000 --- a/.config/herbstluftwm/lock.sh +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | SCREENCAP="/tmp/lock.png" | ||
| 4 | scrot $SCREENCAP | ||
| 5 | convert -gaussian-blur "12x3" $SCREENCAP $SCREENCAP | ||
| 6 | i3lock -i $SCREENCAP | ||
| 7 | rm $SCREENCAP | ||
diff --git a/.config/herbstluftwm/notify.sh b/.config/herbstluftwm/notify.sh deleted file mode 100755 index 190d496..0000000 --- a/.config/herbstluftwm/notify.sh +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | monitor_w=$1 | ||
| 4 | window_p=$2 | ||
| 5 | panel_h=$3 | ||
| 6 | |||
| 7 | popup_w=$(echo "$monitor_w - (2 * $window_p)" | bc) | ||
| 8 | popup_h=$panel_h | ||
| 9 | popup_x=$window_p | ||
| 10 | popup_y=$window_p | ||
| 11 | |||
| 12 | popup_opts="-w $popup_w -h $popup_h -x $popup_x -y $popup_y" | ||
| 13 | |||
| 14 | while 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; | ||
| 30 | done | ||
diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh deleted file mode 100755 index 24d0e12..0000000 --- a/.config/herbstluftwm/panel.sh +++ /dev/null | |||
| @@ -1,219 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | hc() { | ||
| 4 | "${herbstclient_command[@]:-herbstclient}" "$@" ; | ||
| 5 | } | ||
| 6 | |||
| 7 | add_alpha_channel(){ | ||
| 8 | echo "$1" | \ | ||
| 9 | sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" | ||
| 10 | } | ||
| 11 | |||
| 12 | 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 | #font="" | ||
| 24 | selected_bg=$accent | ||
| 25 | normal_bg=$dark | ||
| 26 | selected_txt=$dark | ||
| 27 | normal_txt=$light | ||
| 28 | inactive_txt=$llight | ||
| 29 | |||
| 30 | geometry=( $(herbstclient monitor_rect "$monitor") ) | ||
| 31 | if [ -z "$geometry" ] ;then | ||
| 32 | echo "Invalid monitor $monitor" | ||
| 33 | exit 1 | ||
| 34 | fi | ||
| 35 | # geometry has the format W H X Y | ||
| 36 | x=$(echo "${geometry[0]} + $padding" | bc) | ||
| 37 | y=$(echo "${geometry[1]} + $padding" | bc) | ||
| 38 | panel_width=$(echo "${geometry[2]} - (2 * $padding)" | bc) | ||
| 39 | bar_opts="-g ${panel_width}x${panel_height}+${x}+${y} -f ${font} -u 2 -B ${normal_bg} -F ${normal_txt}" | ||
| 40 | |||
| 41 | hc pad $monitor $(echo "$panel_height + $padding" | bc) | ||
| 42 | |||
| 43 | if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then | ||
| 44 | # mawk needs "-W interactive" to line-buffer stdout correctly | ||
| 45 | # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593504 | ||
| 46 | uniq_linebuffered() { | ||
| 47 | awk -W interactive '$0 != l { print ; l=$0 ; fflush(); }' "$@" | ||
| 48 | } | ||
| 49 | else | ||
| 50 | # other awk versions (e.g. gawk) issue a warning with "-W interactive", so | ||
| 51 | # we don't want to use it there. | ||
| 52 | uniq_linebuffered() { | ||
| 53 | awk '$0 != l { print ; l=$0 ; fflush(); }' "$@" | ||
| 54 | } | ||
| 55 | fi | ||
| 56 | |||
| 57 | { | ||
| 58 | ### Event generator ### | ||
| 59 | # <eventname>\t<data> [...] | ||
| 60 | # e.g. | ||
| 61 | # date ^fg(#efefef)18:33^fg(#909090), 2013-10-^fg(#efefef)29 | ||
| 62 | |||
| 63 | while true ; do | ||
| 64 | # Volume | ||
| 65 | if pgrep pulseaudio > /dev/null ; then | ||
| 66 | volumes=$(\ | ||
| 67 | amixer get Master | \ | ||
| 68 | grep "Mono: Playback"\ | ||
| 69 | ) | ||
| 70 | vol=$(\ | ||
| 71 | echo $volumes | \ | ||
| 72 | sed "s/.*\[\([0-9]*\)%\].*/\1/"\ | ||
| 73 | ) | ||
| 74 | if [ -z $vol ] ; then | ||
| 75 | echo -e "volume\toff" | ||
| 76 | elif [ $vol -le 0 ] ; then | ||
| 77 | echo -e "volume\t%{F$normal_txt}Volume muted" | ||
| 78 | else | ||
| 79 | echo -e "volume\t%{F$normal_txt}Volume: $vol%%%{F-}" | ||
| 80 | fi | ||
| 81 | else | ||
| 82 | echo -e "volume\toff" | ||
| 83 | fi | ||
| 84 | |||
| 85 | # Network | ||
| 86 | iwconfig=$(iwconfig wlp3s0) | ||
| 87 | if [ -z $iwconfig ] ; then | ||
| 88 | echo -e "net\toff" | ||
| 89 | else | ||
| 90 | ssid=$(\ | ||
| 91 | echo $iwconfig | \ | ||
| 92 | sed "s/.*ESSID:\(\".*\"\).*/\1/" | \ | ||
| 93 | sed "s/.*\(off\/any\).*/\"\1\"/" | \ | ||
| 94 | sed "s/.*\"\(.*\)\".*/\1/"\ | ||
| 95 | ) | ||
| 96 | if [ $ssid = "off/any" ] ; then | ||
| 97 | ifconf=$ | ||
| 98 | echo -e "net\t%{F$normal_txt}Net: No connection%{F-}" | ||
| 99 | else | ||
| 100 | echo -e "net\t%{F$normal_txt}Net: $ssid%{F-}" | ||
| 101 | fi | ||
| 102 | fi | ||
| 103 | |||
| 104 | # Battery | ||
| 105 | if $(test -e /sys/class/power_supply/BAT1) ; then | ||
| 106 | bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) | ||
| 107 | if [ $bat_lvl -lt 15 ] ; then | ||
| 108 | bat_color=$accent | ||
| 109 | else | ||
| 110 | bat_color=$normal_txt | ||
| 111 | fi | ||
| 112 | state=$(cat /sys/class/power_supply/BAT1/status) | ||
| 113 | echo -e "battery\t%{F$normal_txt}$state: %{F$bat_color}$bat_lvl%{F$normal_txt}%%%{F-}" | ||
| 114 | else | ||
| 115 | echo -e "battery\toff" | ||
| 116 | fi | ||
| 117 | |||
| 118 | # Time | ||
| 119 | echo -e $(date +$"date\t%{F$normal_txt}%H:%M:%S %{F$inactive_txt}(%d-%m-%Y)%{F-}") | ||
| 120 | sleep 1 || break | ||
| 121 | done > >(uniq_linebuffered) & | ||
| 122 | childpid=$! | ||
| 123 | hc --idle | ||
| 124 | kill $childpid | ||
| 125 | } 2> /dev/null | { | ||
| 126 | |||
| 127 | IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" | ||
| 128 | visible=true | ||
| 129 | date="" | ||
| 130 | volume="" | ||
| 131 | battery="" | ||
| 132 | net="" | ||
| 133 | windowtitle="" | ||
| 134 | while true ; do | ||
| 135 | separator="%{F$accent}|%{F-}" | ||
| 136 | # draw tags | ||
| 137 | for i in "${tags[@]}" ; do | ||
| 138 | case ${i:0:1} in | ||
| 139 | '#') | ||
| 140 | echo -n "%{U$accent+u}%{B-}%{F$normal_txt}" | ||
| 141 | ;; | ||
| 142 | '+') | ||
| 143 | echo -n "%{B$accent}%{F$normal_bg}" | ||
| 144 | ;; | ||
| 145 | ':') | ||
| 146 | echo -n "%{B-}%{F$normal_txt}" | ||
| 147 | ;; | ||
| 148 | '!') | ||
| 149 | echo -n "%{B$normal_txt}%{F$normal_bg}" | ||
| 150 | ;; | ||
| 151 | *) | ||
| 152 | echo -n "%{B-}%{F$inactive_txt}" | ||
| 153 | ;; | ||
| 154 | esac | ||
| 155 | echo -n "%{A:tag,${i:1}:} ${i:1} %{A}%{F-}%{B-}%{U-u}" | ||
| 156 | done | ||
| 157 | echo -n "$separator" | ||
| 158 | echo -n "%{B-}%{F-} ${windowtitle//^/^^}" | ||
| 159 | |||
| 160 | #Right part of panel | ||
| 161 | right="$volume$net$battery$date " | ||
| 162 | echo -n "%{r}$right" | ||
| 163 | echo | ||
| 164 | |||
| 165 | # wait for next event | ||
| 166 | IFS=$'\t' read -ra cmd || break | ||
| 167 | case "${cmd[0]}" in | ||
| 168 | tag*) | ||
| 169 | #echo "resetting tags" >&2 | ||
| 170 | IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" | ||
| 171 | ;; | ||
| 172 | volume) | ||
| 173 | volume="${cmd[@]:1}" | ||
| 174 | if [ $volume == "off" ] ; then | ||
| 175 | volume="" | ||
| 176 | else | ||
| 177 | volume="$volume $separator%{B-} " | ||
| 178 | fi | ||
| 179 | ;; | ||
| 180 | net) | ||
| 181 | net="${cmd[@]:1}" | ||
| 182 | if [ $net = "off" ] ; then | ||
| 183 | net="" | ||
| 184 | else | ||
| 185 | net="$net $separator%{B-} " | ||
| 186 | fi | ||
| 187 | ;; | ||
| 188 | battery) | ||
| 189 | battery="${cmd[@]:1}" | ||
| 190 | if [ $battery == "off" ] ; then | ||
| 191 | battery="" | ||
| 192 | else | ||
| 193 | battery="$battery $separator%{B-} " | ||
| 194 | fi | ||
| 195 | ;; | ||
| 196 | date) | ||
| 197 | #echo "resetting date" >&2 | ||
| 198 | date="${cmd[@]:1}" | ||
| 199 | ;; | ||
| 200 | focus_changed|window_title_changed) | ||
| 201 | windowtitle="${cmd[@]:2}" | ||
| 202 | ;; | ||
| 203 | esac | ||
| 204 | done | ||
| 205 | } 2> /dev/null | bar $bar_opts | { | ||
| 206 | #Handle clickable areas | ||
| 207 | while read line; do | ||
| 208 | IFS=',' read -a c <<< $(echo $line) | ||
| 209 | case "${c[0]}" in | ||
| 210 | tag) | ||
| 211 | herbstclient use "${c[1]}" | ||
| 212 | echo "herbstclient use \"${c[1]}\"" | ||
| 213 | ;; | ||
| 214 | *) | ||
| 215 | echo "${c[0]}: not valid command" | ||
| 216 | ;; | ||
| 217 | esac | ||
| 218 | done | ||
| 219 | } | ||
diff --git a/.config/herbstluftwm/popup.sh b/.config/herbstluftwm/popup.sh deleted file mode 100755 index 41c5e9c..0000000 --- a/.config/herbstluftwm/popup.sh +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | help () { | ||
| 4 | echo -e "Usage: popup.sh [OPTIONS]" | ||
| 5 | echo -e "Spawns a popup for a certain amount of time" | ||
| 6 | echo -e "" | ||
| 7 | echo -e "Options:" | ||
| 8 | echo -e " -m MESSAGE\t\tSpecifies message to be displayed" | ||
| 9 | echo -e " -t TIMEOUT\t\tAmount of time in seconds the popup is displayed" | ||
| 10 | } | ||
| 11 | |||
| 12 | add_alpha_channel(){ | ||
| 13 | echo "$1" | \ | ||
| 14 | sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" | ||
| 15 | } | ||
| 16 | |||
| 17 | timeout=10 | ||
| 18 | message="" | ||
| 19 | x=0 | ||
| 20 | y=0 | ||
| 21 | width=120 | ||
| 22 | height=90 | ||
| 23 | urgency="info" | ||
| 24 | |||
| 25 | while getopts ":m:t:x:y:w:h:u:" opt; do | ||
| 26 | case $opt in | ||
| 27 | m) message=$OPTARG ;; | ||
| 28 | t) timeout=$OPTARG ;; | ||
| 29 | x) x=$OPTARG ;; | ||
| 30 | y) y=$OPTARG ;; | ||
| 31 | w) width=$OPTARG ;; | ||
| 32 | h) height=$OPTARG ;; | ||
| 33 | u) urgency=$OPTARG ;; | ||
| 34 | esac | ||
| 35 | done | ||
| 36 | |||
| 37 | if test ! $message; then | ||
| 38 | help | ||
| 39 | else | ||
| 40 | light=$(add_alpha_channel $WM_LIGHT) | ||
| 41 | llight=$(add_alpha_channel $WM_LLIGHT) | ||
| 42 | accent=$(add_alpha_channel $WM_ACCENT) | ||
| 43 | ldark=$(add_alpha_channel $WM_LDARK) | ||
| 44 | dark=$(add_alpha_channel $WM_DARK) | ||
| 45 | font="-*-fixed-medium-*-*-*-$(echo "$height - 10" | bc)-*-*-*-*-*-*-*" | ||
| 46 | bar_opts="-f ${font} -B $dark -F $light -g ${width}x${height}+${x}+${y} -u 2" | ||
| 47 | |||
| 48 | t=$(date +%T) | ||
| 49 | |||
| 50 | if [ $urgency == "info" ]; then | ||
| 51 | prefix="Info:" | ||
| 52 | elif [ $urgency == "high" ]; then | ||
| 53 | prefix="!!WARNING:" | ||
| 54 | fi | ||
| 55 | |||
| 56 | { | ||
| 57 | echo "%{F$accent} $prefix %{F$light}$message %{F$llight}($t)%{F-}" | ||
| 58 | sleep $timeout | ||
| 59 | } | bar $bar_opts | ||
| 60 | fi | ||
diff --git a/.config/herbstluftwm/start.sh b/.config/herbstluftwm/start.sh deleted file mode 100755 index f10fca6..0000000 --- a/.config/herbstluftwm/start.sh +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | opts=($@) | ||
| 4 | |||
| 5 | program=$(echo ${opts[0]} | sed 's/^.*\/\(.*\)/\1/') | ||
| 6 | |||
| 7 | if pgrep $program >> /dev/null | ||
| 8 | then | ||
| 9 | killall $program | ||
| 10 | ${opts[@]} & | ||
| 11 | else | ||
| 12 | ${opts[@]} & | ||
| 13 | fi | ||
