diff options
Diffstat (limited to '.config/herbstluftwm')
| -rwxr-xr-x | .config/herbstluftwm/autostart | 200 | ||||
| -rwxr-xr-x | .config/herbstluftwm/panel.sh | 189 |
2 files changed, 389 insertions, 0 deletions
diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart new file mode 100755 index 0000000..500eabf --- /dev/null +++ b/.config/herbstluftwm/autostart | |||
| @@ -0,0 +1,200 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # this is a simple config for herbstluftwm | ||
| 4 | |||
| 5 | #Wallpaper | ||
| 6 | WALLPAPER=/usr/share/backgrounds/gnome/Road.jpg | ||
| 7 | |||
| 8 | #Numix color palette | ||
| 9 | LIGHT='#f9f9f9' | ||
| 10 | LLIGHT='#dedede' | ||
| 11 | ACCENT='#d64937' | ||
| 12 | LDARK='#333333' | ||
| 13 | DARK='#2d2d2d' | ||
| 14 | |||
| 15 | hc() { | ||
| 16 | herbstclient "$@" | ||
| 17 | } | ||
| 18 | |||
| 19 | hc emir_hook reload | ||
| 20 | |||
| 21 | xsetroot -solid $ACCENT | ||
| 22 | |||
| 23 | # remove all existing keybindings | ||
| 24 | hc keyunbind --all | ||
| 25 | |||
| 26 | # keybindings | ||
| 27 | # if you have a super key you will be much happier with Mod set to Mod4 | ||
| 28 | #Mod=Mod1 # Use alt as the main modifier | ||
| 29 | Mod=Mod4 # Use the super key as the main modifier | ||
| 30 | |||
| 31 | hc keybind $Mod-Shift-q quit | ||
| 32 | hc keybind $Mod-Shift-r reload | ||
| 33 | hc keybind $Mod-Shift-c close | ||
| 34 | hc keybind $Mod-Return spawn xfce4-terminal | ||
| 35 | hc keybind ~ spawn xfce4-terminal --drop-down | ||
| 36 | |||
| 37 | # basic movement | ||
| 38 | # focusing clients | ||
| 39 | hc keybind $Mod-Left focus left | ||
| 40 | hc keybind $Mod-Down focus down | ||
| 41 | hc keybind $Mod-Up focus up | ||
| 42 | hc keybind $Mod-Right focus right | ||
| 43 | hc keybind $Mod-h focus left | ||
| 44 | hc keybind $Mod-j focus down | ||
| 45 | hc keybind $Mod-k focus up | ||
| 46 | hc keybind $Mod-l focus right | ||
| 47 | |||
| 48 | # moving clients | ||
| 49 | hc keybind $Mod-Shift-Left shift left | ||
| 50 | hc keybind $Mod-Shift-Down shift down | ||
| 51 | hc keybind $Mod-Shift-Up shift up | ||
| 52 | hc keybind $Mod-Shift-Right shift right | ||
| 53 | hc keybind $Mod-Shift-h shift left | ||
| 54 | hc keybind $Mod-Shift-j shift down | ||
| 55 | hc keybind $Mod-Shift-k shift up | ||
| 56 | hc keybind $Mod-Shift-l shift right | ||
| 57 | |||
| 58 | # splitting frames | ||
| 59 | # create an empty frame at the specified direction | ||
| 60 | hc keybind $Mod-u split bottom 0.5 | ||
| 61 | hc keybind $Mod-o split right 0.5 | ||
| 62 | # let the current frame explode into subframes | ||
| 63 | hc keybind $Mod-Control-space split explode | ||
| 64 | |||
| 65 | # resizing frames | ||
| 66 | resizestep=0.05 | ||
| 67 | hc keybind $Mod-Control-h resize left +$resizestep | ||
| 68 | hc keybind $Mod-Control-j resize down +$resizestep | ||
| 69 | hc keybind $Mod-Control-k resize up +$resizestep | ||
| 70 | hc keybind $Mod-Control-l resize right +$resizestep | ||
| 71 | hc keybind $Mod-Control-Left resize left +$resizestep | ||
| 72 | hc keybind $Mod-Control-Down resize down +$resizestep | ||
| 73 | hc keybind $Mod-Control-Up resize up +$resizestep | ||
| 74 | hc keybind $Mod-Control-Right resize right +$resizestep | ||
| 75 | |||
| 76 | # tags | ||
| 77 | tag_names=( {1..9} ) | ||
| 78 | tag_keys=( {1..9} 0 ) | ||
| 79 | |||
| 80 | # Selecting workspaces | ||
| 81 | hc keybind Alt-Control-Left use_index -1 | ||
| 82 | hc keybind Alt-Control-Right use_index +1 | ||
| 83 | hc rename default "${tag_names[0]}" || true | ||
| 84 | for i in ${!tag_names[@]} ; do | ||
| 85 | hc add "${tag_names[$i]}" | ||
| 86 | key="${tag_keys[$i]}" | ||
| 87 | if ! [ -z "$key" ] ; then | ||
| 88 | hc keybind "$Mod-$key" use_index "$i" | ||
| 89 | hc keybind "$Mod-Shift-$key" move_index "$i" | ||
| 90 | fi | ||
| 91 | done | ||
| 92 | |||
| 93 | # cycle through tags | ||
| 94 | hc keybind $Mod-period use_index +1 --skip-visible | ||
| 95 | hc keybind $Mod-comma use_index -1 --skip-visible | ||
| 96 | |||
| 97 | # layouting | ||
| 98 | hc keybind $Mod-r remove | ||
| 99 | hc keybind $Mod-space cycle_layout 1 | ||
| 100 | hc keybind $Mod-s floating toggle | ||
| 101 | hc keybind $Mod-f fullscreen toggle | ||
| 102 | hc keybind $Mod-p pseudotile toggle | ||
| 103 | |||
| 104 | # mouse | ||
| 105 | hc mouseunbind --all | ||
| 106 | hc mousebind $Mod-Button1 move | ||
| 107 | hc mousebind $Mod-Button2 zoom | ||
| 108 | hc mousebind $Mod-Button3 resize | ||
| 109 | |||
| 110 | # focus | ||
| 111 | hc keybind $Mod-BackSpace cycle_monitor | ||
| 112 | hc keybind $Mod-Tab cycle_all +1 | ||
| 113 | hc keybind $Mod-Shift-Tab cycle_all -1 | ||
| 114 | hc keybind $Mod-c cycle | ||
| 115 | hc keybind $Mod-i jumpto urgent | ||
| 116 | hc set focus_follows_mouse 1 | ||
| 117 | |||
| 118 | # theme | ||
| 119 | hc attr theme.tiling.reset 1 | ||
| 120 | hc attr theme.floating.reset 1 | ||
| 121 | hc set frame_border_active_color $LDARK | ||
| 122 | hc set frame_border_normal_color $DARK | ||
| 123 | hc set frame_bg_normal_color $LDARK | ||
| 124 | hc set frame_bg_active_color $DARK | ||
| 125 | hc set frame_border_width 0 | ||
| 126 | hc set always_show_frame 0 | ||
| 127 | hc set frame_bg_transparent 1 | ||
| 128 | hc set frame_transparent_width 0 | ||
| 129 | hc set frame_gap 0 | ||
| 130 | |||
| 131 | hc attr theme.active.color $ACCENT | ||
| 132 | hc attr theme.normal.color $DARK | ||
| 133 | hc attr theme.urgent.color orange | ||
| 134 | hc attr theme.inner_width 1 | ||
| 135 | hc attr theme.inner_color $DARK | ||
| 136 | hc attr theme.border_width 3 | ||
| 137 | hc attr theme.floating.border_width 4 | ||
| 138 | hc attr theme.floating.outer_width 1 | ||
| 139 | hc attr theme.floating.outer_color black | ||
| 140 | hc attr theme.active.inner_color $DARK | ||
| 141 | hc attr theme.active.outer_color $DARK | ||
| 142 | hc attr theme.background_color $DARK | ||
| 143 | |||
| 144 | hc set window_gap 20 | ||
| 145 | hc set frame_padding 0 | ||
| 146 | hc set smart_window_surroundings 0 | ||
| 147 | hc set smart_frame_surroundings 1 | ||
| 148 | hc set mouse_recenter_gap 1 | ||
| 149 | |||
| 150 | # rules | ||
| 151 | hc unrule -F | ||
| 152 | #hc rule class=XTerm tag=3 # move all xterms to tag 3 | ||
| 153 | hc rule focus=on # normally focus new clients | ||
| 154 | #hc rule focus=off # normally do not focus new clients | ||
| 155 | # give focus to most common terminals | ||
| 156 | #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on | ||
| 157 | hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on | ||
| 158 | hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on | ||
| 159 | hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off | ||
| 160 | |||
| 161 | # unlock, just to be sure | ||
| 162 | hc unlock | ||
| 163 | |||
| 164 | herbstclient set tree_style '╾│ ├└╼─┐' | ||
| 165 | |||
| 166 | # do multi monitor setup here, e.g.: | ||
| 167 | # hc set_monitors 1280x1024+0+0 1280x1024+1280+0 | ||
| 168 | # or simply: | ||
| 169 | # hc detect_monitors | ||
| 170 | |||
| 171 | #Start panel in all monitors | ||
| 172 | start_panel() { | ||
| 173 | for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do | ||
| 174 | "$1" $monitor & | ||
| 175 | done | ||
| 176 | } | ||
| 177 | |||
| 178 | # find the panel | ||
| 179 | panel=~/.config/herbstluftwm/panel.sh | ||
| 180 | [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh | ||
| 181 | if pgrep panel.sh >> /dev/null | ||
| 182 | then | ||
| 183 | kill $(pgrep panel.sh) | ||
| 184 | start_panel $panel | ||
| 185 | else | ||
| 186 | start_panel $panel | ||
| 187 | fi | ||
| 188 | |||
| 189 | #Wallpaper | ||
| 190 | feh --bg-scale $WALLPAPER | ||
| 191 | |||
| 192 | #Start compton if not running | ||
| 193 | start_compton(){ compton -c -z & } | ||
| 194 | if pgrep compton >> /dev/null | ||
| 195 | then | ||
| 196 | kill $(pgrep compton) | ||
| 197 | start_compton | ||
| 198 | else | ||
| 199 | start_compton | ||
| 200 | fi | ||
diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh new file mode 100755 index 0000000..cc4fb1e --- /dev/null +++ b/.config/herbstluftwm/panel.sh | |||
| @@ -0,0 +1,189 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;} | ||
| 4 | monitor=${1:-0} | ||
| 5 | geometry=( $(herbstclient monitor_rect "$monitor") ) | ||
| 6 | if [ -z "$geometry" ] ;then | ||
| 7 | echo "Invalid monitor $monitor" | ||
| 8 | exit 1 | ||
| 9 | fi | ||
| 10 | # geometry has the format W H X Y | ||
| 11 | x=${geometry[0]} | ||
| 12 | y=${geometry[1]} | ||
| 13 | panel_width=${geometry[2]} | ||
| 14 | panel_height=24 | ||
| 15 | font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" | ||
| 16 | bgcolor=$(hc get frame_border_normal_color) | ||
| 17 | selbg=$(hc get window_border_active_color) | ||
| 18 | selfg='#101010' | ||
| 19 | |||
| 20 | ######################################################################################## | ||
| 21 | # Try to find textwidth binary. | ||
| 22 | # In e.g. Ubuntu, this is named dzen2-textwidth. | ||
| 23 | if which textwidth &> /dev/null ; then | ||
| 24 | textwidth="textwidth"; | ||
| 25 | elif which dzen2-textwidth &> /dev/null ; then | ||
| 26 | textwidth="dzen2-textwidth"; | ||
| 27 | else | ||
| 28 | echo "This script requires the textwidth tool of the dzen2 project." | ||
| 29 | exit 1 | ||
| 30 | fi | ||
| 31 | |||
| 32 | ######################################################################################## | ||
| 33 | # true if we are using the svn version of dzen2 | ||
| 34 | # depending on version/distribution, this seems to have version strings like | ||
| 35 | # "dzen-" or "dzen-x.x.x-svn" | ||
| 36 | if dzen2 -v 2>&1 | head -n 1 | grep -q '^dzen-\([^,]*-svn\|\),'; then | ||
| 37 | dzen2_svn="true" | ||
| 38 | else | ||
| 39 | dzen2_svn="" | ||
| 40 | fi | ||
