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.

413 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. bindsym x 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 activity"; mode "default"; {{on_focus_workspace}}
  176. bindsym e exec "~/bin/timer end"; mode "default"; {{on_focus_workspace}}
  177. bindsym r exec "~/bin/timer update"; mode "default"; {{on_focus_workspace}}
  178. bindsym u exec "~/bin/timer uniklinik"; mode "default"; {{on_focus_workspace}}
  179. # back to normal: Escape
  180. bindsym Escape mode "default"; {{on_focus_workspace}}
  181. }
  182. ### Clipboard
  183. mode "clipboard" {
  184. # back to normal: Escape
  185. bindsym Escape mode "default"
  186. }
  187. ### Layout
  188. # set default layout to tabbed
  189. workspace_layout tabbed
  190. mode "layout" {
  191. bindsym s layout stacking; mode "default";
  192. bindsym t layout tabbed; mode "default";
  193. bindsym e layout toggle split; mode "default";
  194. bindsym h layout splith; mode "default"
  195. bindsym v layout splitv; mode "default"
  196. bindsym b mode bar
  197. # back to normal: Escape
  198. bindsym Escape mode "default"
  199. }
  200. mode "bar" {
  201. bindsym h bar mode hide; mode "default"
  202. bindsym d bar mode dock; mode "default"
  203. # back to normal: Escape
  204. bindsym Escape mode "default"
  205. }
  206. ### Move mode
  207. mode "move" {
  208. # move window
  209. bindsym Left move left
  210. bindsym $left move left
  211. bindsym Down move down
  212. bindsym $down move down
  213. bindsym Up move up
  214. bindsym $up move up
  215. bindsym Right move right
  216. bindsym $right move right
  217. # move window to workspace
  218. {% for ws in i3_number_workspace_keymaps %}
  219. bindsym {{ws.keysym}} move container to workspace "{{ws.workspace}}"; mode "default"
  220. {% endfor %}
  221. 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"
  222. bindsym ssharp move scratchpad
  223. # move workspace to output
  224. bindsym Shift+Left move workspace to output left
  225. bindsym Shift+$left move workspace to output left
  226. bindsym Shift+Down move workspace to output down
  227. bindsym Shift+$down move workspace to output down
  228. bindsym Shift+Up move workspace to output up
  229. bindsym Shift+$up move workspace to output up
  230. bindsym Shift+Right move workspace to output right
  231. bindsym Shift+$right move workspace to output right
  232. 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"
  233. bindsym p move workspace to output primary; mode "default"
  234. # back to normal: Escape
  235. bindsym Escape mode "default"
  236. }
  237. ### Resize window mode
  238. # resize window (you can also use the mouse for that)
  239. mode "resize" {
  240. # These bindings trigger as soon as you enter the resize mode
  241. # Pressing left will shrink the window’s width.
  242. bindsym Left resize shrink width 10 px or 10 ppt
  243. bindsym $left resize shrink width 10 px or 10 ppt
  244. # Pressing down will grow the window’s height.
  245. bindsym Down resize grow height 10 px or 10 ppt
  246. bindsym $down resize grow height 10 px or 10 ppt
  247. # Pressing up will shrink the window’s height.
  248. bindsym Up resize shrink height 10 px or 10 ppt
  249. bindsym $up resize shrink height 10 px or 10 ppt
  250. # Pressing right will grow the window’s width.
  251. bindsym Right resize grow width 10 px or 10 ppt
  252. bindsym $right resize grow width 10 px or 10 ppt
  253. bindsym 1 resize set 10 ppt 10 ppt; mode "default"
  254. bindsym 2 resize set 20 ppt 20 ppt; mode "default"
  255. bindsym 3 resize set 30 ppt 30 ppt; mode "default"
  256. bindsym 4 resize set 40 ppt 40 ppt; mode "default"
  257. bindsym 5 resize set 50 ppt 50 ppt; mode "default"
  258. bindsym 6 resize set 60 ppt 60 ppt; mode "default"
  259. bindsym 7 resize set 70 ppt 70 ppt; mode "default"
  260. bindsym 8 resize set 80 ppt 80 ppt; mode "default"
  261. bindsym 9 resize set 90 ppt 90 ppt; mode "default"
  262. bindsym 0 resize set 100 ppt 100 ppt; mode "default"
  263. bindsym v resize set 640 480; mode "default"
  264. bindsym y resize set 870 628; mode "default"
  265. # back to normal: Escape
  266. bindsym Escape mode "default"
  267. }
  268. ### Bar
  269. bar {
  270. position top
  271. strip_workspace_numbers yes
  272. tray_output primary
  273. status_command i3blocks
  274. colors {
  275. background #000000
  276. statusline #ffffff
  277. separator #666666
  278. # <colorclass> <border> <background> <text>
  279. focused_workspace {{home_base_color_hue|hsv2rgb(50,60)}} {{home_base_color_hue|hsv2rgb(66,47)}} #ffffff
  280. active_workspace #333333 #696969 #ffffff
  281. inactive_workspace #333333 #222222 #888888
  282. urgent_workspace #2f343a #900000 #ffffff
  283. binding_mode #2f343a #900000 #ffffff
  284. }
  285. }
  286. ### Design
  287. # class border backgr. text indicator child_border
  288. 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)}}
  289. client.focused_inactive #333333 #6A6A6A #ffffff #505050 #6A6A6A
  290. client.unfocused #333333 #222222 #888888 #2E2E2E #222222
  291. client.urgent #2f343a #900000 #ffffff #900000 #900000
  292. client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
  293. client.background #ffffff
  294. default_border normal
  295. hide_edge_borders both
  296. default_floating_border normal
  297. ### general settings
  298. focus_on_window_activation urgent
  299. ### Application specific rule
  300. for_window [class="^Vncviewer$"] border none
  301. for_window [class="^TigerVNC Viewer$"] 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="^Vncviewer$" title="^{{ws.host}}:"] → {{workspace}}
  317. {% endfor %}
  318. ### Autostart
  319. #exec "{{default_terminal}}"
  320. exec --no-startup-id "~/bin/i3-watchers"