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.

i3.config.j2 12KB

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