autostart 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. #!/usr/bin/env bash
  2. # this is a simple config for herbstluftwm
  3. # ...getting tweaked by Digit.
  4. # and... i'm sorting it. mission for today (( 2022 07 09 )) :D ::: esdf :: ( " s d e f " as the order goes in this, following the convention i pasted from.
  5. ## dev notes
  6. # sorely missing xmonad's stack style of control.
  7. # currengly cant apply shift to move tabbed windows in a shmancyherbstluftwmsplit, since i'm just mod-tabbing, and its reverse is with shift... whereas if i were e and d 'ing.. but then it doesnt go through the stack of windows inclusive of tabs, just hops layers... :/ ... i'll suss this fun little puzzle when more fresh headed.
  8. ### where did i put the thing that says how fast the scratchpad scrolls into view? i want it faster yet. fewer redraws.
  9. hc() {
  10. herbstclient "$@"
  11. }
  12. #
  13. hc emit_hook reload
  14. #meh, yeah, dont really need. may as well turn off while tweaking, ~ if only to keep the nice background i set ~ until i sort this with clever shell-fu
  15. #xsetroot -solid '#381919'
  16. #remove rules and start over.
  17. #hc unrule -F
  18. # remove all existing keybindings
  19. hc keyunbind --all
  20. # keybindings
  21. # if you have a super key you will be much happier with Mod set to Mod4
  22. #Mod=Mod1 # Use alt as the main modifier
  23. Mod=Mod4 # Use the super key as the main modifier
  24. #here i'll need a keybind to issue (iirc) herbstclient wmexec openbox
  25. #hc keybind $Mod-Shift-F11 hc wmexec openbox
  26. #hc keybind $Mod-Shift-F11 wmexec openbox
  27. #hc keybind $Mod-Shift-F11 herbstclient wmexec openbox
  28. # will need suss how to write it for sure. havent tried any of these.
  29. # oh ^ how long have i left that undone.
  30. #hc keybind $Mod-F11 wmexec openbox
  31. hc keybind $Mod-Control-F11 wmexec openbox
  32. #^ it works ! :D :D both ways. dont go silly trying press it lots though. i'm sure that will break things. ... stress test in safe situation only. ;)
  33. # and will wanna get one for xmonad too. ;0
  34. hc keybind $Mod-Control-F9 wmexec xmonad
  35. #yikes, nearly pressed this... add more modifiers
  36. hc keybind $Mod-Control-Shift-q quit
  37. hc keybind $Mod-Shift-r reload
  38. #hc keybind $Mod-Shift-c close #not close'y enough.
  39. #hc keybind $Mod-Shift-c close_or_remove #closes the empty splitframe too
  40. hc keybind $Mod-F4 close_or_remove #closes the empty splitframe too
  41. hc keybind $Mod-Shift-F4 close_and_remove #closes the empty splitframe too
  42. #
  43. #hc keybind $Mod-Return spawn "${TERMINAL:-xterm}" # use your $TERMINAL with xterm as fallback
  44. #
  45. #hc keybind $Mod-Return spawn "${TERMINAL:-st:-xterm}" # use your $TERMINAL with xterm as fallback ... and can haz st too?
  46. #
  47. #hc keybind $Mod-Return spawn "/home/digit/gittings/sts/st006/st/st-006-026" # use your $TERMINAL with xterm as fallback
  48. #meh fuck that, might as well keep it simple
  49. hc keybind $Mod-Return spawn "st"
  50. # menus
  51. #hc keybind $Mod-r spawn dmenu-bind.sh
  52. #hc keybind $Mod-r spawn dmenu_run
  53. hc keybind $Mod-r spawn /home/digit/bin/dmenu-bind.sh
  54. # basic movement in tiling and floating mode
  55. # focusing clients
  56. hc keybind $Mod-Left focus left
  57. hc keybind $Mod-Down focus down
  58. hc keybind $Mod-Up focus up
  59. hc keybind $Mod-Right focus right
  60. hc keybind $Mod-h focus left
  61. hc keybind $Mod-j focus down
  62. hc keybind $Mod-k focus up
  63. hc keybind $Mod-l focus right
  64. hc keybind $Mod-s focus left
  65. hc keybind $Mod-d focus down
  66. hc keybind $Mod-e focus up
  67. hc keybind $Mod-f focus right
  68. #
  69. # moving clients in tiling and floating mode
  70. hc keybind $Mod-Shift-Left shift left
  71. hc keybind $Mod-Shift-Down shift down
  72. hc keybind $Mod-Shift-Up shift up
  73. hc keybind $Mod-Shift-Right shift right
  74. hc keybind $Mod-Shift-h shift left
  75. hc keybind $Mod-Shift-j shift down
  76. hc keybind $Mod-Shift-k shift up
  77. hc keybind $Mod-Shift-l shift right
  78. hc keybind $Mod-Shift-s shift left
  79. hc keybind $Mod-Shift-d shift down
  80. hc keybind $Mod-Shift-e shift up
  81. hc keybind $Mod-Shift-f shift right
  82. # splitting frames
  83. # create an empty frame at the specified direction
  84. hc keybind $Mod-u split bottom 0.5
  85. hc keybind $Mod-o split right 0.5
  86. hc keybind $Mod-minus split bottom 0.5 # - for horizontal, like tmux
  87. hc keybind $Mod-bar split right 0.5 # | for vertical, like tmux
  88. #hc keybind $Mod-h split bottom 0.5 # h for horizontal, like tmux # but i use for go left a frame.
  89. #hc keybind $Mod-v split right 0.5 # v for vertical, like tmux # but i use for go right a workspace.
  90. # let the current frame explode into subframes
  91. hc keybind $Mod-Control-space split explode
  92. # close a split ( i think... )
  93. hc keybind $Mod-c remove
  94. # resizing frames and floating clients
  95. resizestep=0.02
  96. hc keybind $Mod-Control-h resize left +$resizestep
  97. hc keybind $Mod-Control-j resize down +$resizestep
  98. hc keybind $Mod-Control-k resize up +$resizestep
  99. hc keybind $Mod-Control-l resize right +$resizestep
  100. hc keybind $Mod-Control-Left resize left +$resizestep
  101. hc keybind $Mod-Control-Down resize down +$resizestep
  102. hc keybind $Mod-Control-Up resize up +$resizestep
  103. hc keybind $Mod-Control-Right resize right +$resizestep
  104. hc keybind $Mod-Control-s resize left +$resizestep
  105. hc keybind $Mod-Control-d resize down +$resizestep
  106. hc keybind $Mod-Control-e resize up +$resizestep
  107. hc keybind $Mod-Control-f resize right +$resizestep
  108. # tags
  109. tag_names=( {1..9} )
  110. tag_keys=( {1..9} 0 )
  111. hc rename default "${tag_names[0]}" || true
  112. for i in "${!tag_names[@]}" ; do
  113. hc add "${tag_names[$i]}"
  114. key="${tag_keys[$i]}"
  115. if ! [ -z "$key" ] ; then
  116. hc keybind "$Mod-$key" use_index "$i"
  117. hc keybind "$Mod-Shift-$key" move_index "$i"
  118. fi
  119. done
  120. # cycle through tags
  121. hc keybind $Mod-period use_index +1 --skip-visible
  122. hc keybind $Mod-comma use_index -1 --skip-visible
  123. hc keybind $Mod-v use_index +1 --skip-visible
  124. hc keybind $Mod-x use_index -1 --skip-visible
  125. #hc keybind $Mod-"]" use_index +1 --skip-visible ... idk if that's how to do that...
  126. #hc keybind $Mod-"[" use_index -1 --skip-visible ... idk if that's how to do that...
  127. #
  128. # and will want
  129. # cycle through tags and take current window with you (... maybe? or?)
  130. # and a -Shift- version which moves the current window there ?
  131. hc keybind $Mod-Shift-v move_index +1 --skip-visible
  132. hc keybind $Mod-Shift-x move_index -1 --skip-visible
  133. # layouting
  134. #hc keybind $Mod-r remove #needs rebound, mod-r's for dmenu.
  135. #hc keybind $Mod-s floating toggle
  136. hc keybind $Mod-t floating toggle #tiling toggle. ;D smart.
  137. #hc keybind $Mod-f fullscreen toggle
  138. hc keybind $Mod-g fullscreen toggle
  139. #hc keybind $Mod-Shift-f set_attr clients.focus.floating toggle
  140. #hc keybind $Mod-b spawn /home/digit/gittings/herbstluftwm/scripts/maximise.sh #toggle #maximise.sh ? ize! XD
  141. hc keybind $Mod-b spawn maximize.sh
  142. hc keybind $Mod-Shift-g set_attr clients.focus.floating toggle #idk is this a pop-out-to-float bind?
  143. #hc keybind $Mod-Shift-m set_attr clients.focus.minimized true
  144. hc keybind $Mod-Shift-c set_attr clients.focus.minimized true #if this is minimise...
  145. #hc keybind $Mod-Control-m jumpto last-minimized
  146. hc keybind $Mod-Control-c jumpto last-minimized #if this is unminimise... ... i should try add that to openbox too.
  147. #hc keybind $Mod-p pseudotile toggle
  148. hc keybind $Mod-Shift-t pseudotile toggle ###... hrmm... o_O compare against floating toggle on mod-t... this is just inside the frame... i think.
  149. # The following cycles through the available layouts within a frame, but skips
  150. # layouts, if the layout change wouldn't affect the actual window positions.
  151. # I.e. if there are two windows within a frame, the grid layout is skipped.
  152. hc keybind $Mod-space \
  153. or , and . compare tags.focus.curframe_wcount = 2 \
  154. . cycle_layout +1 vertical horizontal max vertical grid \
  155. , cycle_layout +1
  156. # mouse
  157. hc mouseunbind --all
  158. hc mousebind $Mod-Button1 move
  159. hc mousebind $Mod-Button2 zoom
  160. hc mousebind $Mod-Button3 resize
  161. # focus
  162. hc keybind $Mod-BackSpace cycle_monitor
  163. hc keybind $Mod-Tab cycle_all +1
  164. hc keybind $Mod-Shift-Tab cycle_all -1
  165. #hc keybind $Mod-c cycle #( using for remove, for now.)
  166. hc keybind $Mod-Shift-space cycle
  167. hc keybind $Mod-i jumpto urgent
  168. #digbinds scratchpad of kiybends ;D
  169. hc keybind $Mod-Shift-F6 spawn xkill
  170. hc keybind $Mod-z spawn scrot /home/digit/images/scrots/
  171. # <command>scrot /home/digit/images/scrots/</command>
  172. #digbinds notion,
  173. # have mod shift e/d be jumping splits.
  174. # have mod e/d be traversing the stack (like mod tab and mod shift tab)
  175. # theme
  176. hc attr theme.tiling.reset 1
  177. hc attr theme.floating.reset 1
  178. hc set frame_border_active_color '#ffffff'
  179. hc set frame_border_normal_color '#573838'
  180. hc set frame_bg_normal_color '#575757'
  181. #hc set frame_bg_active_color '#345F0Caa' #default
  182. hc set frame_bg_active_color '#ff8800' #digits
  183. hc set frame_border_width 1
  184. hc set always_show_frame on
  185. hc set frame_bg_transparent on
  186. hc set frame_transparent_width 1
  187. hc set frame_gap 0
  188. hc attr theme.title_height 7
  189. hc attr theme.title_font 'nztt:pixelsize=6' # example using Xft
  190. # hc attr theme.title_font '-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*'
  191. hc attr theme.padding_top 1 # space below the title's baseline (i.e. text depth)
  192. hc attr theme.active.color '#60492F' #digits default:'#345F0Cef'
  193. hc attr theme.title_color '#ffffff'
  194. hc attr theme.normal.color '#323232'
  195. hc attr theme.urgent.color '#7811A1'
  196. hc attr theme.normal.title_color '#898989'
  197. hc attr theme.inner_width 1
  198. hc attr theme.inner_color black
  199. hc attr theme.border_width 1
  200. hc attr theme.floating.border_width 1
  201. hc attr theme.floating.outer_width 1
  202. hc attr theme.floating.outer_color black
  203. hc attr theme.active.inner_color '#789161'
  204. hc attr theme.urgent.inner_color '#9A65B0'
  205. hc attr theme.normal.inner_color '#606060'
  206. # copy inner color to outer_color
  207. for state in active urgent normal ; do
  208. hc substitute C theme.${state}.inner_color \
  209. attr theme.${state}.outer_color C
  210. done
  211. hc attr theme.active.outer_width 1
  212. hc attr theme.background_color '#222222'
  213. #trying to get active border white...
  214. #i made this up, blind, didnt look up what.
  215. #hc attr theme.border_active_color '#000000'
  216. #hc attr theme.border_active_color '#ffffff'
  217. hc set window_gap 0
  218. #hc set frame_padding 3
  219. hc set frame_padding 0
  220. hc set smart_window_surroundings off
  221. hc set smart_frame_surroundings on
  222. #hc set mouse_recenter_gap 1 1 #seems null effect
  223. hc set mouse_recenter_gap 1
  224. # rules
  225. hc unrule -F
  226. #hc rule class=XTerm tag=3 # move all xterms to tag 3
  227. hc rule focus=on # normally focus new clients
  228. hc rule floatplacement=smart
  229. #hc rule focus=off # normally do not focus new clients
  230. # give focus to most common terminals
  231. #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
  232. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
  233. hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
  234. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
  235. hc set tree_style '╾│ ├└╼─┐'
  236. # unlock, just to be sure
  237. hc unlock
  238. # do multi monitor setup here, e.g.:
  239. # hc set_monitors 1280x1024+0+0 1280x1024+1280+0
  240. # or simply:
  241. # hc detect_monitors
  242. # find the panel
  243. panel=~/.config/herbstluftwm/panel.sh
  244. [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
  245. for monitor in $(hc list_monitors | cut -d: -f1) ; do
  246. # start it on each monitor
  247. "$panel" "$monitor" &
  248. done
  249. #####
  250. ####
  251. ###
  252. ##
  253. #
  254. # Digit's herbstluftwm wishlist
  255. #
  256. ## ( ideas/snippets/jank/pseudocode goes here. )
  257. ###
  258. ####
  259. #####
  260. # bring WINID
  261. # gonna want some of that. :)
  262. # mirror <- is in the manual, called that.
  263. # horizontal|vertical|both ... both? curious... not like a toggle h/v in xmonad.
  264. # multi-window scratchpads
  265. # herb3terminal.sh can do this, said bv in #herbstluftwm on libera.chat
  266. # q3terminal.sh is wat they meant so, i copied it to ~/bin and chmodded, now just bind it to what your want your main dynamic scratchpad to be bound to... ... when i remember gow to bind keys in herbstluftwm. h3rbinal.sh
  267. #hc keybind $Mod-Shift-F6 spawn xkil
  268. #hc keybind $Mod-F3 spawn q3terminal.sh #main dynamic scratchpad
  269. #hrm, gotta rebind this. for some reason doesnt work on kinesis advantage's soft Function buttons.
  270. hc keybind $Mod-F3 spawn h3rbinal.sh #main dynamic scratchpad
  271. # for some reason, kinesis advantage's f3 is XF86AudioPrev, not F3, in xev.
  272. hc keybind $Mod-XF86AudioPrev spawn h3rbinal.sh #main dynamic scratchpad
  273. #better one
  274. hc keybind $Mod-w spawn h3rbinal.sh #main dynamic scratchpad
  275. #... simple as that?
  276. #yup, tho mibi better on
  277. #hc keybind $Mod-` spawn h3rbinal.sh #main dynamic scratchpad
  278. #hc keybind $Mod-'`' spawn h3rbinal.sh #main dynamic scratchpad
  279. #hc keybind $Mod-"`" spawn h3rbinal.sh #main dynamic scratchpad
  280. #hc keybind $Mod-\` spawn h3rbinal.sh #main dynamic scratchpad
  281. #hc keybind $Mod-"\`" spawn h3rbinal.sh #main dynamic scratchpad
  282. #hc keybind $Mod-'\`' spawn h3rbinal.sh #main dynamic scratchpad
  283. #hc keybind $Mod-"`" spawn h3rbinal.sh #main dynamic scratchpad
  284. #hc keybind $Mod-\` spawn h3rbinal.sh #main dynamic scratchpad
  285. # well, this works
  286. hc keybind $Mod-Escape spawn h3rbinal.sh #main dynamic scratchpad
  287. # thnx rudi_s. ` = grave. "how X handles" & man:keysymdef.h:"XK_grave"
  288. hc keybind $Mod-grave spawn h3rbinal.sh #main dynamic scratchpad