Advertisement
elhackerlibre

autostart

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