My personal dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

autostart 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. #!/usr/bin/env bash
  2. # this is a simple config for herbstluftwm
  3. hc() {
  4. herbstclient "$@"
  5. }
  6. hc emit_hook reload
  7. xsetroot -solid '#5A8E3A'
  8. # remove all existing keybindings
  9. hc keyunbind --all
  10. # keybindings
  11. # if you have a super key you will be much happier with Mod set to Mod4
  12. #Mod=Mod1 # Use alt as the main modifier
  13. Mod=Mod4 # Use the super key as the main modifier
  14. hc keybind $Mod-Shift-q quit
  15. hc keybind $Mod-Shift-r reload
  16. hc keybind $Mod-Shift-c close
  17. hc keybind $Mod-Return spawn terminator
  18. # My bindings
  19. hc keybind $Mod-backslash spawn emacs
  20. hc keybind $Mod-c spawn chromium
  21. hc keybind XF86AudioRaiseVolume spawn amixer -D pulse sset Master 2%+
  22. hc keybind XF86AudioLowerVolume spawn amixer -D pulse sset Master 2%-
  23. hc keybind XF86AudioMute spawn amixer set Master toggle
  24. # basic movement
  25. # focusing clients
  26. hc keybind $Mod-Left focus left
  27. hc keybind $Mod-Down focus down
  28. hc keybind $Mod-Up focus up
  29. hc keybind $Mod-Right focus right
  30. hc keybind $Mod-h focus left
  31. hc keybind $Mod-j focus down
  32. hc keybind $Mod-k focus up
  33. hc keybind $Mod-l focus right
  34. # moving clients
  35. hc keybind $Mod-Shift-Left shift left
  36. hc keybind $Mod-Shift-Down shift down
  37. hc keybind $Mod-Shift-Up shift up
  38. hc keybind $Mod-Shift-Right shift right
  39. hc keybind $Mod-Shift-h shift left
  40. hc keybind $Mod-Shift-j shift down
  41. hc keybind $Mod-Shift-k shift up
  42. hc keybind $Mod-Shift-l shift right
  43. # splitting frames
  44. # create an empty frame at the specified direction
  45. hc keybind $Mod-u split bottom 0.5
  46. hc keybind $Mod-o split right 0.5
  47. # let the current frame explode into subframes
  48. hc keybind $Mod-Control-space split explode
  49. # resizing frames
  50. resizestep=0.05
  51. hc keybind $Mod-Control-h resize left +$resizestep
  52. hc keybind $Mod-Control-j resize down +$resizestep
  53. hc keybind $Mod-Control-k resize up +$resizestep
  54. hc keybind $Mod-Control-l resize right +$resizestep
  55. hc keybind $Mod-Control-Left resize left +$resizestep
  56. hc keybind $Mod-Control-Down resize down +$resizestep
  57. hc keybind $Mod-Control-Up resize up +$resizestep
  58. hc keybind $Mod-Control-Right resize right +$resizestep
  59. # tags
  60. tag_names=( {1..9} )
  61. tag_keys=( ampersand bracketleft braceleft braceright parenleft equal asterisk parenright plus )
  62. hc rename default "${tag_names[0]}" || true
  63. for i in ${!tag_names[@]} ; do
  64. hc add "${tag_names[$i]}"
  65. key="${tag_keys[$i]}"
  66. if ! [ -z "$key" ] ; then
  67. hc keybind "$Mod-$key" use_index "$i"
  68. hc keybind "$Mod-Shift-$key" move_index "$i"
  69. fi
  70. done
  71. # cycle through tags
  72. hc keybind $Mod-period use_index +1 --skip-visible
  73. hc keybind $Mod-comma use_index -1 --skip-visible
  74. # layouting
  75. hc set default_frame_layout 1
  76. hc keybind $Mod-r remove
  77. hc keybind $Mod-s floating toggle
  78. hc keybind $Mod-f fullscreen toggle
  79. hc keybind $Mod-p pseudotile toggle
  80. # The following cycles through the available layouts within a frame, but skips
  81. # layouts, if the layout change wouldn't affect the actual window positions.
  82. # I.e. if there are two windows within a frame, the grid layout is skipped.
  83. hc keybind $Mod-space \
  84. or , and . compare tags.focus.curframe_wcount = 2 \
  85. . cycle_layout +1 vertical horizontal max vertical grid \
  86. , cycle_layout +1
  87. # mouse
  88. hc mouseunbind --all
  89. hc mousebind $Mod-Button1 move
  90. hc mousebind $Mod-Button2 zoom
  91. hc mousebind $Mod-Button3 resize
  92. # focus
  93. hc keybind $Mod-BackSpace cycle_monitor
  94. hc keybind $Mod-Tab cycle_all +1
  95. hc keybind $Mod-Shift-Tab cycle_all -1
  96. hc keybind $Mod-g cycle
  97. hc keybind $Mod-i jumpto urgent
  98. # theme
  99. hc attr theme.tiling.reset 1
  100. hc attr theme.floating.reset 1
  101. hc set frame_border_active_color '#222222'
  102. hc set frame_border_normal_color '#101010'
  103. #hc set frame_bg_normal_color '#565656'
  104. #hc set frame_bg_active_color '#345F0C'
  105. hc set frame_bg_normal_color '#000000'
  106. hc set frame_bg_active_color '#454545'
  107. hc set frame_border_width 1
  108. hc set always_show_frame 1
  109. hc set frame_bg_transparent 1
  110. hc set frame_transparent_width 5
  111. hc set frame_gap 4
  112. #hc attr theme.active.color '#9fbc00'
  113. #hc attr theme.normal.color '#454545'
  114. #hc attr theme.urgent.color orange
  115. hc attr theme.active.color '#6A8C8C'
  116. hc attr theme.normal.color '#000000'
  117. hc attr theme.urgent.color '#660000'
  118. hc attr theme.inner_width 1
  119. hc attr theme.inner_color black
  120. hc attr theme.border_width 3
  121. hc attr theme.floating.border_width 4
  122. hc attr theme.floating.outer_width 1
  123. hc attr theme.floating.outer_color black
  124. hc attr theme.active.inner_color '#3E4A00'
  125. hc attr theme.active.outer_color '#3E4A00'
  126. hc attr theme.background_color '#141414'
  127. hc set window_gap 0
  128. hc set frame_padding 0
  129. hc set smart_window_surroundings 0
  130. hc set smart_frame_surroundings 1
  131. hc set mouse_recenter_gap 0
  132. # rules
  133. hc unrule -F
  134. #hc rule class=XTerm tag=3 # move all xterms to tag 3
  135. hc rule focus=on # normally focus new clients
  136. #hc rule focus=off # normally do not focus new clients
  137. # give focus to most common terminals
  138. #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
  139. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
  140. hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
  141. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
  142. hc set tree_style '╾│ ├└╼─┐'
  143. # Wallpaper
  144. feh --bg-scale ~/Pictures/calvin-and-hobbes-night-sky-wallpaper.jpg
  145. # unlock, just to be sure
  146. hc unlock
  147. # do multi monitor setup here, e.g.:
  148. # hc set_monitors 1280x1024+0+0 1280x1024+1280+0
  149. # or simply:
  150. # hc detect_monitors
  151. # find the panel
  152. panel=~/.config/herbstluftwm/panel.sh
  153. [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
  154. for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
  155. # start it on each monitor
  156. "$panel" $monitor &
  157. done