poetician

Herbstluft autostart | ArcoLinux Dual Screen

Sep 23rd, 2020
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.50 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. #herbstluftwm start
  11. hc() {
  12. herbstclient "$@"
  13. }
  14.  
  15. hc emit_hook reload
  16.  
  17. # KEYBINDINGS
  18.  
  19. # remove all existing keybindings
  20. hc keyunbind --all
  21.  
  22. # if you have a super key you will be much happier with Mod set to Mod4
  23. #Mod=Mod1 # Use alt as the main modifier
  24. Mod=Mod4 # Use the super key as the main modifier
  25.  
  26. # hc keybind $Mod-Shift-x quit
  27. # hc keybind $Mod-Shift-r reload
  28. # hc keybind $Mod-Shift-q close
  29. # hc keybind $Mod-q close
  30.  
  31. #Most of the keybindings have been set in sxhkd config file
  32. #you can set them also here
  33.  
  34. #reload sxhkd - see keybind in sxhkd
  35. #hc keybind $Mod-Shift-s pkill -USR1 -x sxhkd
  36.  
  37. # MOVEMENTS
  38.  
  39. # focusing clients
  40. hc keybind $Mod-Left focus left
  41. hc keybind $Mod-Down focus down
  42. hc keybind $Mod-Up focus up
  43. hc keybind $Mod-Right focus right
  44. hc keybind $Mod-h focus left
  45. hc keybind $Mod-j focus down
  46. hc keybind $Mod-k focus up
  47. hc keybind $Mod-l focus right
  48.  
  49. # moving clients to ... on single Monitor
  50. hc keybind $Mod-Shift-Left shift left
  51. hc keybind $Mod-Shift-Down shift down
  52. hc keybind $Mod-Shift-Up shift up
  53. hc keybind $Mod-Shift-Right shift right
  54. hc keybind $Mod-Shift-h shift left
  55. hc keybind $Mod-Shift-j shift down
  56. hc keybind $Mod-Shift-k shift up
  57. hc keybind $Mod-Shift-l shift right
  58.  
  59. # moving clients to ... on dual monitor
  60. # hc keybind $Mod-Shift-h chain , lock , shift_to_monitor -l , focus_monitor -l , unlock
  61. # hc keybind $Mod-Shift-Left chain , lock , shift_to_monitor -l , focus_monitor -l , unlock
  62. # hc keybind $Mod-Shift-j chain , lock , shift_to_monitor -l , focus_monitor -l , unlock
  63. # hc keybind $Mod-Shift-Down chain , lock , shift_to_monitor -l , focus_monitor -l , unlock
  64. # hc keybind $Mod-Shift-k chain , lock , shift_to_monitor -r , focus_monitor -r , unlock
  65. # hc keybind $Mod-Shift-Up chain , lock , shift_to_monitor -r , focus_monitor -r , unlock
  66. # hc keybind $Mod-Shift-l chain , lock , shift_to_monitor -r , focus_monitor -r , unlock
  67. # hc keybind $Mod-Shift-Right chain , lock , shift_to_monitor -r , focus_monitor -r , unlock
  68.  
  69. # FRAMES
  70.  
  71. # create an empty frame at the specified direction
  72. hc keybind $Mod-u split bottom 0.5
  73. hc keybind $Mod-o split right 0.5
  74. # let the current frame explode into subframes
  75. hc keybind $Mod-Control-space split explode
  76. # remove frame
  77. hc keybind $Mod-r remove
  78.  
  79. # resizing frames
  80. resizestep=0.05
  81. hc keybind $Mod-Control-h resize left +$resizestep
  82. hc keybind $Mod-Control-j resize down +$resizestep
  83. hc keybind $Mod-Control-k resize up +$resizestep
  84. hc keybind $Mod-Control-l resize right +$resizestep
  85. hc keybind $Mod-Control-Left resize left +$resizestep
  86. hc keybind $Mod-Control-Down resize down +$resizestep
  87. hc keybind $Mod-Control-Up resize up +$resizestep
  88. hc keybind $Mod-Control-Right resize right +$resizestep
  89.  
  90. # TAGS or WORKSPACES
  91.  
  92. #names to display in menu
  93. tag_names=( {1..10} )
  94. #tag_names=("Web" "Chat" "Edit" "Meld" "Vb" "Mail" "Video" "Image" "Files" "Music")
  95. #tag_names=("I" "II" "III" "IV" "V" "VI" "VII" "VIII" "IX" "X")
  96.  
  97. #keys to press to get to the tags
  98. #Qwerty
  99. tag_keys=( {1..10} 0 )
  100.  
  101. #tag_keys=( "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" )
  102.  
  103. hc rename default "${tag_names[0]}" || true
  104. for i in ${!tag_names[@]} ; do
  105. hc add "${tag_names[$i]}"
  106. # horizontal tiling as standard
  107. hc set_layout horizontal
  108. hc set default_frame_layout 1
  109. key="${tag_keys[$i]}"
  110. if ! [ -z "$key" ] ; then
  111. hc keybind "$Mod-$key" use_index "$i"
  112. hc keybind "$Mod-Shift-$key" chain , move_index "$i" , use_index "$i"
  113. fi
  114. done
  115.  
  116. # layouting
  117. hc keybind $Mod-s floating toggle
  118. hc keybind $Mod-f fullscreen toggle
  119. hc keybind $Mod-p pseudotile toggle
  120. # The following cycles through the available layouts within a frame, but skips
  121. # layouts, if the layout change wouldn't affect the actual window positions.
  122. # I.e. if there are two windows within a frame, the grid layout is skipped.
  123. hc keybind $Mod-space \
  124. or , and . compare tags.focus.curframe_wcount = 2 \
  125. . cycle_layout +1 vertical horizontal max grid \
  126. , cycle_layout +1
  127.  
  128. # mouse
  129. hc mouseunbind --all
  130. hc mousebind $Mod-Button1 move
  131. hc mousebind $Mod-Button2 zoom
  132. hc mousebind $Mod-Button3 resize
  133.  
  134. # focus on ...
  135. hc keybind $Mod-BackSpace cycle_monitor
  136. hc keybind $Mod-Tab use_index +1 --skip-visible
  137. hc keybind $Mod-Shift-Tab use_index -1 --skip-visible
  138. hc keybind Control-Mod1-Left focus left
  139. hc keybind Control-Mod1-Up focus up
  140. hc keybind Control-Mod1-Right focus right
  141. hc keybind Control-Mod1-Down focus down
  142. hc keybind Mod1-Tab use_index +1 --skip-visible
  143. hc keybind Mod1-Shift-Tab use_index -1 --skip-visible
  144. #hc keybind $Mod-c cycle
  145. hc keybind $Mod-i jumpto urgent
  146.  
  147. #reset prior to setting the theme
  148. hc attr theme.reset 1
  149.  
  150. # Attribute
  151. hc attr theme.active.color '#6790EB'
  152. hc attr theme.active.inner_color '#141414'
  153. hc attr theme.active.outer_color '#6790EB'
  154. hc attr theme.background_color '#141414'
  155. hc attr theme.border_width 3
  156. hc attr theme.floating.border_width 4
  157. hc attr theme.floating.outer_width 1
  158. hc attr theme.floating.outer_color black
  159. hc attr theme.inner_color black
  160. hc attr theme.inner_width 1
  161. hc attr theme.normal.color '#141414'
  162. hc attr theme.urgent.color orange
  163.  
  164. # Set
  165. hc set always_show_frame 1
  166. hc set focus_follows_mouse 1
  167. hc set frame_border_active_color '#6790EB'
  168. hc set frame_border_normal_color '#141414'
  169. hc set frame_bg_normal_color '#141414'
  170. hc set frame_bg_active_color '#000000'
  171. hc set frame_border_width 3
  172. hc set frame_bg_transparent 1
  173. hc set frame_transparent_width 0
  174. hc set frame_gap 5
  175. hc set frame_padding 0
  176. hc set mouse_recenter_gap 0
  177. hc set smart_frame_surroundings 1
  178. hc set smart_window_surroundings 0
  179. hc set tree_style '╾│ ├└╼─┐'
  180. hc set window_gap 5
  181.  
  182.  
  183. # RULES
  184. hc unrule -F
  185. hc rule focus=on # normally focus new clients
  186. #hc rule focus=off # normally do not focus new clients
  187.  
  188. # assign applications to workspaces or tags -using numbers for tags
  189. # These are used then -- tag_names=( {1..10} )
  190.  
  191. # hc rule class~'(Navigator|Firefox|Vivaldi-stable|Vivaldi-snapshot|Chromium|Google-chrome|Brave|Brave-browser)' tag=1 switchtag=on focus=on
  192. # hc rule class~'(navigator|firefox|vivaldi-stable|vivaldi-snapshot|chromium|google-chrome|brave|brave-browser)' tag=1 switchtag=on focus=on
  193. # hc rule class~'(Atom|Subl3|Geany|Brackets|Code-oss|Code|TelegramDesktop|Discord)' tag=2 switchtag=on focus=on
  194. # hc rule class~'(atom|subl3|geany|brackets|code-oss|code|telegramdesktop|discord)' tag=2 switchtag=on focus=on
  195. # hc rule class~'(Inkscape|Nomacs|Ristretto|Nitrogen|Feh)' tag=3 switchtag=on focus=on
  196. # hc rule class~'(inkscape|nomacs|ristretto|nitrogen|feh)' tag=3 switchtag=on focus=on
  197. # hc rule class~'(Gimp)' tag=4 switchtag=on focus=on
  198. # hc rule class~'(gimp)' tag=4 switchtag=on focus=on
  199. # hc rule class~'(Meld|org.gnome.Meld)' tag=5 switchtag=on focus=on
  200. # hc rule class~'(meld|org.gnome.meld)' tag=5 switchtag=on focus=on
  201. # hc rule class~'(Vlc|Mpv)' tag=6 switchtag=on focus=on
  202. # hc rule class~'(vlc|mpv)' tag=6 switchtag=on focus=on
  203. # hc rule class~'(VirtualBox Manager|VirtualBox Machine|Vmplayer)' tag=7 switchtag=on focus=on
  204. # hc rule class~'(virtualbox manager|virtualbox machine|vmplayer)' tag=7 switchtag=on focus=on
  205. # hc rule class~'(Thunar|Nemo|Caja|Nautilus|org.gnome.Nautilus|Pcmanfm|Pcmanfm-qt)' tag=8 switchtag=on focus=on
  206. # hc rule class~'(thunar|nemo|caja|nautilus|org.gnome.nautilus|pcmanfm|pcmanfm-qt)' tag=8 switchtag=on focus=on
  207. # hc rule class~'(Evolution|Geary|Mail|Thunderbird)' tag=9 switchtag=on focus=on
  208. # hc rule class~'(evolution|geary|mail|thunderbird)' tag=9 switchtag=on focus=on
  209. # hc rule class~'(Spotify|Pragha|Clementine|Deadbeef|Audacious)' tag=10 switchtag=on focus=on
  210. # hc rule class~'(spotify|pragha|clementine|deadbeef|audacious)' tag=10 switchtag=on focus=on
  211.  
  212. # assign applications to workspaces or tags - using names for tags
  213. # These are used then -- #tag_names=("Web" "Chat" "Edit" "Meld" "Vb" "Mail" "Video" "Image" "Files" "Music")
  214.  
  215. # hc rule class~'(Navigator|Firefox|Vivaldi-stable|Vivaldi-snapshot|Chromium|Google-chrome|Brave|Brave-browser)' tag='Web' switchtag=on focus=on
  216. # hc rule class~'(navigator|firefox|vivaldi-stable|vivaldi-snapshot|chromium|google-chrome|brave|brave-browser)' tag='Web' switchtag=on focus=on
  217. # hc rule class~'(TelegramDesktop|Discord)' tag='Chat' switchtag=on focus=on
  218. # hc rule class~'(telegramdesktop|discord)' tag='Chat' switchtag=on focus=on
  219. # hc rule class~'(Atom|Subl3|Geany|Brackets|Code-oss|Code)' tag='Edit' switchtag=on focus=on
  220. # hc rule class~'(atom|subl3|geany|brackets|code-oss|code)' tag='Edit' switchtag=on focus=on
  221. # hc rule class~'(Inkscape|Nomacs|Ristretto|Nitrogen|Feh)' tag='Image' switchtag=on focus=on
  222. # hc rule class~'(inkscape|nomacs|ristretto|nitrogen|feh)' tag='Image' switchtag=on focus=on
  223. # hc rule class~'(Gimp)' tag='Image' switchtag=on focus=on
  224. # hc rule class~'(gimp)' tag='Image' switchtag=on focus=on
  225. # hc rule class~'(Meld|org.gnome.Meld)' tag='Meld' switchtag=on focus=on
  226. # hc rule class~'(meld|org.gnome.meld)' tag='Meld' switchtag=on focus=on
  227. # hc rule class~'(Vlc|Mpv)' tag='Video' switchtag=on focus=on
  228. # hc rule class~'(vlc|mpv)' tag='Video' switchtag=on focus=on
  229. # hc rule class~'(VirtualBox Manager|VirtualBox Machine|Vmplayer)' tag='Vb' switchtag=on focus=on
  230. # hc rule class~'(virtualbox manager|virtualbox machine|vmplayer)' tag='Vb' switchtag=on focus=on
  231. # hc rule class~'(Thunar|Nemo|Caja|Nautilus|org.gnome.Nautilus|Pcmanfm|Pcmanfm-qt)' tag='Files' switchtag=on focus=on
  232. # hc rule class~'(thunar|nemo|caja|nautilus|org.gnome.nautilus|pcmanfm|pcmanfm-qt)' tag='Files' switchtag=on focus=on
  233. # hc rule class~'(Evolution|Geary|Mail|Thunderbird)' tag='Mail' switchtag=on focus=on
  234. # hc rule class~'(evolution|geary|mail|thunderbird)' tag='Mail' switchtag=on focus=on
  235. # hc rule class~'(Spotify|Pragha|Clementine|Deadbeef|Audacious)' tag='Music' switchtag=on focus=on
  236. # hc rule class~'(spotify|pragha|clementine|deadbeef|audacious)' tag='Music' switchtag=on focus=on
  237.  
  238. # give focus to most common terminals
  239. #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
  240. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
  241. #hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' manage=off
  242. hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
  243. hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
  244. hc rule class=Oblogout fullscreen=on
  245. hc rule class=Insync pseudotile=on
  246. hc rule class=VirtualBox fullscreen=on
  247. hc rule class=Arcolinux-tweak-tool.py pseudotile=on
  248. hc rule class=Arcolinux-welcome-app.py pseudotile=on
  249. # No solution yet to dropdown xfce4-terminal
  250. # hc rule windowrole=xfce4-terminal-dropdown manage=off
  251.  
  252. # unlock, just to be sure
  253. hc unlock
  254.  
  255. #Dualmonitor setup
  256. # Find out your monitor name with xrandr or arandr (save and you get this line)
  257. xrandr --primary --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-D-0 --mode 1920x1080 --pos 1920x0 --rotate normal --output VIRTUAL1 --off
  258.  
  259. #Dualmonitor setup
  260. # hc detect_monitors
  261. hc set_monitors 1920x1080+0+0 1920x1080+1920+0
  262.  
  263. #room for polybar on both monitors
  264. #single polybar at top
  265. hc pad 0 30
  266. #second polybar at bottom
  267. #hc pad 0 30 0 30 0
  268. #single polybar at top
  269. hc pad 1 30
  270. #second polybar at bottom
  271. #hc pad 1 30 0 30 0
  272.  
  273. #launching polybar
  274. ~/.config/polybar/launch.sh
  275.  
  276. #change your keyboard if you need it
  277. #setxkbmap -layout be
  278.  
  279. #Autostart applications
  280. pkill -u $USER '^picom$'
  281. picom --config $HOME/.config/herbstluftwm/picom.conf &
  282. /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
  283. /usr/lib/xfce4/notifyd/xfce4-notifyd &
  284.  
  285. xsetroot -solid '#000000'
  286. xsetroot -cursor_name left_ptr &
  287.  
  288. #keybindings are in config of sxhkd - interchangeable with other TWM
  289. sxhkd -c ~/.config/herbstluftwm/sxhkd/sxhkdrc &
  290.  
  291. dex $HOME/.config/autostart/arcolinux-welcome-app.desktop
  292. #feh --bg-scale ~/.config/herbstluftwm/wall.png &
  293. feh --bg-fill /usr/share/backgrounds/arcolinux/arco-wallpaper.jpg &
  294. #feh --bg-scale /usr/share/backgrounds/arcolinux/abstract-warm-heart-4560x2160.jpg
  295. conky -c $HOME/.config/herbstluftwm/system-overview &
  296. run variety &
  297. nm-applet &
  298. pamac-tray &
  299. xfce4-power-manager &
  300. numlockx on &
  301. blueberry-tray &
  302. run volumeicon &
  303. # nitrogen --restore &
  304. # caffeine &
  305. # vivaldi-stable &
  306. # firefox &
  307. # thunar &
  308. # dropbox &
  309. # run insync start &
  310. # discord &
  311. # run telegram-desktop &
  312. # spotify &
  313. # atom &
  314.  
Advertisement
Add Comment
Please, Sign In to add comment