Guest User

Untitled

a guest
Jul 24th, 2022
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.71 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. feh --bg-scale /home/jim/Pictures/JapanCastlePixel1.png &
  13.  
  14. # remove all existing keybindings
  15. hc keyunbind --all
  16.  
  17. # keybindings
  18. # if you have a super key you will be much happier with Mod set to Mod4
  19. #Mod=Mod1 # Use alt as the main modifier
  20. Mod=Mod4 # Use the super key as the main modifier
  21.  
  22. hc keybind $Mod-Shift-q quit
  23. hc keybind $Mod-Shift-r reload
  24. hc keybind $Mod-Shift-c close
  25. hc keybind $Mod-Return spawn "${TERMINAL:-terminator}" # use your $TERMINAL with xterm as fallback
  26. hc keybind $Mod-q close
  27. hc keybind $Mod-f spawn firefox
  28. hc keybind $Mod-e spawn nemo
  29. hc keybind XF86AudioRaiseVolume spawn pulsemixer --change-volume +5
  30. hc keybind XF86AudioLowerVolume spawn pulsemixer --change-volume -5
  31. hc keybind $Mod-period spawn pulsemixer --change-volume +5
  32. hc keybind $Mod-comma spawn pulsemixer --change-volume -5
  33. hc keybind $mod-n spawn nmtui
  34. hc keybind $Mod-d spawn j4-dmenu-desktop
  35.  
  36. #compositor goes here
  37. compton &
  38.  
  39. # basic movement in tiling and floating mode
  40. # focusing clients
  41. hc keybind $Mod-Left focus left
  42. hc keybind $Mod-Down focus down
  43. hc keybind $Mod-Up focus up
  44. hc keybind $Mod-Right focus right
  45. hc keybind $Mod-h focus left
  46. hc keybind $Mod-j focus down
  47. hc keybind $Mod-k focus up
  48. hc keybind $Mod-l focus right
  49.  
  50. # moving clients in tiling and floating mode
  51. hc keybind $Mod-Shift-Left shift left
  52. hc keybind $Mod-Shift-Down shift down
  53. hc keybind $Mod-Shift-Up shift up
  54. hc keybind $Mod-Shift-Right shift right
  55. hc keybind $Mod-Shift-h shift left
  56. hc keybind $Mod-Shift-j shift down
  57. hc keybind $Mod-Shift-k shift up
  58. hc keybind $Mod-Shift-l shift right
  59.  
  60. # splitting frames
  61. # create an empty frame at the specified direction
  62. hc keybind $Mod-u split bottom 0.5
  63. hc keybind $Mod-o split right 0.5
  64. # let the current frame explode into subframes
  65. hc keybind $Mod-Control-space split explode
  66.  
  67. # resizing frames and floating clients
  68. resizestep=0.02
  69. hc keybind $Mod-Control-h resize left +$resizestep
  70. hc keybind $Mod-Control-j resize down +$resizestep
  71. hc keybind $Mod-Control-k resize up +$resizestep
  72. hc keybind $Mod-Control-l resize right +$resizestep
  73. hc keybind $Mod-Control-Left resize left +$resizestep
  74. hc keybind $Mod-Control-Down resize down +$resizestep
  75. hc keybind $Mod-Control-Up resize up +$resizestep
  76. hc keybind $Mod-Control-Right resize right +$resizestep
  77.  
  78. # tags
  79. tag_names=( {1..9} )
  80. tag_keys=( {1..9} 0 )
  81.  
  82. hc rename default "${tag_names[0]}" || true
  83. for i in "${!tag_names[@]}" ; do
  84. hc add "${tag_names[$i]}"
  85. key="${tag_keys[$i]}"
  86. if [ -n "$key" ] ; then
  87. hc keybind "$Mod-$key" use_index "$i"
  88. hc keybind "$Mod-Shift-$key" move_index "$i"
  89. fi
  90. done
  91.  
  92. # cycle through tags
  93. hc keybind $Mod-shift-period use_index +1 --skip-visible
  94. hc keybind $Mod-shift-comma use_index -1 --skip-visible
  95.  
  96. # layouting
  97. hc keybind $Mod-r remove
  98. hc keybind $Mod-s floating toggle
  99. #hc keybind $Mod-f fullscreen toggle
  100. hc keybind $Mod-Shift-f set_attr clients.focus.floating toggle
  101. hc keybind $Mod-Shift-d set_attr clients.focus.decorated toggle
  102. hc keybind $Mod-Shift-m set_attr clients.focus.minimized true
  103. hc keybind $Mod-Control-m jumpto last-minimized
  104. hc keybind $Mod-p pseudotile toggle
  105. # The following cycles through the available layouts within a frame, but skips
  106. # layouts, if the layout change wouldn't affect the actual window positions.
  107. # I.e. if there are two windows within a frame, the grid layout is skipped.
  108. hc keybind $Mod-space \
  109. or , and . compare tags.focus.curframe_wcount = 2 \
  110. . cycle_layout +1 vertical horizontal max vertical grid \
  111. , cycle_layout +1
  112.  
  113. # mouse
  114. hc mouseunbind --all
  115. hc mousebind $Mod-Button1 move
  116. hc mousebind $Mod-Button2 zoom
  117. hc mousebind $Mod-Button3 resize
  118.  
  119. # focus
  120. hc keybind $Mod-BackSpace cycle_monitor
  121. hc keybind $Mod-Tab cycle_all +1
  122. hc keybind $Mod-Shift-Tab cycle_all -1
  123. hc keybind $Mod-c cycle
  124. hc keybind $Mod-i jumpto urgent
  125.  
  126. # theme
  127. hc attr theme.tiling.reset 1
  128. hc attr theme.floating.reset 1
  129.  
  130. hc attr theme.title_height 12
  131. hc attr theme.title_when always
  132. hc attr theme.title_font 'Roboto :pixelsize=10'
  133. hc attr theme.title_depth 3 # space below the title's baseline
  134. hc attr theme.title_color '#ffffff'
  135. hc attr theme.active.tab_title_color '#ababab'
  136. hc attr theme.normal.title_color '#898989'
  137.  
  138. hc set frame_border_active_color '#222222'
  139. hc set frame_border_normal_color '#101010'
  140. hc set frame_bg_normal_color '#565656'
  141. hc set frame_bg_active_color '#345F0C'
  142. hc set frame_border_width 1
  143. hc set always_show_frame 1
  144. hc set frame_bg_transparent 1
  145. hc set frame_transparent_width 5
  146. hc set frame_gap 4
  147.  
  148. hc attr theme.active.color '#9fbc00'
  149. hc attr theme.normal.color '#454545'
  150. hc attr theme.urgent.color orange
  151. hc attr theme.inner_width 1
  152. hc attr theme.inner_color black
  153. hc attr theme.border_width 3
  154. hc attr theme.floating.border_width 4
  155. hc attr theme.floating.outer_width 1
  156. hc attr theme.floating.outer_color black
  157. hc attr theme.active.inner_color '#3E4A00'
  158. hc attr theme.active.outer_color '#3E4A00'
  159. hc attr theme.background_color '#141414'
  160.  
  161.  
  162. # copy inner color to outer_color
  163. for state in active urgent normal ; do
  164. hc substitute C theme.${state}.inner_color \
  165. attr theme.${state}.outer_color C
  166. done
  167. hc attr theme.tiling.outer_width 1
  168. hc attr theme.background_color '#141414'
  169.  
  170. hc set window_gap 0
  171. hc set frame_padding 0
  172. hc set smart_window_surroundings off
  173. hc set smart_frame_surroundings on
  174. hc set mouse_recenter_gap 0
  175.  
  176. # rules
  177. hc unrule -F
  178. #hc rule class=XTerm tag=3 # move all xterms to tag 3
  179. hc rule focus=on # normally focus new clients
  180. hc rule floatplacement=smart
  181. #hc rule focus=off # normally do not focus new clients
  182. # give focus to most common terminals
  183. #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
  184. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
  185. hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
  186. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
  187. hc rule fixedsize floating=on
  188.  
  189. hc set tree_style '╾│ ├└╼─┐'
  190.  
  191. # unlock, just to be sure
  192. hc unlock
  193.  
  194. # do multi monitor setup here, e.g.:
  195. # hc set_monitors 1280x1024+0+0 1280x1024+1280+0
  196. # or simply:
  197. # hc detect_monitors
  198.  
  199. # find the panel
  200. panel=~/.config/herbstluftwm/panel.sh
  201. [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
  202. for monitor in $(hc list_monitors | cut -d: -f1) ; do
  203. # start it on each monitor
  204. "$panel" "$monitor" &
  205. done
Advertisement
Add Comment
Please, Sign In to add comment