Advertisement
poetician

Herbstluftwm Autostart

Jan 12th, 2020
1,619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.13 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. function run {
  4. if ! pgrep $1 ;
  5. then
  6. $@&
  7. fi
  8. }
  9.  
  10. #change your keyboard if you need it
  11. #setxkbmap -layout be
  12.  
  13. #Autostart applications
  14. pkill -u $USER '^picom$'
  15. picom --config $HOME/.config/herbstluftwm/picom.conf &
  16. /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
  17. /usr/lib/xfce4/notifyd/xfce4-notifyd &
  18.  
  19. xsetroot -solid '#000000'
  20. xsetroot -cursor_name left_ptr &
  21.  
  22. #keybindings are in config of sxhkd - interchangeable with other TWM
  23. sxhkd -c ~/.config/herbstluftwm/sxhkd/sxhkdrc &
  24.  
  25. #feh --bg-scale ~/.config/herbstluftwm/wall.png &
  26. #feh --bg-fill /usr/share/backgrounds/arcolinux/arco-wallpaper.jpg &
  27. #feh --bg-scale /usr/share/backgrounds/arcolinux/abstract-warm-heart-4560x2160.jpg
  28. #conky -c $HOME/.config/herbstluftwm/system-overview &
  29.  
  30. cherrytree &
  31. dropbox &
  32. megasync &
  33. my-weather-indicator &
  34. nm-applet &
  35. # nemo &
  36. numlockx on &
  37. pamac-tray &
  38. parcellite &
  39. # screenkey &
  40. run variety &
  41. # vivaldi-stable &
  42. run volumeicon &
  43. xfce4-power-manager &
  44. xcreensaver &
  45. xscreensaver-demo &
  46. # blueberry-tray &
  47. # nitrogen --restore &
  48. # caffeine &
  49. # firefox &
  50. # thunar &
  51. # run insync start &
  52. # discord &
  53. # spotify &
  54. # atom &
  55.  
  56. #herbstluftwm start
  57. hc() {
  58. herbstclient "$@"
  59. }
  60.  
  61. hc emit_hook reload
  62.  
  63. # KEYBINDINGS
  64.  
  65. # remove all existing keybindings
  66. hc keyunbind --all
  67.  
  68. # if you have a super key you will be much happier with Mod set to Mod4
  69. #Mod=Mod1 # Use alt as the main modifier
  70. Mod=Mod4 # Use the super key as the main modifier
  71.  
  72. hc keybind $Mod-Shift-x quit
  73. hc keybind $Mod-Shift-r reload
  74. hc keybind $Mod-Shift-q close
  75. hc keybind $Mod-q close
  76.  
  77. #Most of the keybindings have been set in sxhkd config file
  78. #you can set them also here
  79.  
  80. #reload sxhkd - see keybind in sxhkd
  81. #hc keybind $Mod-Shift-s pkill -USR1 -x sxhkd
  82.  
  83. # MOVEMENTS
  84.  
  85. # focusing clients
  86. hc keybind $Mod-Left focus left
  87. hc keybind $Mod-Down focus down
  88. hc keybind $Mod-Up focus up
  89. hc keybind $Mod-Right focus right
  90. hc keybind $Mod-h focus left
  91. hc keybind $Mod-j focus down
  92. hc keybind $Mod-k focus up
  93. hc keybind $Mod-l focus right
  94.  
  95. # moving clients to ... on single Monitor
  96. hc keybind $Mod-Shift-Left shift left
  97. hc keybind $Mod-Shift-Down shift down
  98. hc keybind $Mod-Shift-Up shift up
  99. hc keybind $Mod-Shift-Right shift right
  100. hc keybind $Mod-Shift-h shift left
  101. hc keybind $Mod-Shift-j shift down
  102. hc keybind $Mod-Shift-k shift up
  103. hc keybind $Mod-Shift-l shift right
  104.  
  105. # moving clients to ... on dual monitor
  106. # hc keybind $Mod-Shift-h chain , lock , shift_to_monitor -l , focus_monitor -l , unlock
  107. # hc keybind $Mod-Shift-Left chain , lock , shift_to_monitor -l , focus_monitor -l , unlock
  108. # hc keybind $Mod-Shift-j chain , lock , shift_to_monitor -l , focus_monitor -l , unlock
  109. # hc keybind $Mod-Shift-Down chain , lock , shift_to_monitor -l , focus_monitor -l , unlock
  110. # hc keybind $Mod-Shift-k chain , lock , shift_to_monitor -r , focus_monitor -r , unlock
  111. # hc keybind $Mod-Shift-Up chain , lock , shift_to_monitor -r , focus_monitor -r , unlock
  112. # hc keybind $Mod-Shift-l chain , lock , shift_to_monitor -r , focus_monitor -r , unlock
  113. # hc keybind $Mod-Shift-Right chain , lock , shift_to_monitor -r , focus_monitor -r , unlock
  114.  
  115. # FRAMES
  116.  
  117. # create an empty frame at the specified direction
  118. hc keybind $Mod-u split bottom 0.5
  119. hc keybind $Mod-o split right 0.5
  120. # let the current frame explode into subframes
  121. hc keybind $Mod-Control-space split explode
  122. # remove frame
  123. hc keybind $Mod-r remove
  124.  
  125. # resizing frames
  126. resizestep=0.05
  127. hc keybind $Mod-Control-h resize left +$resizestep
  128. hc keybind $Mod-Control-j resize down +$resizestep
  129. hc keybind $Mod-Control-k resize up +$resizestep
  130. hc keybind $Mod-Control-l resize right +$resizestep
  131. hc keybind $Mod-Control-Left resize left +$resizestep
  132. hc keybind $Mod-Control-Down resize down +$resizestep
  133. hc keybind $Mod-Control-Up resize up +$resizestep
  134. hc keybind $Mod-Control-Right resize right +$resizestep
  135.  
  136. # TAGS or WORKSPACES
  137.  
  138. #names to display in menu
  139. tag_names=( {1..10} )
  140. #tag_names=("www" "text" "gimp" "meld" "vlc" "mail" "vb" "image" "code" "chat")
  141. #tag_names=("I" "II" "III" "IV" "V" "VI" "VII" "VIII" "IX" "X")
  142.  
  143. #keys to press to get to the tags
  144. #Qwerty
  145. tag_keys=( {1..10} 0 )
  146.  
  147. #Belgian azerty
  148. #tag_keys=( ampersand eacute quotedbl apostrophe parenleft section egrave exclam ccedilla agrave )
  149.  
  150. #French azerty
  151. #tag_keys=( ampersand eacute quotedbl apostrophe parenleft minus egrave underscore ccedilla agrave )
  152.  
  153. #Discord tip for some keyboards
  154. #tag_keys=( "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" )
  155.  
  156. hc rename default "${tag_names[0]}" || true
  157. for i in ${!tag_names[@]} ; do
  158. hc add "${tag_names[$i]}"
  159. # horizontal tiling as standard
  160. hc set_layout horizontal
  161. hc set default_frame_layout 1
  162. key="${tag_keys[$i]}"
  163. if ! [ -z "$key" ] ; then
  164. hc keybind "$Mod-$key" use_index "$i"
  165. hc keybind "$Mod-Shift-$key" chain , move_index "$i" , use_index "$i"
  166. fi
  167. done
  168.  
  169. # layouting
  170. hc keybind $Mod-s floating toggle
  171. hc keybind $Mod-f fullscreen toggle
  172. hc keybind $Mod-p pseudotile toggle
  173. # The following cycles through the available layouts within a frame, but skips
  174. # layouts, if the layout change wouldn't affect the actual window positions.
  175. # I.e. if there are two windows within a frame, the grid layout is skipped.
  176. hc keybind $Mod-space \
  177. or , and . compare tags.focus.curframe_wcount = 2 \
  178. . cycle_layout +1 vertical horizontal max grid \
  179. , cycle_layout +1
  180.  
  181. # mouse
  182. hc mouseunbind --all
  183. hc mousebind $Mod-Button1 move
  184. hc mousebind $Mod-Button2 zoom
  185. hc mousebind $Mod-Button3 resize
  186.  
  187. # focus on ...
  188. hc keybind $Mod-BackSpace cycle_monitor
  189. hc keybind $Mod-Tab use_index +1 --skip-visible
  190. hc keybind $Mod-Shift-Tab use_index -1 --skip-visible
  191. hc keybind Control-Mod1-Left focus left
  192. hc keybind Control-Mod1-Up focus up
  193. hc keybind Control-Mod1-Right focus right
  194. hc keybind Control-Mod1-Down focus down
  195. hc keybind Mod1-Tab use_index +1 --skip-visible
  196. hc keybind Mod1-Shift-Tab use_index -1 --skip-visible
  197. #hc keybind $Mod-c cycle
  198. hc keybind $Mod-i jumpto urgent
  199.  
  200. #reset prior to setting the theme
  201. hc attr theme.reset 1
  202.  
  203. # Attribute
  204. hc attr theme.active.color '#6790EB'
  205. hc attr theme.active.inner_color '#141414'
  206. hc attr theme.active.outer_color '#6790EB'
  207. hc attr theme.background_color '#141414'
  208. hc attr theme.border_width 4
  209. hc attr theme.floating.border_width 4
  210. hc attr theme.floating.outer_width 4
  211. hc attr theme.floating.outer_color black
  212. hc attr theme.inner_color black
  213. hc attr theme.inner_width 1
  214. hc attr theme.normal.color '#141414'
  215. hc attr theme.urgent.color orange
  216.  
  217. # Set
  218. hc set always_show_frame 1
  219. hc set focus_follows_mouse 1
  220. hc set frame_border_active_color '#6790EB'
  221. hc set frame_border_normal_color '#141414'
  222. hc set frame_bg_normal_color '#141414'
  223. hc set frame_bg_active_color '#6790EB'
  224. hc set frame_border_width 3
  225. hc set frame_bg_transparent 1
  226. hc set frame_transparent_width 0
  227. hc set frame_gap 5
  228. hc set frame_padding 4
  229. hc set mouse_recenter_gap 0
  230. hc set smart_frame_surroundings 1
  231. hc set smart_window_surroundings 1
  232. hc set tree_style '╾│ ├└╼─┐'
  233. hc set window_gap 5
  234.  
  235.  
  236. # RULES
  237. hc unrule -F
  238. hc rule focus=on # normally focus new clients
  239. #hc rule focus=off # normally do not focus new clients
  240.  
  241. #assign applications to workspaces or tags
  242. hc rule class~'(firefox|Vivaldi-stable|Vivaldi-snapshot|Chromium|Google-chrome)' tag=1
  243. hc rule class~'(Atom|Subl3|Nemo)' tag=2
  244. hc rule class=vlc tag=3
  245. hc rule class=libreoffice-startcenter tag=4
  246. hc rule class=kdenlive tag=5
  247. hc rule class=glimpse-0.1 tag=6
  248. hc rule class=google-earth-pro tag=7
  249. hc rule class=Cherrytree tag=8
  250. hc rule class=Meld tag=9
  251. hc rule class=Notepadqq tag=10
  252.  
  253. # give focus to most common terminals
  254. #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
  255. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
  256. hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
  257. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
  258. hc rule class=Oblogout fullscreen=on
  259. hc rule class=Insync pseudotile=on
  260. hc rule class=VirtualBox fullscreen=on
  261.  
  262. # unlock, just to be sure
  263. hc unlock
  264.  
  265. #Dualmonitor setup
  266. # Find out your monitor name with xrandr or arandr (save and you get this line)
  267. #xrandr --output VGA-1 --primary --mode 1360x768 --pos 0x0 --rotate normal
  268. #xrandr --output DP2 --primary --mode 1920x1080 --rate 60.00 --output LVDS1 --off &
  269. #xrandr --output LVDS1 --mode 1366x768 --output DP3 --mode 1920x1080 --right-of LVDS1
  270. #xrandr --output HDMI2 --mode 1920x1080 --pos 1920x0 --rotate normal --output HDMI1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off
  271.  
  272. #Dualmonitor setup
  273. # hc detect_monitors
  274. #hc set_monitors 1920x1080+0+0 1920x1080+1920+0
  275.  
  276. #room for polybar on both monitors
  277. #single polybar at top
  278. hc pad 2 30
  279. #second polybar at bottom
  280. #hc pad 0 30 0 30 0
  281. #single polybar at top
  282. hc pad 1 30
  283. #second polybar at bottom
  284. #hc pad 1 30 0 30 0
  285.  
  286. #launching polybar
  287. ~/.config/polybar/launch.sh
  288. z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement