autostart 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. #!/usr/bin/env bash
  2. # this is a simple config for herbstluftwm
  3. hc() {
  4. herbstclient "$@"
  5. }
  6. hc emit_hook reload
  7. xsetroot -solid '#5A8E3A'
  8. ### AUTOSTART ###
  9. # dtach -n cmux cmus &
  10. # picom &
  11. # audacious -p &
  12. # transmission-init.sh &
  13. # nitrogen --set-zoom-fill --random
  14. # volumeicon
  15. # trayer --padding 2 --tint 0x222222 --transparent true --edge top --edge right
  16. # remove all existing keybindings
  17. hc keyunbind --all
  18. # keybindings
  19. # if you have a super key you will be much happier with Mod set to Mod4
  20. Mod=Mod4 # Use the super key as the main modifier
  21. myTerm=kitty
  22. hc keybind $Mod-Shift-q quit
  23. hc keybind $Mod-Shift-r reload
  24. hc keybind $Mod-q close
  25. # hc keybind $Mod-Shift-Return spawn $myTerm
  26. hc keybind $Mod-Shift-Return spawn "${myTerm:-xterm}" # use your $TERMINAL with xterm as fallback
  27. # hc keybind $Mod-Shift-Return spawn "${TERMINAL:-xterm}" # use your $TERMINAL with xterm as fallback
  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. # moving clients in tiling and floating mode
  39. hc keybind $Mod-Shift-Left shift left
  40. hc keybind $Mod-Shift-Down shift down
  41. hc keybind $Mod-Shift-Up shift up
  42. hc keybind $Mod-Shift-Right shift right
  43. hc keybind $Mod-Shift-h shift left
  44. hc keybind $Mod-Shift-j shift down
  45. hc keybind $Mod-Shift-k shift up
  46. hc keybind $Mod-Shift-l shift right
  47. # splitting frames
  48. # create an empty frame at the specified direction
  49. hc keybind $Mod-u split bottom 0.5
  50. hc keybind $Mod-o split right 0.5
  51. # let the current frame explode into subframes
  52. hc keybind $Mod-e split explode
  53. # resizing frames and floating clients
  54. resizestep=0.02
  55. hc keybind $Mod-Control-h resize left +$resizestep
  56. hc keybind $Mod-Control-j resize down +$resizestep
  57. hc keybind $Mod-Control-k resize up +$resizestep
  58. hc keybind $Mod-Control-l resize right +$resizestep
  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. # tags
  64. tag_names=( {1..9} )
  65. tag_keys=( {1..9} 0 )
  66. hc rename default "${tag_names[0]}" || true
  67. for i in "${!tag_names[@]}" ; do
  68. hc add "${tag_names[$i]}"
  69. key="${tag_keys[$i]}"
  70. if ! [ -z "$key" ] ; then
  71. hc keybind "$Mod-$key" use_index "$i"
  72. hc keybind "$Mod-Shift-$key" move_index "$i"
  73. fi
  74. done
  75. # cycle through tags
  76. hc keybind $Mod-period use_index +1 --skip-invisible
  77. hc keybind $Mod-comma use_index -1 --skip-invisible
  78. hc keybind $Mod-a use_previous
  79. # layouting
  80. hc keybind $Mod-r remove
  81. hc keybind $Mod-Shift-t floating toggle
  82. hc keybind $Mod-t set_attr clients.focus.floating toggle
  83. hc keybind $Mod-f fullscreen toggle
  84. hc keybind $Mod-d pseudotile toggle
  85. # The following cycles through the available layouts within a frame, but skips
  86. # layouts, if the layout change wouldn't affect the actual window positions.
  87. # I.e. if there are two windows within a frame, the grid layout is skipped.
  88. hc keybind $Mod-space \
  89. or , and . compare tags.focus.curframe_wcount = 2 \
  90. . cycle_layout +1 vertical horizontal max vertical grid \
  91. , cycle_layout +1
  92. # mouse
  93. hc mouseunbind --all
  94. hc mousebind $Mod-Button1 move
  95. hc mousebind $Mod-Button2 zoom
  96. hc mousebind $Mod-Button3 resize
  97. # focus
  98. hc keybind $Mod-BackSpace cycle_monitor
  99. hc keybind $Mod-Tab cycle_all +1
  100. hc keybind $Mod-Shift-Tab cycle_all -1
  101. hc keybind $Mod-c cycle
  102. hc keybind $Mod-i jumpto urgent
  103. # theme
  104. hc attr theme.tiling.reset 1
  105. hc attr theme.floating.reset 1
  106. hc set frame_border_active_color '#b200b2'
  107. hc set frame_border_normal_color '#282828'
  108. hc set frame_bg_normal_color '#565656'
  109. hc set frame_bg_active_color '#345F0C'
  110. hc set frame_border_width 1
  111. hc set always_show_frame on
  112. hc set frame_bg_transparent on
  113. hc set frame_transparent_width 1
  114. hc set frame_gap 1
  115. # hc attr theme.active.color '#9fbc00'
  116. hc attr theme.active.color '#FFFFFF'
  117. hc attr theme.normal.color '#454545'
  118. hc attr theme.urgent.color orange
  119. hc attr theme.inner_width 1
  120. hc attr theme.inner_color black
  121. hc attr theme.border_width 3
  122. hc attr theme.floating.border_width 4
  123. hc attr theme.floating.outer_width 1
  124. hc attr theme.floating.outer_color black
  125. hc attr theme.active.inner_color '#3E4A00'
  126. hc attr theme.active.outer_color '#3E4A00'
  127. hc attr theme.background_color '#141414'
  128. hc set window_gap 0
  129. hc set frame_padding 1
  130. hc set smart_window_surroundings off
  131. hc set smart_frame_surroundings on
  132. hc set mouse_recenter_gap 0
  133. # rules
  134. hc unrule -F
  135. #hc rule class=XTerm tag=3 # move all xterms to tag 3
  136. hc rule focus=on # normally focus new clients
  137. #hc rule focus=off # normally do not focus new clients
  138. # give focus to most common terminals
  139. #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
  140. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
  141. hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
  142. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
  143. hc set tree_style '╾│ ├└╼─┐'
  144. # unlock, just to be sure
  145. hc unlock
  146. # do multi monitor setup here, e.g.:
  147. # hc set_monitors 1280x1024+0+0 1280x1024+1280+0
  148. # or simply:
  149. # hc detect_monitors
  150. # find the panel
  151. panel="$SCRIPTS/panel.sh"
  152. # panel=/usr/bin/barpyrus turned off for lxqt
  153. # panel="$SCRIPTS/polybar.sh"
  154. [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
  155. for monitor in $(hc list_monitors | cut -d: -f1) ; do
  156. # start it on each monitor
  157. "$panel" "$monitor" &
  158. done
  159. ### CUSTOM KEYBINDINGS AND STUFF ###
  160. hc set focus_follows_mouse on
  161. hc set hide_covered_windows on
  162. ### MY KEYBINDINGS ###
  163. # Misc
  164. hc keybind Mod1-g spawn steam
  165. hc keybind Mod1-Shift-t spawn teamspeak3
  166. hc keybind Mod1-v spawn qutebrowser "qute://settings"
  167. hc keybind Mod1-Shift-v spawn vimb
  168. hc keybind Mod1-w spawn palemoon
  169. hc keybind Mod1-Shift-n spawn nitrogen --set-zoom-fill --random
  170. hc keybind Ctrl-Mod1-t spawn $myTerm -e dtach -A dvtx dvtm -M
  171. # hc keybind Mod1-l spawn $myTerm -e lf
  172. # hc keybind Mod1-l spawn $myTerm -e dvtm -m ^z -M f
  173. hc keybind Mod1-d spawn $myTerm -e stig
  174. hc keybind Mod1-r spawn redshift -b 0.95 -O 5000K
  175. hc keybind Mod1-Shift-r spawn redshift -x
  176. hc keybind Mod1-e spawn emacsclient -a "" -c
  177. hc keybind Mod1-F11 spawn $myTerm -e bpytop
  178. hc keybind F12 spawn qalculate-gtk
  179. # hc keybind Button8 spawn xmenu.sh
  180. hc keybind Mod1-F9 spawn $myTerm -e dtach -A aerx aerc
  181. # Screen capture
  182. hc keybind Print spawn flameshot gui
  183. hc keybind $Mod-Print spawn screenshot.sh full
  184. hc keybind Mod1-Print spawn screenshot.sh 16x9
  185. hc keybind Mod1-Shift-Print spawn screenshot.sh 4x3
  186. hc keybind Mod1-Shift-c spawn screenshot.sh select
  187. hc keybind Mod1-c spawn screenshot.sh clipboard
  188. # rofi
  189. # hc keybind Mod1-p spawn rofi -modi "run,ssh" -show run
  190. hc keybind $Mod-p spawn ~/.config/herbstluftwm/dmenu_run_hlwm
  191. hc keybind Mod1-p spawn rofi -show drun -show-icons
  192. hc keybind Mod1-F11 spawn rofimoji -action clipboard
  193. hc keybind Mod1-F12 spawn rofi -show calc -modi "calc:qalc +u8 -nocurrencies"
  194. hc keybind $Mod-Shift-p spawn rofi -show
  195. # Audio
  196. hc keybind Mod1-a spawn $myTerm -e pulsemixer
  197. hc keybind $Mod-F2 spawn pamixer --decrease 2
  198. hc keybind $Mod-F3 spawn pamixer --increase 2
  199. hc keybind $Mod-F4 spawn pamixer --toggle-mute
  200. hc keybind Mod1+F1 spawn audacious -m
  201. hc keybind Mod1+F2 spawn audtool --set-volume -2% # vol dec
  202. hc keybind Mod1+F3 spawn audtool --set-volume +2% # vol inc
  203. hc keybind Mod1+Shift+F5 spawn audtool --playlist-toggle-shuffle # shuffle toggle
  204. hc keybind Mod1+F5 spawn audtool --playback-stop # stop
  205. hc keybind Mod1+F6 spawn audtool --playlist-reverse # prev toggle
  206. hc keybind Mod1+F7 spawn audtool --playback-pause & audacious-notify.sh # play toggle
  207. hc keybind Mod1+F8 spawn audtool --playlist-advance # next
  208. # hc keybind Mod1-F1 spawn $myTerm -e ncmpcpp
  209. # hc keybind Mod1-F2 spawn mpc volume -2
  210. # hc keybind Mod1-F3 spawn mpc volume +2
  211. # hc keybind Mod1-F5 spawn mpc stop
  212. # hc keybind Mod1-F6 spawn mpc prev
  213. # hc keybind Mod1-F7 spawn mpc toggle
  214. # hc keybind Mod1-F8 spawn mpc next
  215. # ### LAPTOP ###
  216. # hc keybind $Mod-F2 spawn xbacklight -dec 2
  217. # hc keybind $Mod-F3 spawn xbacklight -inc 1
  218. # hc keybind $Mod-F6 spawn pamixer --toggle-mute
  219. # hc keybind $Mod-F7 spawn pamixer --decrease 2
  220. # hc keybind $Mod-F8 spawn pamixer --increase 1
  221. # hc keybind Mod1-F7 spawn cmus-remote --volume -2%
  222. # hc keybind Mod1-F8 spawn cmus-remote --volume +2%
  223. # hc keybind Mod1-F9 spawn music_manager.sh prev
  224. # hc keybind Mod1-F10 spawn music_manager.sh toggle
  225. # hc keybind Mod1-F11 spawn music_manager.sh next
  226. # hc keybind XF86AudioRaiseVolume spawn pamixer --decrease 2
  227. # hc keybind XF86AudioLowerVolume spawn pamixer --increase 1
  228. # MY KEYBINDINGS ###
  229. hc keybind $mod+Shift+Tab focus left
  230. hc keybind $mod+Tab focus right
  231. hc keybind $mod+x spawn xkill
  232. hc keybind Mod1+l spawn i3lock-wrapper
  233. hc keybind $Mod+b spawn polybar-msg cmd toggle
  234. # Misc
  235. hc keybind Mod1+g spawn steam
  236. hc keybind Mod1+Shift+t spawn teamspeak3
  237. hc keybind Mod1+Shift+v spawn qutebrowser "qute://settings"
  238. hc keybind Mod1+v spawn vimb
  239. hc keybind Mod1+w spawn palemoon
  240. hc keybind Mod1+Shift+n spawn nitrogen --set-zoom-fill --random
  241. hc keybind Mod1+Ctrl+t spawn $myTerm -e dtach -A /tmp/dvtx dvtm -m  -M f
  242. hc keybind Mod1+Ctrl+l spawn $myTerm -e dtach -A /tmp/ffx fff
  243. hc keybind Mod1+d spawn $myTerm -e stig
  244. hc keybind Mod1+r spawn redshift -b 0.95 -O 5000K
  245. hc keybind Mod1+Shift+r spawn redshift -x
  246. hc keybind Mod1+e spawn emacsclient -a "" -c
  247. hc keybind Mod1+f spawn rox
  248. # Screen capture
  249. hc keybind Print spawn flameshot gui
  250. hc keybind $Mod+Print spawn screenshot.sh full
  251. hc keybind $Mod+Shift+Print spawn screenshot.sh focused
  252. hc keybind Mod1+Shift+c spawn screenshot.sh select
  253. hc keybind Mod1+c spawn screenshot.sh clipboard
  254. hc keybind Mod1+1 spawn screenshot.sh 16x9
  255. hc keybind Mod1+4 spawn screenshot.sh 4x3
  256. # Audio
  257. hc keybind $Mod+F2 spawn pamixer --decrease 2
  258. hc keybind $Mod+F3 spawn pamixer --increase 2
  259. hc keybind $Mod+F4 spawn pamixer --toggle-mute
  260. hc keybind Mod1+a spawn $myTerm -e pulsemixer
  261. hc keybind Mod1+F1 spawn audacious -m
  262. hc keybind Mod1+F2 spawn audtool --set-volume -2% # vol dec
  263. hc keybind Mod1+F3 spawn audtool --set-volume +2% # vol inc
  264. hc keybind Mod1+Shift+F5 spawn audtool --playlist-toggle-shuffle # shuffle toggle
  265. hc keybind Mod1+F5 spawn audtool --playback-stop # stop
  266. hc keybind Mod1+F6 spawn audtool --playlist-reverse # prev toggle
  267. hc keybind Mod1+F7 spawn audtool --playback-pause && audacious-notify.sh # play toggle
  268. hc keybind Mod1+F8 spawn audtool --playlist-advance # next
  269. hc keybind Mod1+F9 spawn $myTerm -e dtach -A /tmp/aerx aerc
  270. hc keybind Mod1+F11 spawn $myTerm -e bpytop
  271. hc keybind Mod1+F12 spawn $myTerm -e qalc
  272. hc keybind Mod1+Shift+F12 spawn qalculate-gtk