KhaledEmaraDev

i3 config

Jan 26th, 2021
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.46 KB | None | 0 0
  1. # This file has been auto-generated by i3-config-wizard(1).
  2. # It will not be overwritten, so edit it as you like.
  3. #
  4. # Should you change your keyboard layout some time, delete
  5. # this file and re-run i3-config-wizard(1).
  6. #
  7.  
  8. # i3 config file (v4)
  9. #
  10. # Please see https://i3wm.org/docs/userguide.html for a complete reference!
  11. #
  12. # This config file uses keycodes (bindsym) and was written for the QWERTY
  13. # layout.
  14. #
  15. # To get a config file with the same key positions, but for your current
  16. # layout, use the i3-config-wizard
  17. #
  18.  
  19. # Autostart
  20. # exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
  21. exec --no-startup-id picom -b --no-fading-openclose
  22. exec_always --no-startup-id ~/.config/polybar/scripts/pywal.sh ~/Pictures/wallpapers/
  23. exec_always --no-startup-id ~/.config/polybar/launch.sh
  24. # exec_always --no-startup-id polybar-msg cmd hide
  25. exec --no-startup-id dunst
  26.  
  27. # Change Colors
  28. # Set colors from Xresources
  29. # Change 'color7' and 'color2' to whatever colors you want i3 to use
  30. # from the generated scheme.
  31. # NOTE: The '#f0f0f0' in the lines below is the color i3 will use if
  32. # it fails to get colors from Xresources.
  33. set_from_resource $fg i3wm.color7 #f0f0f0
  34. set_from_resource $bg i3wm.color3 #f0f0f0
  35. set_from_resource $bf i3wm.color5 #f0f0f0
  36.  
  37. # class border backgr. text indicator child_border
  38. client.focused $bg $bf $fg $bg $bg
  39. client.focused_inactive $bg $bg $fg $bg $bg
  40. client.unfocused $bg $bg $fg $bg $bg
  41. client.urgent $bg $bg $fg $bg $bg
  42. client.placeholder $bg $bg $fg $bg $bg
  43.  
  44. client.background $bg
  45.  
  46. # Main Configurations
  47. set $mod Mod4
  48. set $submod Mod1
  49.  
  50. # Font for window titles. Will also be used by the bar unless a different font
  51. # is used in the bar {} block below.
  52. font pango:Fira Code 8
  53.  
  54. # This font is widely installed, provides lots of unicode glyphs, right-to-left
  55. # text rendering and scalability on retina/hidpi displays (thanks to pango).
  56. #font pango:DejaVu Sans Mono 8
  57.  
  58. # The combination of xss-lock, nm-applet and pactl is a popular choice, so
  59. # they are included here as an example. Modify as you see fit.
  60.  
  61. # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
  62. # screen before suspend. Use loginctl lock-session to lock your screen.
  63. exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
  64.  
  65. # NetworkManager is the most popular way to manage wireless networks on Linux,
  66. # and nm-applet is a desktop environment-independent system tray GUI for it.
  67. # exec --no-startup-id nm-applet
  68.  
  69. # Use pactl to adjust volume in PulseAudio.
  70. set $refresh_i3status killall -SIGUSR1 i3status
  71. bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
  72. bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
  73. bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
  74. bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
  75. bindsym $mod+Shift+equal exec --no-startup-id change-volume 2dB+ unmute
  76. bindsym $mod+Shift+minus exec --no-startup-id change-volume 2dB- unmute
  77.  
  78. # use these keys for focus, movement, and resize directions when reaching for
  79. # the arrows is not convenient
  80. set $up l
  81. set $down k
  82. set $left j
  83. set $right semicolon
  84.  
  85. # Use Mouse+$mod to drag floating windows to their wanted position
  86. floating_modifier $mod
  87.  
  88. # start a terminal
  89. bindsym $mod+Return exec i3-sensible-terminal
  90.  
  91. # kill focused window
  92. bindsym $submod+w kill
  93.  
  94. # start dmenu (a program launcher)
  95. # bindsym $mod+d exec --no-startup-id dmenu_run
  96. # A more modern dmenu replacement is rofi:
  97. # bindsym $mod+d exec rofi -show drun
  98. # There also is i3-dmenu-desktop which only displays applications shipping a
  99. # .desktop file. It is a wrapper around dmenu, so you need that installed.
  100. # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
  101. bindsym $mod+d exec --no-startup-id ~/.config/polybar/scripts/launcher.sh
  102.  
  103. # change focus
  104. bindsym $mod+$left focus left
  105. bindsym $mod+$down focus down
  106. bindsym $mod+$up focus up
  107. bindsym $mod+$right focus right
  108.  
  109. # alternatively, you can use the cursor keys:
  110. bindsym $mod+Left focus left
  111. bindsym $mod+Down focus down
  112. bindsym $mod+Up focus up
  113. bindsym $mod+Right focus right
  114.  
  115. # alternatively, you can use the toggle keys:
  116. bindsym $submod+Shift+Tab focus prev
  117. bindsym $submod+Tab focus next
  118.  
  119. # move focused window
  120. bindsym $mod+Shift+$left move left
  121. bindsym $mod+Shift+$down move down
  122. bindsym $mod+Shift+$up move up
  123. bindsym $mod+Shift+$right move right
  124.  
  125. # alternatively, you can use the cursor keys:
  126. bindsym $mod+Shift+Left move left
  127. bindsym $mod+Shift+Down move down
  128. bindsym $mod+Shift+Up move up
  129. bindsym $mod+Shift+Right move right
  130.  
  131. # split in horizontal orientation
  132. bindsym $mod+h split h
  133.  
  134. # split in vertical orientation
  135. bindsym $mod+v split v
  136.  
  137. # enter fullscreen mode for the focused container
  138. bindsym $mod+f fullscreen toggle
  139.  
  140. # change container layout (stacked, tabbed, toggle split)
  141. bindsym $mod+s layout stacking
  142. bindsym $mod+t layout tabbed
  143. bindsym $mod+x layout toggle split
  144.  
  145. # toggle tiling / floating
  146. bindsym $mod+Shift+f floating toggle
  147.  
  148. # change focus between tiling / floating windows
  149. bindsym $mod+b focus mode_toggle
  150.  
  151. # focus the parent container
  152. bindsym $mod+a focus parent
  153.  
  154. # focus the child container
  155. bindsym $mod+c focus child
  156.  
  157. # move the currently focused window to the scratchpad
  158. bindsym $mod+Shift+s move scratchpad
  159.  
  160. # Show the next scratchpad window or hide the focused scratchpad window.
  161. # If there are multiple scratchpad windows, this command cycles through them.
  162. bindsym $mod+minus scratchpad show
  163.  
  164. # Define names for default workspaces for which we configure key bindings later on.
  165. # We use variables to avoid repeating the names in multiple places.
  166. set $ws1 "1"
  167. set $ws2 "2"
  168. set $ws3 "3"
  169. set $ws4 "4"
  170. set $ws5 "5"
  171. set $ws6 "6"
  172. set $ws7 "7"
  173. set $ws8 "8"
  174. set $ws9 "9"
  175. set $ws10 "10"
  176.  
  177. # switch to workspace
  178. bindsym $mod+1 workspace number $ws1
  179. bindsym $mod+2 workspace number $ws2
  180. bindsym $mod+3 workspace number $ws3
  181. bindsym $mod+4 workspace number $ws4
  182. bindsym $mod+5 workspace number $ws5
  183. bindsym $mod+6 workspace number $ws6
  184. bindsym $mod+7 workspace number $ws7
  185. bindsym $mod+8 workspace number $ws8
  186. bindsym $mod+9 workspace number $ws9
  187. bindsym $mod+0 workspace number $ws10
  188.  
  189. # alternatively, you can use the toggle keys:
  190. bindsym $mod+Shift+Tab workspace prev
  191. bindsym $mod+Tab workspace next
  192.  
  193. # move focused container to workspace
  194. bindsym $mod+Shift+1 move container to workspace number $ws1; workspace $ws1
  195. bindsym $mod+Shift+2 move container to workspace number $ws2; workspace $ws2
  196. bindsym $mod+Shift+3 move container to workspace number $ws3; workspace $ws3
  197. bindsym $mod+Shift+4 move container to workspace number $ws4; workspace $ws4
  198. bindsym $mod+Shift+5 move container to workspace number $ws5; workspace $ws5
  199. bindsym $mod+Shift+6 move container to workspace number $ws6; workspace $ws6
  200. bindsym $mod+Shift+7 move container to workspace number $ws7; workspace $ws7
  201. bindsym $mod+Shift+8 move container to workspace number $ws8; workspace $ws8
  202. bindsym $mod+Shift+9 move container to workspace number $ws9; workspace $ws9
  203. bindsym $mod+Shift+0 move container to workspace number $ws10; workspace $ws10
  204.  
  205. # reload the configuration file
  206. bindsym $mod+Shift+c reload
  207. # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
  208. bindsym $mod+Shift+r restart
  209. # exit i3 (logs you out of your X session)
  210. bindsym $mod+Shift+e exec i3-msg exit
  211.  
  212. # resize window (you can also use the mouse for that)
  213. mode "resize" {
  214. # These bindings trigger as soon as you enter the resize mode
  215.  
  216. # Pressing left will shrink the window’s width.
  217. # Pressing right will grow the window’s width.
  218. # Pressing up will shrink the window’s height.
  219. # Pressing down will grow the window’s height.
  220. bindsym j resize shrink width 10 px or 10 ppt
  221. bindsym k resize grow height 10 px or 10 ppt
  222. bindsym l resize shrink height 10 px or 10 ppt
  223. bindsym semicolon resize grow width 10 px or 10 ppt
  224.  
  225. # same bindings, but for the arrow keys
  226. bindsym Left resize shrink width 10 px or 10 ppt
  227. bindsym Down resize grow height 10 px or 10 ppt
  228. bindsym Up resize shrink height 10 px or 10 ppt
  229. bindsym Right resize grow width 10 px or 10 ppt
  230.  
  231. # back to normal: Enter or Escape or $mod+r
  232. bindsym Return mode "default"
  233. bindsym Escape mode "default"
  234. bindsym $mod+r mode "default"
  235. }
  236.  
  237. bindsym $mod+r mode "resize"
  238.  
  239. # bindsym Super_L exec --no-startup-id polybar-msg cmd show
  240. bindsym --release Super_L exec --no-startup-id polybar-msg cmd toggle
  241.  
  242. # Start i3bar to display a workspace bar (plus the system information i3status
  243. # finds out, if available)
  244. # bar {
  245. # status_command ~/.config/i3status/contrib/net-speed.sh
  246. #
  247. # mode hide
  248. # modifier $mod
  249. # }
  250.  
  251. # User Configurations
  252. floating_maximum_size 1360 x 768
  253.  
  254. workspace_layout tabbed
  255.  
  256. default_border none
  257. default_floating_border none
  258.  
  259. # hide_edge_borders smart
  260.  
  261. force_display_urgency_hint 500 ms
  262.  
  263. set $Locker i3lock -n -i ~/Pictures/world.png && sleep 1
  264.  
  265. set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
  266. mode "$mode_system" {
  267. bindsym l exec --no-startup-id $Locker, mode "default"
  268. bindsym e exec --no-startup-id i3-msg exit, mode "default"
  269. bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"
  270. bindsym h exec --no-startup-id $Locker && systemctl hibernate, mode "default"
  271. bindsym r exec --no-startup-id systemctl reboot, mode "default"
  272. bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
  273.  
  274. # back to normal: Enter or Escape
  275. bindsym Return mode "default"
  276. bindsym Escape mode "default"
  277. }
  278.  
  279. bindsym $mod+Pause mode "$mode_system"
  280.  
  281. for_window [window_role="pop-up"] floating enable
  282. for_window [window_role="task_dialog"] floating enable
  283.  
  284. # i3-gaps Configurations
  285. # for_window [class=".*"] border pixel 0
  286.  
  287. gaps inner 8
  288. # gaps outer -2
  289.  
  290. bindsym $mod+g gaps inner current toggle 8
  291.  
  292. set $mode_gaps Gaps: (o) outer, (i) inner
  293. set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
  294. set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
  295. bindsym $mod+Shift+g mode "$mode_gaps"
  296.  
  297. mode "$mode_gaps" {
  298. bindsym o mode "$mode_gaps_outer"
  299. bindsym i mode "$mode_gaps_inner"
  300. bindsym Return mode "default"
  301. bindsym Escape mode "default"
  302. }
  303. mode "$mode_gaps_inner" {
  304. bindsym plus gaps inner current plus 4
  305. bindsym minus gaps inner current minus 4
  306. bindsym 0 gaps inner current set 0
  307.  
  308. bindsym Shift+plus gaps inner all plus 4
  309. bindsym Shift+minus gaps inner all minus 4
  310. bindsym Shift+0 gaps inner all set 0
  311.  
  312. bindsym Return mode "default"
  313. bindsym Escape mode "default"
  314. }
  315. mode "$mode_gaps_outer" {
  316. bindsym plus gaps outer current plus 4
  317. bindsym minus gaps outer current minus 4
  318. bindsym 0 gaps outer current set 0
  319.  
  320. bindsym Shift+plus gaps outer all plus 4
  321. bindsym Shift+minus gaps outer all minus 4
  322. bindsym Shift+0 gaps outer all set 0
  323.  
  324. bindsym Return mode "default"
  325. bindsym Escape mode "default"
  326. }
  327.  
  328. # only enable gaps on a workspace when there is at least one container
  329. # smart_gaps on
  330. # only enable outer gaps when there is exactly one container
  331. # smart_gaps inverse_outer
  332.  
  333. # User Key Bindings
  334. bindsym $mod+F1 exec chromium
  335. bindsym $mod+F2 exec code
  336. bindsym $mod+q exec chromium --incognito
  337.  
  338. bindsym $mod+e exec VISUAL=code EDITOR=nano st -e nnn
  339. bindsym $mod+p exec --no-startup-id sh multi-monitor.sh
  340. bindsym $mod+w exec --no-startup-id sh asoundrc.sh
  341.  
  342. bindsym --release Pause exec --no-startup-id pkill -SIGINT -f '^ffmpeg -f x11grab' || ffmpeg -f x11grab -i :0.0 -vf 'crop=floor(iw/2)*2:floor(ih/2)*2' -b:v 0 -crf 25 -vcodec libx264 -pix_fmt yuv420p ~/Videos/screencasts/$(date +%Y-%m-%d_%H:%M:%S).mp4
  343. bindsym --release Print exec --no-startup-id magick import -window root "$HOME/Pictures/screenshots/$(date +%Y-%m-%d_%H:%M:%S).png"
  344. bindsym --release Control+Shift+s exec --no-startup-id magick import "$HOME/Pictures/screenshots/$(date +%Y-%m-%d_%H:%M:%S).png"
  345.  
Advertisement
Add Comment
Please, Sign In to add comment