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.

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