Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

i3.config.j2 12KB

4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
4 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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+t 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. # unlearn
  92. #exec {{points_down_command}}
  93. ## stuff that is available in default and remote mode
  94. {% macro overall() %}
  95. {% if home_profile == "desktop" %}
  96. bindsym $plexmod+space exec ~/bin/on-space-shortcut
  97. bindsym $plexmod+BackSpace kill
  98. bindsym $plexmod+w {{workspace_switcher}}
  99. {% for ws in i3_number_workspace_keymaps %}
  100. bindsym $plexmod+{{ws.keysym}} workspace "{{ws.workspace}}"
  101. {% endfor %}
  102. {% for ws in i3_letter_workspace_keymaps %}
  103. bindsym $plexmod+{{ws.keysym}} workspace "{{ws.workspace}}"
  104. {% endfor %}
  105. # focus workspace
  106. bindsym $plexmod+Prior workspace next
  107. bindsym $plexmod+Next workspace prev
  108. {% endif %}
  109. # focus output
  110. bindsym $plexmod+Shift+p focus output primary
  111. 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' )"
  112. bindsym $plexmod+Left focus output left
  113. bindsym $plexmod+Down focus output down
  114. bindsym $plexmod+Up focus output up
  115. bindsym $plexmod+Right focus output right
  116. # Special modes
  117. bindsym $plexmod+s mode session
  118. bindsym $plexmod+t mode timer
  119. {% endmacro %}
  120. {{ overall() }}
  121. ### remote mode
  122. mode "remote" {
  123. bindcode $mod+9 mode "default"
  124. bindsym XF86Sleep exec {{session_lock_command}}
  125. # The middle button over a titlebar kills the window
  126. bindsym --release button2 kill
  127. {{ overall() }}
  128. }
  129. ### Applications mode
  130. mode "apps" {
  131. {% for a in application_shortcuts | dict2items %}
  132. bindsym {{a.key}} exec {{a.value}}; mode "default"
  133. {% endfor %}
  134. bindsym Escape mode "default"
  135. }
  136. ### Session
  137. mode "session" {
  138. bindsym q exit
  139. bindsym r reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}}
  140. bindsym R reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}}
  141. bindsym s exec --no-startup-id {{session_lock_command}}; exec --no-startup {{system_suspend_command}}; mode "default"; {{on_focus_workspace}}
  142. bindsym x exec --no-startup-id {{session_lock_command}}; mode "default"; {{on_focus_workspace}}
  143. bindsym e exec --no-startup-id {{session_enable_screensaver_command}}; mode "default"; {{on_focus_workspace}}
  144. bindsym d exec --no-startup-id {{session_disable_screensaver_command}}; mode "default"; {{on_focus_workspace}}
  145. bindsym b exec --no-startup-id xsetroot -solid black; mode "default"; {{on_focus_workspace}}
  146. bindsym Shift+R exec --no-startup-id {{system_reboot_command}}; mode "default"; {{on_focus_workspace}}
  147. bindsym Shift+P exec --no-startup-id {{system_poweroff_command}}; mode "default"; {{on_focus_workspace}}
  148. # back to normal: Escape
  149. bindsym Escape mode "default"; {{on_focus_workspace}}
  150. }
  151. ### Timer
  152. mode "timer" {
  153. bindsym a exec "~/bin/timer activity"; mode "default"; {{on_focus_workspace}}
  154. bindsym e exec "~/bin/timer end"; mode "default"; {{on_focus_workspace}}
  155. bindsym r exec "~/bin/timer update"; mode "default"; {{on_focus_workspace}}
  156. bindsym r exec "~/bin/timer uniklinik"; mode "default"; {{on_focus_workspace}}
  157. # back to normal: Escape
  158. bindsym Escape mode "default"; {{on_focus_workspace}}
  159. }
  160. ### Clipboard
  161. mode "clipboard" {
  162. # back to normal: Escape
  163. bindsym Escape mode "default"
  164. }
  165. ### Layout
  166. # set default layout to tabbed
  167. workspace_layout tabbed
  168. mode "layout" {
  169. bindsym s layout stacking; mode "default";
  170. bindsym t layout tabbed; mode "default";
  171. bindsym e layout toggle split; mode "default";
  172. bindsym h layout splith; mode "default"
  173. bindsym v layout splitv; mode "default"
  174. bindsym b mode bar
  175. # back to normal: Escape
  176. bindsym Escape mode "default"
  177. }
  178. mode "bar" {
  179. bindsym h bar mode hide; mode "default"
  180. bindsym d bar mode dock; mode "default"
  181. # back to normal: Escape
  182. bindsym Escape mode "default"
  183. }
  184. ### Move mode
  185. mode "move" {
  186. # move window
  187. bindsym Left move left
  188. bindsym $left move left
  189. bindsym Down move down
  190. bindsym $down move down
  191. bindsym Up move up
  192. bindsym $up move up
  193. bindsym Right move right
  194. bindsym $right move right
  195. # move window to workspace
  196. {% for ws in i3_number_workspace_keymaps %}
  197. bindsym {{ws.keysym}} move container to workspace "{{ws.workspace}}"; mode "default"
  198. {% endfor %}
  199. 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"
  200. bindsym ssharp move scratchpad
  201. # move workspace to output
  202. bindsym Shift+Left move workspace to output left
  203. bindsym Shift+$left move workspace to output left
  204. bindsym Shift+Down move workspace to output down
  205. bindsym Shift+$down move workspace to output down
  206. bindsym Shift+Up move workspace to output up
  207. bindsym Shift+$up move workspace to output up
  208. bindsym Shift+Right move workspace to output right
  209. bindsym Shift+$right move workspace to output right
  210. 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"
  211. bindsym p move workspace to output primary; mode "default"
  212. # back to normal: Escape
  213. bindsym Escape mode "default"
  214. }
  215. ### Resize window mode
  216. # resize window (you can also use the mouse for that)
  217. mode "resize" {
  218. # These bindings trigger as soon as you enter the resize mode
  219. # Pressing left will shrink the window’s width.
  220. bindsym Left resize shrink width 10 px or 10 ppt
  221. bindsym $left resize shrink width 10 px or 10 ppt
  222. # Pressing down will grow the window’s height.
  223. bindsym Down resize grow height 10 px or 10 ppt
  224. bindsym $down resize grow height 10 px or 10 ppt
  225. # Pressing up will shrink the window’s height.
  226. bindsym Up resize shrink height 10 px or 10 ppt
  227. bindsym $up resize shrink height 10 px or 10 ppt
  228. # Pressing right will grow the window’s width.
  229. bindsym Right resize grow width 10 px or 10 ppt
  230. bindsym $right resize grow width 10 px or 10 ppt
  231. bindsym 1 resize set 10 ppt 10 ppt; mode "default"
  232. bindsym 2 resize set 20 ppt 20 ppt; mode "default"
  233. bindsym 3 resize set 30 ppt 30 ppt; mode "default"
  234. bindsym 4 resize set 40 ppt 40 ppt; mode "default"
  235. bindsym 5 resize set 50 ppt 50 ppt; mode "default"
  236. bindsym 6 resize set 60 ppt 60 ppt; mode "default"
  237. bindsym 7 resize set 70 ppt 70 ppt; mode "default"
  238. bindsym 8 resize set 80 ppt 80 ppt; mode "default"
  239. bindsym 9 resize set 90 ppt 90 ppt; mode "default"
  240. bindsym 0 resize set 100 ppt 100 ppt; mode "default"
  241. bindsym v resize set 640 480; mode "default"
  242. bindsym y resize set 870 628; mode "default"
  243. # back to normal: Escape
  244. bindsym Escape mode "default"
  245. }
  246. ### Bar
  247. bar {
  248. position top
  249. strip_workspace_numbers yes
  250. tray_output primary
  251. status_command i3blocks
  252. colors {
  253. background #000000
  254. statusline #ffffff
  255. separator #666666
  256. # <colorclass> <border> <background> <text>
  257. {% if home_profile == "desktop" %}
  258. # lila: Farbton 274
  259. focused_workspace #774C99 #552877 #ffffff
  260. {% endif %}
  261. {% if home_profile == "vdesk" %}
  262. # grün: Farbton 110
  263. focused_workspace #4D994C #357728 #ffffff
  264. {% endif %}
  265. {% if home_profile == "presentation" %}
  266. # gelb: Farbton 60
  267. focused_workspace #99994C #777728 #ffffff
  268. {% endif %}
  269. active_workspace #333333 #696969 #ffffff
  270. inactive_workspace #333333 #222222 #888888
  271. urgent_workspace #2f343a #900000 #ffffff
  272. binding_mode #2f343a #900000 #ffffff
  273. }
  274. }
  275. ### Design
  276. # class border backgr. text indicator child_border
  277. {% if home_profile == "desktop" %}
  278. # lila: Farbton 274
  279. client.focused #784C99 #552877 #ffffff #9E2EF4 #552877
  280. {% endif %}
  281. {% if home_profile == "vdesk" %}
  282. # grün: Farbton 110
  283. client.focused #59994C #357728 #ffffff #4FF42E #357728
  284. {% endif %}
  285. {% if home_profile == "presentation" %}
  286. # gelb: Farbton 60
  287. client.focused #99994C #777728 #ffffff #F4F42E #777728
  288. {% endif %}
  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. ### Autostart
  308. exec "{{default_terminal}}"
  309. exec --no-startup-id "~/bin/i3-watchers"
  310. ### free keys
  311. # $mod+i
  312. # $mod+j
  313. # $mod+k
  314. # $mod+l
  315. # $mod+n
  316. # $mod+o
  317. # $mod+u
  318. # $mod+adiaeresis
  319. # $mod+odiaeresis
  320. # $mod+udiaeresis
  321. # $mod+comma
  322. # $mod+period
  323. # $mod+numbersign
  324. # $mod+Home
  325. # $mod+End
  326. # $mod+Pause
  327. # $mod+Delete
  328. # $mod+Insert
  329. # $mod+Print
  330. # $mod+Scroll_Lock
  331. # $mod+less