Advertisement
Guest User

Untitled

a guest
Oct 13th, 2022
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 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 '#6C2E82'
  12.  
  13. #Autostart
  14.  
  15.  
  16. tint2 &
  17.  
  18. nitrogen --restore &
  19.  
  20. picom &
  21.  
  22. # remove all existing keybindings
  23. hc keyunbind --all
  24.  
  25. # keybindings
  26. # if you have a super key you will be much happier with Mod set to Mod4
  27. Mod=Mod1 # Use alt as the main modifier
  28. #Mod=Mod4 # Use the super key as the main modifier
  29.  
  30. hc keybind $Mod-Shift-r reload
  31. hc keybind $Mod-k close
  32. hc keybind $Mod-t spawn "${TERMINAL:-alacritty}" # use your $TERMINAL with xterm as fallback
  33.  
  34. # basic movement in tiling and floating mode
  35. # focusing clients
  36. hc keybind $Mod-Left focus left
  37. hc keybind $Mod-Down focus down
  38. hc keybind $Mod-Up focus up
  39. hc keybind $Mod-Right focus right
  40.  
  41.  
  42. # moving clients in tiling and floating mode
  43. hc keybind $Mod-Shift-Left shift left
  44. hc keybind $Mod-Shift-Down shift down
  45. hc keybind $Mod-Shift-Up shift up
  46. hc keybind $Mod-Shift-Right shift right
  47.  
  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.  
  59. hc keybind $Mod-Control-Left resize left +$resizestep
  60. hc keybind $Mod-Control-Down resize down +$resizestep
  61. hc keybind $Mod-Control-Up resize up +$resizestep
  62. hc keybind $Mod-Control-Right resize right +$resizestep
  63.  
  64. # tags
  65. tag_names=( "" "🗁" "🖂" "" "" "" "🗎" "" )
  66. tag_keys=( {1..8} 0 )
  67.  
  68. hc rename default "${tag_names[0]}" || true
  69. for i in "${!tag_names[@]}" ; do
  70. hc add "${tag_names[$i]}"
  71. key="${tag_keys[$i]}"
  72. if ! [ -z "$key" ] ; then
  73. hc keybind "$Mod-$key" use_index "$i"
  74. hc keybind "$Mod-Shift-$key" move_index "$i"
  75. fi
  76. done
  77.  
  78. # cycle through tags
  79. hc keybind $Mod-period use_index +1 --skip-visible
  80. hc keybind $Mod-comma use_index -1 --skip-visible
  81.  
  82. # layouting
  83. hc keybind $Mod-Control-r remove
  84. hc keybind $Mod-s floating toggle
  85. hc keybind $Mod-Control-f fullscreen toggle
  86. hc keybind $Mod-Shift-f set_attr clients.focus.floating toggle
  87. hc keybind $Mod-Shift-m set_attr clients.focus.minimized true
  88. # restore all minimized windows of the focused tag
  89. hc keybind $Mod-Ctrl-m foreach CLIENT clients. \
  90. sprintf MINATT "%c.minimized" CLIENT \
  91. sprintf TAGATT "%c.tag" CLIENT and \
  92. , compare MINATT "=" "true" \
  93. , substitute FOCUS "tags.focus.name" compare TAGATT "=" FOCUS \
  94. , set_attr MINATT false
  95. hc keybind $Mod-Shift-p pseudotile toggle
  96. # The following cycles through the available layouts within a frame, but skips
  97. # layouts, if the layout change wouldn't affect the actual window positions.
  98. # I.e. if there are two windows within a frame, the grid layout is skipped.
  99. hc keybind $Mod-space \
  100. or , and . compare tags.focus.curframe_wcount = 2 \
  101. . cycle_layout +1 vertical horizontal max vertical grid \
  102. , cycle_layout +1
  103.  
  104. # mouse
  105. hc mouseunbind --all
  106. hc mousebind $Mod-Button1 move
  107. hc mousebind $Mod-Button2 zoom
  108. hc mousebind $Mod-Button3 resize
  109.  
  110. # focus
  111. hc keybind $Mod-BackSpace cycle_monitor
  112. hc keybind $Mod-Tab cycle_all +1
  113. hc keybind $Mod-Shift-Tab cycle_all -1
  114. hc keybind $Mod-c cycle
  115. hc keybind $Mod-i jumpto urgent
  116.  
  117. # theme
  118. hc attr theme.tiling.reset 1
  119. hc attr theme.floating.reset 1
  120. hc set frame_border_active_color '#792D82'
  121. hc set frame_border_normal_color '#3D0A3E'
  122. hc set frame_bg_normal_color '#3D0A3E'
  123. hc set frame_bg_active_color '#792D82'
  124. hc set frame_border_width 3
  125. hc set always_show_frame off
  126. hc set frame_bg_transparent on
  127. hc set frame_transparent_width 5
  128.  
  129. hc set frame_gap 10
  130.  
  131. hc attr theme.title_height 0
  132. hc attr theme.title_font 'Monofur:pixelsize=18' # example using Xft
  133. # hc attr theme.title_font '-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*'
  134. hc attr theme.padding_top 0 # space below the title's baseline (i.e. text depth)
  135. hc attr theme.active.color '#792D82'
  136. hc attr theme.normal.color '#3D0A3E'
  137. hc attr theme.urgent.color green
  138. hc attr theme.inner_width 0
  139. hc attr theme.inner_color purple
  140. hc attr theme.border_width 3
  141. hc attr theme.floating.border_width 4
  142. hc attr theme.floating.outer_width 4
  143. hc attr theme.floating.outer_color purple
  144. hc attr theme.active.inner_color '#792D82'
  145. hc attr theme.active.outer_color '#792D82'
  146. hc attr theme.background_color '#792D82'
  147.  
  148. hc set window_gap 0
  149. hc set frame_padding 0
  150. hc set smart_window_surroundings off
  151. hc set smart_frame_surroundings off
  152. hc set mouse_recenter_gap 0
  153.  
  154. for state in active urgent normal ; do
  155. hc substitute C theme.${state}.inner_color \
  156. attr theme.${state}.outer_color C
  157. done
  158.  
  159. # rules
  160. hc unrule -F
  161. #hc rule class=XTerm tag=3 # move all xterms to tag 3
  162. hc rule focus=on # normally focus new clients
  163. hc rule floatplacement=smart
  164. #hc rule focus=off # normally do not focus new clients
  165. # give focus to most common terminals
  166. #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
  167. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
  168. hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
  169. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
  170.  
  171. hc set tree_style '╾│ ├└╼─┐'
  172.  
  173. # unlock, just to be sure
  174. hc unlock
  175.  
  176. # do multi monitor setup here, e.g.:
  177. # hc set_monitors 1280x1024+0+0 1280x1024+1280+0
  178. # or simply:
  179. # hc detect_monitors
  180.  
  181. # find the panel
  182. panel=~/.config/herbstluftwm/panel.sh
  183. [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
  184. for monitor in $(hc list_monitors | cut -d: -f1) ; do
  185. # start it on each monitor
  186. "$panel" "$monitor" &
  187. done
  188.  
  189. hc keybind $Mod-r spawn rofi -show run
  190.  
  191. hc keybind $Mod-b spawn librewolf
  192.  
  193. hc keybind $Mod-m spawn thunderbird
  194.  
  195. hc keybind $Mod-l spawn lollypop
  196.  
  197. hc keybind $Mod-p spawn thunar
  198.  
  199. hc keybind $Mod-f spawn xed
  200.  
  201. # Lollypop Bindings
  202.  
  203. hc keybind $Mod-y spawn lollypop -t
  204.  
  205. hc keybind $Mod-n spawn lollypop -n
  206.  
  207. hc keybind $Mod-v spawn lollypop -p
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement