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.

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