Guest User

autostart

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