Advertisement
Guest User

i3 config

a guest
Nov 16th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.82 KB | None | 0 0
  1. #
  2. # My first i3 configuration
  3. #
  4. set $mod Mod4
  5.  
  6. font pango:monospace 12
  7. font pango:DejaVu Sans Mono 10
  8.  
  9. default_border pixel 2
  10. hide_edge_borders smart
  11.  
  12.  
  13. # KEY BINDINGS ###############################################
  14. # Applications
  15. bindsym Ctrl+Mod1+b exec firefox
  16. bindsym Ctrl+Mod1+m exec thunar --class myThunar
  17. for_window [class="myThunar"] move scratchpad
  18. for_window [class="myThunar"] floating enable border pixel 4
  19. for_window [class="myThunar"] resize shrink width 10000px, resize grow width 400px, resize shrink height 10000px, resize grow height 400px
  20. for_window [class="myThunar"] scratchpad show
  21.  
  22. # Volume control @pulseAudio
  23. set $refresh_i3status killall -SIGUSR1 i3status
  24. bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status
  25. bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status
  26. bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
  27. bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
  28.  
  29. # Screen brightness
  30. bindsym XF86MonBrightnessUp exec xbacklight -inc 2 # increase screen brightness
  31. bindsym XF86MonBrightnessDown exec xbacklight -dec 2 # decrease screen brightness
  32.  
  33. # start a terminal
  34. bindsym $mod+Return exec urxvt
  35. bindsym $mod+Shift+Return exec urxvt -name floaty
  36. for_window [class="URxvt" instance="floaty"] move scratchpad
  37. for_window [class="URxvt" instance="floaty"] floating enable border pixel 2
  38. for_window [class="URxvt" instance="floaty"] resize shrink width 10000px, resize grow width 800px, resize shrink height 10000px, resize grow height 400px
  39. for_window [class="URxvt" instance="floaty"] move right 475px, move down 320px
  40.  
  41. # kill focused window
  42. bindsym $mod+Shift+q kill
  43.  
  44. # start dmenu (a program launcher)
  45. bindsym $mod+d exec dmenu_run
  46.  
  47. # change focus
  48. bindsym $mod+Left focus left
  49. bindsym $mod+Down focus down
  50. bindsym $mod+Up focus up
  51. bindsym $mod+Right focus right
  52.  
  53. # move window
  54. bindsym $mod+Shift+Left move left
  55. bindsym $mod+Shift+Down move down
  56. bindsym $mod+Shift+Up move up
  57. bindsym $mod+Shift+Right move right
  58.  
  59. # split in horizontal orientation
  60. bindsym $mod+h split h
  61.  
  62. # split in vertical orientation
  63. bindsym $mod+v split v
  64.  
  65. # enter fullscreen mode
  66. bindsym $mod+f fullscreen toggle
  67.  
  68. # change container layout (stacked, tabbed, toggle split)
  69. bindsym $mod+s layout stacking
  70. bindsym $mod+w layout tabbed
  71. bindsym $mod+e layout toggle
  72.  
  73. # toggle tiling / floating
  74. bindsym $mod+Shift+space floating toggle
  75.  
  76. # change focus between tiling / floating windows
  77. bindsym $mod+space focus mode_toggle
  78.  
  79. # focus the parent container
  80. bindsym $mod+a focus parent
  81.  
  82. # focus the child container
  83. #bindsym $mod+d focus child
  84.  
  85. # Move window to scratchpad
  86. bindsym $mod+b scratchpad show
  87. # bindsym $mod+Shift+b scratchpad show
  88.  
  89. # Define names for default workspaces for which we configure key bindings later on.
  90. # We use variables to avoid repeating the names in multiple places.
  91. set $ws1 "1"
  92. set $ws2 "2"
  93. set $ws3 "3"
  94. set $ws4 "4"
  95. set $ws5 "5"
  96. set $ws6 "6"
  97. set $ws7 "7"
  98. set $ws8 "8"
  99. set $ws9 "9"
  100. set $ws10 "10"
  101.  
  102. assign [class="Firefox"] -> $ws1
  103.  
  104.  
  105. # Scroll through workspaces
  106. bindsym $mod+grave workspace next
  107. bindsym $mod+shift+grave workspace prev
  108.  
  109. # switch to workspace
  110. bindsym $mod+1 workspace number $ws1
  111. bindsym $mod+2 workspace number $ws2
  112. bindsym $mod+3 workspace number $ws3
  113. bindsym $mod+4 workspace number $ws4
  114. bindsym $mod+5 workspace number $ws5
  115. bindsym $mod+6 workspace number $ws6
  116. bindsym $mod+7 workspace number $ws7
  117. bindsym $mod+8 workspace number $ws8
  118. bindsym $mod+9 workspace number $ws9
  119. bindsym $mod+0 workspace number $ws10
  120.  
  121. # move focused container to workspace
  122. bindsym $mod+Shift+1 move container to workspace number $ws1
  123. bindsym $mod+Shift+2 move container to workspace number $ws2
  124. bindsym $mod+Shift+3 move container to workspace number $ws3
  125. bindsym $mod+Shift+4 move container to workspace number $ws4
  126. bindsym $mod+Shift+5 move container to workspace number $ws5
  127. bindsym $mod+Shift+6 move container to workspace number $ws6
  128. bindsym $mod+Shift+7 move container to workspace number $ws7
  129. bindsym $mod+Shift+8 move container to workspace number $ws8
  130. bindsym $mod+Shift+9 move container to workspace number $ws9
  131. bindsym $mod+Shift+0 move container to workspace number $ws10
  132.  
  133. # reload the configuration file
  134. bindsym $mod+Shift+c reload
  135.  
  136. # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
  137. bindsym $mod+Shift+r restart
  138.  
  139. # exit i3 (logs you out of your X session)
  140. bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
  141.  
  142. # poweroff (Mod1 - includes Alt_L)
  143. bindsym Ctrl+Mod1+Shift+p exec poweroff
  144. bindsym Ctrl+Mod1+Shift+r exec reboot
  145.  
  146.  
  147. # resize window
  148. mode "resize" {
  149. bindsym Left resize shrink width 10 px or 10 ppt
  150. bindsym Down resize grow height 10 px or 10 ppt
  151. bindsym Up resize shrink height 10 px or 10 ppt
  152. bindsym Right resize grow width 10 px or 10 ppt
  153.  
  154. # back to normal: Enter or Escape or $mod+r
  155. bindsym Return mode "default"
  156. bindsym Escape mode "default"
  157. bindsym $mod+r mode "default"
  158. }
  159. bindsym $mod+r mode "resize"
  160.  
  161. mode "move" {
  162. bindsym Left move left 20px
  163. bindsym Right move right 20px
  164. bindsym Up move up 20px
  165. bindsym Down move down 20px
  166.  
  167. bindsym Return mode "default"
  168. bindsym Escape mode "default"
  169. bindsym $mod+m mode "default"
  170. }
  171. bindsym $mod+m mode "move"
  172.  
  173. # This + click & drag window in floating mode moves it around
  174. floating_modifier $mod
  175.  
  176.  
  177. # DYNAMIC GAPS STUFF
  178. set $mode_gaps Gaps: (o)uter, (i)nner, (h)orizontal, (v)ertical, (t)op, (r)ight, (b)ottom, (l)eft
  179. set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
  180. set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
  181. set $mode_gaps_horiz Horizontal Gaps: +|-|0 (local), Shift + +|-|0 (global)
  182. set $mode_gaps_verti Vertical Gaps: +|-|0 (local), Shift + +|-|0 (global)
  183. set $mode_gaps_top Top Gaps: +|-|0 (local), Shift + +|-|0 (global)
  184. set $mode_gaps_right Right Gaps: +|-|0 (local), Shift + +|-|0 (global)
  185. set $mode_gaps_bottom Bottom Gaps: +|-|0 (local), Shift + +|-|0 (global)
  186. set $mode_gaps_left Left Gaps: +|-|0 (local), Shift + +|-|0 (global)
  187. bindsym $mod+Shift+g mode "$mode_gaps"
  188.  
  189. mode "$mode_gaps" {
  190. bindsym o mode "$mode_gaps_outer"
  191. bindsym i mode "$mode_gaps_inner"
  192. bindsym h mode "$mode_gaps_horiz"
  193. bindsym v mode "$mode_gaps_verti"
  194. bindsym t mode "$mode_gaps_top"
  195. bindsym r mode "$mode_gaps_right"
  196. bindsym b mode "$mode_gaps_bottom"
  197. bindsym l mode "$mode_gaps_left"
  198. bindsym Return mode "$mode_gaps"
  199. bindsym Escape mode "default"
  200. }
  201.  
  202. mode "$mode_gaps_outer" {
  203. bindsym plus gaps outer current plus 5
  204. bindsym minus gaps outer current minus 5
  205. bindsym 0 gaps outer current set 0
  206.  
  207. bindsym Shift+plus gaps outer all plus 5
  208. bindsym Shift+minus gaps outer all minus 5
  209. bindsym Shift+0 gaps outer all set 0
  210.  
  211. bindsym Return mode "$mode_gaps"
  212. bindsym Escape mode "default"
  213. }
  214. mode "$mode_gaps_inner" {
  215. bindsym plus gaps inner current plus 5
  216. bindsym minus gaps inner current minus 5
  217. bindsym 0 gaps inner current set 0
  218.  
  219. bindsym Shift+plus gaps inner all plus 5
  220. bindsym Shift+minus gaps inner all minus 5
  221. bindsym Shift+0 gaps inner all set 0
  222.  
  223. bindsym Return mode "$mode_gaps"
  224. bindsym Escape mode "default"
  225. }
  226. mode "$mode_gaps_horiz" {
  227. bindsym plus gaps horizontal current plus 5
  228. bindsym minus gaps horizontal current minus 5
  229. bindsym 0 gaps horizontal current set 0
  230.  
  231. bindsym Shift+plus gaps horizontal all plus 5
  232. bindsym Shift+minus gaps horizontal all minus 5
  233. bindsym Shift+0 gaps horizontal all set 0
  234.  
  235. bindsym Return mode "$mode_gaps"
  236. bindsym Escape mode "default"
  237. }
  238. mode "$mode_gaps_verti" {
  239. bindsym plus gaps vertical current plus 5
  240. bindsym minus gaps vertical current minus 5
  241. bindsym 0 gaps vertical current set 0
  242.  
  243. bindsym Shift+plus gaps vertical all plus 5
  244. bindsym Shift+minus gaps vertical all minus 5
  245. bindsym Shift+0 gaps vertical all set 0
  246.  
  247. bindsym Return mode "$mode_gaps"
  248. bindsym Escape mode "default"
  249. }
  250. mode "$mode_gaps_top" {
  251. bindsym plus gaps top current plus 5
  252. bindsym minus gaps top current minus 5
  253. bindsym 0 gaps top current set 0
  254.  
  255. bindsym Shift+plus gaps top all plus 5
  256. bindsym Shift+minus gaps top all minus 5
  257. bindsym Shift+0 gaps top all set 0
  258.  
  259. bindsym Return mode "$mode_gaps"
  260. bindsym Escape mode "default"
  261. }
  262. mode "$mode_gaps_right" {
  263. bindsym plus gaps right current plus 5
  264. bindsym minus gaps right current minus 5
  265. bindsym 0 gaps right current set 0
  266.  
  267. bindsym Shift+plus gaps right all plus 5
  268. bindsym Shift+minus gaps right all minus 5
  269. bindsym Shift+0 gaps right all set 0
  270.  
  271. bindsym Return mode "$mode_gaps"
  272. bindsym Escape mode "default"
  273. }
  274. mode "$mode_gaps_bottom" {
  275. bindsym plus gaps bottom current plus 5
  276. bindsym minus gaps bottom current minus 5
  277. bindsym 0 gaps bottom current set 0
  278.  
  279. bindsym Shift+plus gaps bottom all plus 5
  280. bindsym Shift+minus gaps bottom all minus 5
  281. bindsym Shift+0 gaps bottom all set 0
  282.  
  283. bindsym Return mode "$mode_gaps"
  284. bindsym Escape mode "default"
  285. }
  286. mode "$mode_gaps_left" {
  287. bindsym plus gaps left current plus 5
  288. bindsym minus gaps left current minus 5
  289. bindsym 0 gaps left current set 0
  290.  
  291. bindsym Shift+plus gaps left all plus 5
  292. bindsym Shift+minus gaps left all minus 5
  293. bindsym Shift+0 gaps left all set 0
  294.  
  295. bindsym Return mode "$mode_gaps"
  296. bindsym Escape mode "default"
  297. }
  298.  
  299. # Launch polybar
  300. exec_always --no-startup-id $HOME/.config/polybar/launch.sh
  301.  
  302. # Set desktop wallpaper
  303. exec_always --no-startup-id exec bash $HOME/.fehbg
  304.  
  305. # Run the window splitting script
  306. exec_always --no-startup-id $HOME/.config/i3/splitConfig.py
  307.  
  308.  
  309.  
  310. # BACKUPS
  311. # SOMETHING ABOUT XSS-LOCK -> todo check what this is
  312. # exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
  313.  
  314. # NetworkManager is the most popular way to manage wireless networks on Linux,
  315. # and nm-applet is a desktop environment-independent system tray GUI for it.
  316. # exec --no-startup-id nm-applet
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement