選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。

391 行
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. ### default/local mode
  15. ## special keys
  16. bindsym XF86Sleep exec {{i3_exec_command_prefix}} {{session_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+$left move workspace to output left
  70. bindsym $mod+Shift+Down move workspace to output down
  71. bindsym $mod+Shift+$down move workspace to output down
  72. bindsym $mod+Shift+Up move workspace to output up
  73. bindsym $mod+Shift+$up move workspace to output up
  74. bindsym $mod+Shift+Right move workspace to output right
  75. bindsym $mod+Shift+$right move workspace to output right
  76. ## Window
  77. # The middle button over a titlebar kills the window
  78. bindsym --release button2 kill
  79. # The middle button and a modifer over any part of the window kills the window
  80. bindsym --whole-window $mod+button2 kill
  81. bindsym $mod+BackSpace kill
  82. bindsym $mod+q kill
  83. bindsym $mod+f fullscreen
  84. bindsym $mod+r mode resize
  85. bindsym $mod+x exec {{i3_exec_command_prefix}} 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+u
  99. # $mod+adiaeresis
  100. # $mod+odiaeresis
  101. # $mod+udiaeresis
  102. # $mod+comma
  103. # $mod+period
  104. # $mod+numbersign
  105. # $mod+Home
  106. # $mod+End
  107. # $mod+Pause
  108. # $mod+Delete
  109. # $mod+Insert
  110. # $mod+Print
  111. # $mod+Scroll_Lock
  112. ## stuff that is available in default and remote mode
  113. {% macro overall() %}
  114. {% if home_profile == "desktop" %}
  115. bindsym $plexmod+space exec {{i3_exec_command_prefix}} ~/bin/on-space-shortcut
  116. bindsym $plexmod+BackSpace kill
  117. bindsym $plexmod+Tab {{workspace_switcher}}
  118. {% for ws in i3_number_workspace_keymaps %}
  119. bindsym $plexmod+{{ws.keysym}} workspace "{{ws.workspace}}"
  120. {% endfor %}
  121. {% for ws in i3_letter_workspace_keymaps %}
  122. bindsym $plexmod+{{ws.keysym}} workspace "{{ws.workspace}}"
  123. {% endfor %}
  124. # focus workspace
  125. bindsym $plexmod+Prior workspace next
  126. bindsym $plexmod+Next workspace prev
  127. {% endif %}
  128. # focus output
  129. bindsym $plexmod+Shift+p focus output primary
  130. 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' )"
  131. bindsym $plexmod+Left focus output left
  132. bindsym $plexmod+Down focus output down
  133. bindsym $plexmod+Up focus output up
  134. bindsym $plexmod+Right focus output right
  135. # Special modes
  136. bindcode $plexmod+49 mode "session"
  137. # activity
  138. bindsym $plexmod+less exec "{{i3_exec_command_prefix}} ~/bin/timer select_activity"
  139. {% endmacro %}
  140. {{ overall() }}
  141. ### remote mode
  142. mode "remote" {
  143. bindcode $mod+9 mode "default"
  144. bindsym XF86Sleep exec {{session_lock_command}}
  145. # The middle button over a titlebar kills the window
  146. bindsym --release button2 kill
  147. {{ overall() }}
  148. }
  149. ### Applications mode
  150. mode "apps" {
  151. {% for a in application_shortcuts | dict2items %}
  152. bindsym {{a.key}} exec {{i3_exec_command_prefix}} {{a.value}}; mode "default"
  153. {% endfor %}
  154. bindsym Escape mode "default"
  155. }
  156. ### Session
  157. mode "session" {
  158. bindsym q exit
  159. bindsym r reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}}
  160. bindsym R reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}}
  161. bindsym s exec --no-startup-id {{system_suspend_command}}; mode "default"; {{on_focus_workspace}}
  162. bindsym l exec --no-startup-id {{session_lock_command}}; mode "default"; {{on_focus_workspace}}
  163. bindcode 49 exec --no-startup-id {{session_lock_command}}; mode "default"; {{on_focus_workspace}}
  164. bindsym e exec --no-startup-id {{session_enable_screensaver_command}}; mode "default"; {{on_focus_workspace}}
  165. bindsym d exec --no-startup-id {{session_disable_screensaver_command}}; mode "default"; {{on_focus_workspace}}
  166. bindsym b exec --no-startup-id xsetroot -solid black; mode "default"; {{on_focus_workspace}}
  167. bindsym Shift+R exec --no-startup-id {{system_reboot_command}}; mode "default"; {{on_focus_workspace}}
  168. bindsym Shift+P exec --no-startup-id {{system_poweroff_command}}; mode "default"; {{on_focus_workspace}}
  169. # back to normal: Escape
  170. bindsym Escape mode "default"; {{on_focus_workspace}}
  171. }
  172. ### Timer
  173. mode "timer" {
  174. bindsym a exec "{{i3_exec_command_prefix}} ~/bin/timer select_activity"; mode "default"; {{on_focus_workspace}}
  175. bindsym e exec "{{i3_exec_command_prefix}} ~/bin/timer end_activity"; mode "default"; {{on_focus_workspace}}
  176. bindsym u exec "{{i3_exec_command_prefix}} ~/bin/timer uniklinik"; mode "default"; {{on_focus_workspace}}
  177. # back to normal: Escape
  178. bindsym Escape mode "default"; {{on_focus_workspace}}
  179. }
  180. ### Clipboard
  181. mode "clipboard" {
  182. # back to normal: Escape
  183. bindsym Escape mode "default"
  184. }
  185. ### Layout
  186. # set default layout to tabbed
  187. workspace_layout tabbed
  188. mode "layout" {
  189. bindsym s layout stacking; mode "default";
  190. bindsym t layout tabbed; mode "default";
  191. bindsym e layout toggle split; mode "default";
  192. bindsym h layout splith; mode "default"
  193. bindsym v layout splitv; mode "default"
  194. bindsym m exec --no-startup-id ~/bin/select-screenlayout; {{on_focus_workspace}}
  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. 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"
  208. bindsym p move workspace to output primary; mode "default"
  209. # back to normal: Escape
  210. bindsym Escape mode "default"
  211. }
  212. ### Resize window mode
  213. # resize window (you can also use the mouse for that)
  214. mode "resize" {
  215. # These bindings trigger as soon as you enter the resize mode
  216. # Pressing left will shrink the window’s width.
  217. bindsym Left resize shrink width 10 px or 10 ppt
  218. bindsym $left resize shrink width 10 px or 10 ppt
  219. # Pressing down will grow the window’s height.
  220. bindsym Down resize grow height 10 px or 10 ppt
  221. bindsym $down resize grow height 10 px or 10 ppt
  222. # Pressing up will shrink the window’s height.
  223. bindsym Up resize shrink height 10 px or 10 ppt
  224. bindsym $up resize shrink height 10 px or 10 ppt
  225. # Pressing right will grow the window’s width.
  226. bindsym Right resize grow width 10 px or 10 ppt
  227. bindsym $right resize grow width 10 px or 10 ppt
  228. bindsym 1 resize set 10 ppt 10 ppt; mode "default"
  229. bindsym 2 resize set 20 ppt 20 ppt; mode "default"
  230. bindsym 3 resize set 30 ppt 30 ppt; mode "default"
  231. bindsym 4 resize set 40 ppt 40 ppt; mode "default"
  232. bindsym 5 resize set 50 ppt 50 ppt; mode "default"
  233. bindsym 6 resize set 60 ppt 60 ppt; mode "default"
  234. bindsym 7 resize set 70 ppt 70 ppt; mode "default"
  235. bindsym 8 resize set 80 ppt 80 ppt; mode "default"
  236. bindsym 9 resize set 90 ppt 90 ppt; mode "default"
  237. bindsym 0 resize set 100 ppt 100 ppt; mode "default"
  238. bindsym v resize set 640 480; mode "default"
  239. bindsym y resize set 870 628; mode "default"
  240. # back to normal: Escape
  241. bindsym Escape mode "default"
  242. }
  243. ### Bar
  244. bar {
  245. {% if i3_hide_bar %}
  246. mode invisible
  247. hidden_state hide
  248. {% endif %}
  249. position top
  250. strip_workspace_numbers yes
  251. tray_output primary
  252. status_command i3blocks
  253. colors {
  254. background #000000
  255. statusline #ffffff
  256. separator #666666
  257. # <colorclass> <border> <background> <text>
  258. focused_workspace {{home_base_color_hue|hsv2rgb(50,60)}} {{home_base_color_hue|hsv2rgb(66,47)}} #ffffff
  259. active_workspace #333333 #696969 #ffffff
  260. inactive_workspace #333333 #222222 #888888
  261. urgent_workspace #2f343a #900000 #ffffff
  262. binding_mode #2f343a #900000 #ffffff
  263. }
  264. }
  265. ### Design
  266. # class border backgr. text indicator child_border
  267. 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)}}
  268. client.focused_inactive #333333 #6A6A6A #ffffff #505050 #6A6A6A
  269. client.unfocused #333333 #222222 #888888 #2E2E2E #222222
  270. client.urgent #2f343a #900000 #ffffff #900000 #900000
  271. client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
  272. client.background #ffffff
  273. {% if not i3_hide_border_one_window %}
  274. default_border normal
  275. hide_edge_borders both
  276. {% else %}
  277. default_border none
  278. hide_edge_borders smart
  279. {% endif %}
  280. default_floating_border normal
  281. ### general settings
  282. focus_on_window_activation urgent
  283. ### Application specific rule
  284. for_window [class="^(?:Tiger)?V[Nn][Cc] ?[Vv]iewer$"] border none
  285. for_window [window_role="^About$"] floating enable
  286. for_window [class="^Pavu"] floating enable
  287. for_window [class="^Paman$"] floating enable
  288. for_window [class="^Blueman"] floating enable
  289. for_window [class="^URxvt$" title="^tmux-workspace$"] border none
  290. ### assign apps to workspaces
  291. assign [class="^netzdrive$"] → netzdrive
  292. assign [class="^TelegramDesktop$"] → tg
  293. assign [class="^Signal$"] → signal
  294. assign [class="^Element$"] → matrix
  295. assign [class="^thunderbird$"] → mail
  296. # vncviewer workspaces
  297. {% for workspace in workspaces|dict2items|json_query("[?value.type=='vncviewer'].key") %}
  298. {% set ws = workspaces[workspace] %}
  299. assign [class="^(?:Tiger)?V[Nn][Cc] ?[Vv]iewer$" title="^{{ws.host}}:{{ws.display|default(home_vncserver_display_number)}}"] → {{workspace}}
  300. {% endfor %}
  301. # Autostart
  302. exec --no-startup-id "~/bin/i3-watchers"