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.

190 lines
5.3KB

  1. #!/usr/bin/env zsh
  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 urxvt
  18. # basic movement
  19. # focusing clients
  20. hc keybind $Mod-Left focus left
  21. hc keybind $Mod-Down focus down
  22. hc keybind $Mod-Up focus up
  23. hc keybind $Mod-Right focus right
  24. hc keybind $Mod-h focus left
  25. hc keybind $Mod-j focus down
  26. hc keybind $Mod-k focus up
  27. hc keybind $Mod-l focus right
  28. # moving clients
  29. hc keybind $Mod-Shift-Left shift left
  30. hc keybind $Mod-Shift-Down shift down
  31. hc keybind $Mod-Shift-Up shift up
  32. hc keybind $Mod-Shift-Right shift right
  33. hc keybind $Mod-Shift-h shift left
  34. hc keybind $Mod-Shift-j shift down
  35. hc keybind $Mod-Shift-k shift up
  36. hc keybind $Mod-Shift-l shift right
  37. # splitting frames
  38. # create an empty frame at the specified direction
  39. hc keybind $Mod-u split bottom 0.5
  40. hc keybind $Mod-o split right 0.5
  41. # let the current frame explode into subframes
  42. hc keybind $Mod-Control-space split explode
  43. # resizing frames
  44. resizestep=0.05
  45. hc keybind $Mod-Control-h resize left +$resizestep
  46. hc keybind $Mod-Control-j resize down +$resizestep
  47. hc keybind $Mod-Control-k resize up +$resizestep
  48. hc keybind $Mod-Control-l resize right +$resizestep
  49. hc keybind $Mod-Control-Left resize left +$resizestep
  50. hc keybind $Mod-Control-Down resize down +$resizestep
  51. hc keybind $Mod-Control-Up resize up +$resizestep
  52. hc keybind $Mod-Control-Right resize right +$resizestep
  53. # tags
  54. tags=( 1 2 3 4 5 6 7 8 9 0 )
  55. hc rename default $tags[0] || true
  56. for i in $tags; do
  57. hc add $i
  58. if ! [ -z $i ] ; then
  59. hc keybind $Mod-$i use $i
  60. hc keybind $Mod-Shift-$i move $i
  61. fi
  62. done
  63. # cycle through tags
  64. hc keybind $Mod-period use_index +1 --skip-visible
  65. hc keybind $Mod-comma use_index -1 --skip-visible
  66. # layouting
  67. hc keybind $Mod-r remove
  68. hc keybind $Mod-s floating toggle
  69. hc keybind $Mod-f fullscreen toggle
  70. hc keybind $Mod-p pseudotile toggle
  71. # The following cycles through the available layouts within a frame, but skips
  72. # layouts, if the layout change wouldn't affect the actual window positions.
  73. # I.e. if there are two windows within a frame, the grid layout is skipped.
  74. hc keybind $Mod-space \
  75. or , and . compare tags.focus.curframe_wcount = 2 \
  76. . cycle_layout +1 vertical horizontal max vertical grid \
  77. , cycle_layout +1
  78. # mouse
  79. hc mouseunbind --all
  80. hc mousebind $Mod-Button1 move
  81. hc mousebind $Mod-Button2 zoom
  82. hc mousebind $Mod-Button3 resize
  83. # focus
  84. hc keybind $Mod-BackSpace cycle_monitor
  85. hc keybind $Mod-Tab cycle_all +1
  86. hc keybind $Mod-Shift-Tab cycle_all -1
  87. hc keybind $Mod-c cycle
  88. hc keybind $Mod-i jumpto urgent
  89. hc keybind $Mod-d spawn dmenu_run_hlwm
  90. # theme
  91. hc attr theme.tiling.reset 1
  92. hc attr theme.floating.reset 1
  93. hc set frame_border_active_color '#222222'
  94. hc set frame_border_normal_color '#101010'
  95. hc set frame_bg_normal_color '#565656'
  96. hc set frame_bg_active_color '#345F0C'
  97. hc set frame_border_width 1
  98. hc set always_show_frame 1
  99. hc set frame_bg_transparent 1
  100. hc set frame_transparent_width 5
  101. hc set frame_gap 20
  102. hc attr theme.active.color '#9fbc00'
  103. hc attr theme.normal.color '#454545'
  104. hc attr theme.urgent.color orange
  105. hc attr theme.inner_width 1
  106. hc attr theme.inner_color black
  107. hc attr theme.border_width 3
  108. hc attr theme.floating.border_width 4
  109. hc attr theme.floating.outer_width 1
  110. hc attr theme.floating.outer_color black
  111. hc attr theme.active.inner_color '#3E4A00'
  112. hc attr theme.active.outer_color '#3E4A00'
  113. hc attr theme.background_color '#141414'
  114. hc set window_gap 0
  115. hc set frame_padding 0
  116. hc set smart_window_surroundings 0
  117. hc set smart_frame_surroundings 0
  118. hc set mouse_recenter_gap 0
  119. # rules
  120. hc unrule -F
  121. #hc rule class=XTerm tag=3 # move all xterms to tag 3
  122. hc rule focus=on # normally focus new clients
  123. #hc rule focus=off # normally do not focus new clients
  124. # give focus to most common terminals
  125. #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
  126. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
  127. hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
  128. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
  129. hc set tree_style '╾│ ├└╼─┐'
  130. # unlock, just to be sure
  131. hc unlock
  132. # do multi monitor setup here, e.g.:
  133. # hc set_monitors 1280x1024+0+0 1280x1024+1280+0
  134. # or simply:
  135. # hc detect_monitors
  136. # find the panel
  137. panel=~/.config/herbstluftwm/panel.sh
  138. [ -x $panel ] || panel=/etc/xdg/herbstluftwm/panel.sh
  139. for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
  140. # start it on each monitor
  141. $panel $monitor &
  142. done
  143. echo 4285 > /sys/class/backlight/intel_backlight/brightness
  144. xsetbg -zoom 150 ~/Pictures/mandelbrot.png
  145. ~/Scripts/float_xinput_device.sh "Ideapad extra buttons"
  146. ~/Scripts/float_xinput_device.sh "AT Translated Set 2 keyboard"
  147. ~/Scripts/float_xinput_device.sh "Touchpad"
  148. pidof dunst
  149. case "$?" in
  150. 1)
  151. dunst &
  152. ;;
  153. esac
  154. pidof battery
  155. case "$?" in
  156. 1)
  157. ~/Scripts/battery &
  158. ;;
  159. esac