You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

375 lines
12KB

  1. {{ ansible_managed | comment }}
  2. # i3 config file (v4)
  3. #
  4. # Please see http://i3wm.org/docs/userguide.html for a complete reference!
  5. {% set workspace_switcher = "exec --no-startup-id i3-workspace-switcher" %}
  6. {% set on_focus_workspace = "exec --no-startup-id on-focus-workspace" %}
  7. ### Font
  8. font {{i3_font}}
  9. ### Modifier Key
  10. set $mod Mod4
  11. set $plexmod Mod3
  12. # Use Mouse+$mod to drag floating windows to their wanted position
  13. floating_modifier $mod
  14. ### default/local mode
  15. ## special keys
  16. bindsym XF86Sleep exec {{i3_exec_command_prefix}} {{lockscreen_lock_command}}
  17. bindsym XF86Mail exec {{i3_exec_command_prefix}} {{mail_command}}
  18. bindsym XF86HomePage exec {{i3_exec_command_prefix}} {{default_browser}}
  19. bindsym XF86Calculator exec {{i3_exec_command_prefix}} {{calculator_command}}
  20. ## Special modes
  21. bindsym $mod+t mode timer
  22. bindsym $mod+s mode session
  23. bindsym $mod+c mode clipboard
  24. bindcode $mod+49 mode "session"
  25. bindcode $mod+9 exec --no-startup-id ~/.xsession.reload.fish
  26. ## Todo
  27. bindsym $mod+x exec {{i3_exec_command_prefix}} todo finished
  28. ## Applications
  29. bindsym $mod+Return exec {{i3_exec_command_prefix}} "{{default_terminal}}"
  30. bindsym $mod+b exec {{i3_exec_command_prefix}} "{{default_browser}}"
  31. bindsym $mod+d exec {{i3_exec_command_prefix}} rofi -show drun -show-icons
  32. bindsym $mod+e exec {{i3_exec_command_prefix}} rofi -show run
  33. bindsym $mod+a mode "apps"
  34. bindsym $mod+space exec {{i3_exec_command_prefix}} "on-space-shortcut"
  35. ## Workspaces
  36. bindsym $mod+w {{workspace_switcher}}
  37. {% for ws in i3_number_keymaps %}
  38. bindsym $mod+{{ws.keysym}} workspace "{{ws.id}}"
  39. {% endfor %}
  40. # focus workspace
  41. bindsym $mod+Prior workspace next
  42. bindsym $mod+Next workspace prev
  43. bindsym $mod+ssharp scratchpad show
  44. bindsym $mod+g sticky toggle
  45. ## Layout
  46. bindsym $mod+l mode "layout"
  47. bindsym $mod+h split h
  48. bindsym $mod+v split v
  49. ## Focus
  50. bindsym $mod+Left focus left
  51. bindsym $mod+Down focus down
  52. bindsym $mod+Up focus up
  53. bindsym $mod+Right focus right
  54. bindsym $mod+p focus parent
  55. # change focus between tiling / floating windows
  56. bindsym $mod+Tab focus mode_toggle
  57. ## Move
  58. # move window
  59. bindsym $mod+Control+w exec fish -c "i3-msg move container to workspace (i3-msg -t get_workspaces | jq --raw-output '.[]|select(.num == -1).name' | rofi -dmenu -p 'move to workspace' )"; mode "default"
  60. bindsym $mod+Control+Left move left
  61. bindsym $mod+Control+Down move down
  62. bindsym $mod+Control+Up move up
  63. bindsym $mod+Control+Right move right
  64. bindsym $mod+Control+Tab floating toggle
  65. {% for ws in i3_number_keymaps %}
  66. bindsym $mod+Control+{{ws.keysym}} move container to workspace "{{ws.id}}"; mode "default"
  67. {% endfor %}
  68. # move workspace
  69. bindsym $mod+Shift+Left move workspace to output left
  70. bindsym $mod+Shift+Down move workspace to output down
  71. bindsym $mod+Shift+Up move workspace to output up
  72. bindsym $mod+Shift+Right move workspace to output right
  73. bindsym $mod+Shift+O exec fish -c "i3-msg move workspace to output ( i3-msg -t get_outputs | jq --raw-output '.[]|select(.active == true).name' | rofi -dmenu -p 'move workspace to output' )"; mode "default"
  74. bindsym $mod+Shift+P move workspace to output primary; mode "default"
  75. ## Window
  76. # The middle button over a titlebar kills the window
  77. bindsym --release button2 kill
  78. # The middle button and a modifer over any part of the window kills the window
  79. bindsym --whole-window $mod+button2 kill
  80. bindsym $mod+BackSpace kill
  81. bindsym $mod+q kill
  82. bindsym $mod+f fullscreen
  83. bindsym $mod+r mode resize
  84. # free keys
  85. # $mod+i
  86. # $mod+j
  87. # $mod+k
  88. # $mod+n
  89. # $mod+m
  90. # $mod+o
  91. # $mod+u
  92. # $mod+adiaeresis
  93. # $mod+odiaeresis
  94. # $mod+udiaeresis
  95. # $mod+comma
  96. # $mod+period
  97. # $mod+numbersign
  98. # $mod+Home
  99. # $mod+End
  100. # $mod+Pause
  101. # $mod+Delete
  102. # $mod+Insert
  103. # $mod+Print
  104. # $mod+Scroll_Lock
  105. # $mod+minus
  106. # $mod+plus
  107. # $mod+less
  108. ## stuff that is available in default and remote mode
  109. {% macro overall() %}
  110. bindsym $plexmod+space exec {{i3_exec_command_prefix}} on-space-shortcut
  111. bindsym $plexmod+BackSpace kill
  112. bindsym $plexmod+Tab {{workspace_switcher}}
  113. {% for ws in i3_number_keymaps %}
  114. bindsym $plexmod+{{ws.keysym}} workspace "{{ws.id}}"
  115. {% endfor %}
  116. {% for ws in i3_letter_keymaps %}
  117. bindsym $plexmod+{{ws.keysym}} workspace "{{ws.id}}"
  118. {% endfor %}
  119. # focus workspace
  120. bindsym $plexmod+Prior workspace next
  121. bindsym $plexmod+Next workspace prev
  122. # focus output
  123. bindsym $plexmod+Shift+p focus output primary
  124. bindsym $plexmod+Shift+o exec fish -c "i3-msg focus output ( i3-msg -t get_outputs | jq --raw-output '.[]|select(.active == true).name' | rofi -dmenu -p 'focus output' )"
  125. bindsym $plexmod+Left focus output left
  126. bindsym $plexmod+Down focus output down
  127. bindsym $plexmod+Up focus output up
  128. bindsym $plexmod+Right focus output right
  129. # Special modes
  130. bindcode $plexmod+49 mode "session"
  131. {% endmacro %}
  132. {{ overall() }}
  133. ### remote mode
  134. mode "remote" {
  135. bindcode $mod+9 mode "default"
  136. bindsym XF86Sleep exec {{lockscreen_lock_command}}
  137. # The middle button over a titlebar kills the window
  138. bindsym --release button2 kill
  139. {{ overall() }}
  140. }
  141. ### Applications mode
  142. mode "apps" {
  143. {% for a in application_shortcuts | dict2items %}
  144. bindsym {{a.key}} exec {{i3_exec_command_prefix}} {{a.value}}; mode "default"
  145. {% endfor %}
  146. bindsym Escape mode "default"
  147. }
  148. ### Session
  149. mode "session" {
  150. bindsym q exit
  151. bindsym r reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}}
  152. bindsym R reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}}
  153. bindsym s exec --no-startup-id {{system_suspend_command}}; mode "default"; {{on_focus_workspace}}
  154. bindsym l exec --no-startup-id {{lockscreen_lock_command}}; mode "default"; {{on_focus_workspace}}
  155. bindcode 49 exec --no-startup-id {{lockscreen_lock_command}}; mode "default"; {{on_focus_workspace}}
  156. bindsym b exec --no-startup-id xsetroot -solid black; mode "default"; {{on_focus_workspace}}
  157. bindsym e exec --no-startup-id xset s on; exec --no-startup-id xset dpms {{ display_sleeptime | int }} {{ display_sleeptime | int }} {{ display_sleeptime | int }}; mode "default"; {{on_focus_workspace}}
  158. bindsym d exec --no-startup-id xset s off; exec --no-startup-id xset dpms 0 0 0; mode "default"; {{on_focus_workspace}}
  159. bindsym Shift+R exec --no-startup-id {{system_reboot_command}}; mode "default"; {{on_focus_workspace}}
  160. bindsym Shift+P exec --no-startup-id {{system_poweroff_command}}; mode "default"; {{on_focus_workspace}}
  161. # back to normal: Escape
  162. bindsym Escape mode "default"; {{on_focus_workspace}}
  163. }
  164. ### Todo
  165. mode "todo" {
  166. bindsym a exec "{{i3_exec_command_prefix}} timer select_activity"; mode "default"; {{on_focus_workspace}}
  167. bindsym e exec "{{i3_exec_command_prefix}} timer end_activity"; mode "default"; {{on_focus_workspace}}
  168. bindsym w exec "{{i3_exec_command_prefix}} todo workspace"; mode "default"; {{on_focus_workspace}}
  169. # back to normal: Escape
  170. bindsym Escape mode "default"; {{on_focus_workspace}}
  171. }
  172. ### Clipboard
  173. mode "clipboard" {
  174. bindsym p exec "clipboard-pwgen clipboard"; mode "default"
  175. bindsym e exec "clipboard-edit clipboard"; mode "default"
  176. {% for clipboard in i3_number_keymaps %}
  177. bindsym {{clipboard.keysym}} exec "clipboard-from-file clipboard {{clipboard_directory}}/{{clipboard.id}}"; mode "default"
  178. bindsym Control+{{clipboard.keysym}} exec "clipboard-to-file clipboard {{clipboard_directory}}/{{clipboard.id}}"; mode "default"
  179. {% endfor %}
  180. # back to normal: Escape
  181. bindsym Escape mode "default"
  182. }
  183. ### Layout
  184. # set default layout to tabbed
  185. workspace_layout tabbed
  186. mode "layout" {
  187. bindsym s layout stacking; mode "default";
  188. bindsym t layout tabbed; mode "default";
  189. bindsym e layout toggle split; mode "default";
  190. bindsym h layout splith; mode "default"
  191. bindsym v layout splitv; mode "default"
  192. bindsym m exec --no-startup-id select-screenlayout; {{on_focus_workspace}}
  193. bindsym r mode remote
  194. bindsym b mode bar
  195. # back to normal: Escape
  196. bindsym Escape mode "default"
  197. }
  198. mode "bar" { bindsym h bar mode hide; mode "default"
  199. bindsym d bar mode dock; mode "default"
  200. # back to normal: Escape
  201. bindsym Escape mode "default"
  202. }
  203. ### Resize window mode
  204. # resize window (you can also use the mouse for that)
  205. mode "resize" {
  206. # These bindings trigger as soon as you enter the resize mode
  207. # Pressing left will shrink the window’s width.
  208. bindsym Left resize shrink width 10 px or 10 ppt
  209. bindsym $left resize shrink width 10 px or 10 ppt
  210. # Pressing down will grow the window’s height.
  211. bindsym Down resize grow height 10 px or 10 ppt
  212. bindsym $down resize grow height 10 px or 10 ppt
  213. # Pressing up will shrink the window’s height.
  214. bindsym Up resize shrink height 10 px or 10 ppt
  215. bindsym $up resize shrink height 10 px or 10 ppt
  216. # Pressing right will grow the window’s width.
  217. bindsym Right resize grow width 10 px or 10 ppt
  218. bindsym $right resize grow width 10 px or 10 ppt
  219. bindsym 1 resize set 10 ppt 10 ppt; mode "default"
  220. bindsym 2 resize set 20 ppt 20 ppt; mode "default"
  221. bindsym 3 resize set 30 ppt 30 ppt; mode "default"
  222. bindsym 4 resize set 40 ppt 40 ppt; mode "default"
  223. bindsym 5 resize set 50 ppt 50 ppt; mode "default"
  224. bindsym 6 resize set 60 ppt 60 ppt; mode "default"
  225. bindsym 7 resize set 70 ppt 70 ppt; mode "default"
  226. bindsym 8 resize set 80 ppt 80 ppt; mode "default"
  227. bindsym 9 resize set 90 ppt 90 ppt; mode "default"
  228. bindsym 0 resize set 100 ppt 100 ppt; mode "default"
  229. bindsym v resize set 640 480; mode "default"
  230. bindsym y resize set 870 628; mode "default"
  231. # back to normal: Escape
  232. bindsym Escape mode "default"
  233. }
  234. ### Bar
  235. bar {
  236. {% if i3_hide_bar %}
  237. mode invisible
  238. hidden_state hide
  239. {% endif %}
  240. position top
  241. strip_workspace_numbers no
  242. tray_output primary
  243. status_command i3blocks
  244. colors {
  245. background #000000
  246. statusline #ffffff
  247. separator #666666
  248. # <colorclass> <border> <background> <text>
  249. focused_workspace {{home_base_color_hue|hsv2rgb(50,60)}} {{home_base_color_hue|hsv2rgb(66,47)}} #ffffff
  250. active_workspace #333333 #696969 #ffffff
  251. inactive_workspace #333333 #222222 #888888
  252. urgent_workspace #2f343a #900000 #ffffff
  253. binding_mode #2f343a #900000 #ffffff
  254. }
  255. }
  256. ### Design
  257. # class border backgr. text indicator child_border
  258. client.focused {{home_base_color_hue|hsv2rgb(50,60)}} {{home_base_color_hue|hsv2rgb(66,47)}} #ffffff {{home_base_color_hue|hsv2rgb(81,91)}} {{home_base_color_hue|hsv2rgb(66,47)}}
  259. client.focused_inactive #333333 #6A6A6A #ffffff #505050 #6A6A6A
  260. client.unfocused #333333 #222222 #888888 #2E2E2E #222222
  261. client.urgent #2f343a #900000 #ffffff #900000 #900000
  262. client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
  263. client.background #ffffff
  264. {% if not i3_hide_border_one_window %}
  265. default_border normal
  266. hide_edge_borders both
  267. {% else %}
  268. default_border none
  269. hide_edge_borders smart
  270. {% endif %}
  271. default_floating_border normal
  272. ### general settings
  273. focus_on_window_activation urgent
  274. ### Application specific rule
  275. for_window [class="^(?:Tiger)?V[Nn][Cc] ?[Vv]iewer$"] border none
  276. for_window [window_role="^About$"] floating enable
  277. for_window [class="^Pavu"] floating enable
  278. for_window [class="^Paman$"] floating enable
  279. for_window [class="^Blueman"] floating enable
  280. for_window [class="^URxvt$" title="^tmux-workspace$"] border none
  281. for_window [class="^zoom$" title="^zoom$"] floating enable
  282. ### assign apps to workspaces
  283. assign [class="^netzdrive$"] → netzdrive
  284. assign [class="^TelegramDesktop$"] → tg
  285. assign [class="^Signal$"] → signal
  286. assign [class="^Element$"] → matrix
  287. assign [class="^thunderbird$"] → mail
  288. assign [class="^zoom$" ] → zoom
  289. assign [class="^Wfica_"] → citrix
  290. assign [title="^Citrix maximized probe window$"] → citrix
  291. # vncviewer workspaces
  292. {% for workspace in workspaces|dict2items|json_query("[?value.type=='vncviewer'].key") %}
  293. {% set ws = workspaces[workspace] %}
  294. assign [class="^(?:Tiger)?V[Nn][Cc] ?[Vv]iewer$" title="^{{ws.host}}:{{ws.display|default(home_vncserver_display_number)}}"] → {{workspace}}
  295. {% endfor %}