Dotfiles for my tiling window manager + terminal workflow.
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.

514 lines
16 KiB

  1. # vim: fdm=marker ft=i3.go-template
  2. # startup [[[ #
  3. set $browser "firefox"
  4. # set $browser "chromium"
  5. set $term "urxvt"
  6. set $scripts_path "/home/kevin/scripts"
  7. exec redshift -O 2000
  8. # exec redshift -O 3000
  9. # random bg
  10. exec compton
  11. exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing")
  12. exec imwheel
  13. exec xmodmap ~/.Xmodmap
  14. exec xset r rate $XSET_DELAY $XSET_RATE
  15. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  16. exec xbacklight -set 10
  17. {{ end }}
  18. exec xrdb ~/.Xresources
  19. exec --no-startup-id dunst
  20. exec --no-startup-id start-pulseaudio-x11
  21. exec --no-startup-id i3-msg 'workspace $ws2; exec $term'
  22. exec --no-startup-id i3-msg 'workspace $ws3; exec $browser'
  23. # exec --no-startup-id i3-msg 'workspace $ws11; exec $swex'
  24. exec_always --no-startup-id numlockx on
  25. # ]]] startup #
  26. # applications [[[ #
  27. set $mod Mod1
  28. set $sch_dir "$HOME/Documents/School"
  29. # app shortcuts [[[ #
  30. bindsym control+Return exec $term
  31. # PROTIP: You can also dynamically set dmenu's colors this way:
  32. bindsym Mod4+Return exec dmenu_run -nb "$fg" -nf "$bg" -sb "$bg" -sf "$fg"
  33. # bindsym Mod4+Return exec dmenu_run
  34. # There also is the (new) i3-dmenu-desktop which only displays applications
  35. # shipping a .desktop file. It is a wrapper around dmenu, so you need that
  36. # installed.
  37. # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
  38. bindsym Mod4+b layout tabbed; exec zathura
  39. bindsym Mod4+c exec $browser
  40. # bindsym Mod4+e exec notify-send "HPS Word Count" "$(pdftotext /home/kevin/school/latex-notes/hps/essay.pdf - | wc -w)"
  41. bindsym Mod4+f exec firefox
  42. bindsym Mod4+$mod+f exec echo 'Kevin@fosstodon.org' | xclip -selection clipboard
  43. bindsym Mod4+h exec echo 'kevin.mok@live.ca' | xclip -selection clipboard
  44. bindsym Mod4+$mod+m exec pass -c uoft/markus
  45. bindsym Mod4+n exec urxvt -e nvim
  46. bindsym Mod4+o exec xclip -selection clipboard ~/.password-store/social/gmail
  47. bindsym Mod4+$mod+o exec xset dpms force off
  48. # bindsym Mod4+p workspace $ws4; exec pgadmin3
  49. # bindsym Mod4+p exec pycharm
  50. bindsym Mod4+p exec passmenu
  51. # bindsym Mod4+$mod+p exec notify-send "ping" "$(ping -c 3 -W 1 8.8.8.8)"
  52. bindsym Mod4+q exec qdirstat
  53. bindsym Mod4+r exec urxvt -e ranger
  54. bindsym Mod4+$mod+r exec notify-send "watson restart" "$(watson restart)"
  55. # bindsym Mod4+t exec st
  56. bindsym Mod4+$mod+t exec xclip -selection clipboard ~/.password-store/social/trapbot
  57. bindsym Mod4+u exec echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard
  58. bindsym Mod4+$mod+u exec pass -c uoft/acorn
  59. bindsym Mod4+w exec notify-send "watson status" "$(watson status)"
  60. bindsym Mod4+$mod+w exec notify-send "watson stop" "$(watson status && watson stop)"
  61. bindsym control+Mod4+w exec urxvt -e nvim /home/kevin/.config/watson/state.tmp
  62. # bindsym Mod4+x exec $swex
  63. bindsym Mod4+x exec xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE
  64. bindsym Mod4+z exec cliqz
  65. {{ if .ext_kb }}
  66. bindsym Print --release exec "scrot -s /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
  67. bindsym control+Print --release exec "scrot -u /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
  68. {{ else }}
  69. bindsym $mod+p --release exec "scrot -s /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
  70. bindsym control+$mod+p --release exec "scrot -u /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
  71. {{ end }}
  72. # ]]] app shortcuts #
  73. # redshift [[[ #
  74. bindsym $mod+Mod4+1 exec redshift -x && redshift -O 1100
  75. bindsym $mod+Mod4+2 exec redshift -x && redshift -O 2000
  76. bindsym $mod+Mod4+3 exec redshift -x && redshift -O 3000
  77. bindsym $mod+Mod4+4 exec redshift -x && redshift -O 4000
  78. bindsym $mod+Mod4+5 exec redshift -x && redshift -O 5000
  79. bindsym $mod+Mod4+grave exec redshift -x
  80. # ]]] redshift #
  81. # backlight [[[ #
  82. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  83. bindsym Shift+F1 exec xbacklight -set 10
  84. bindsym Shift+F2 exec xbacklight -set 20
  85. bindsym Shift+F3 exec xbacklight -set 30
  86. bindsym Shift+F4 exec xbacklight -set 40
  87. bindsym Shift+F5 exec xbacklight -set 50
  88. bindsym Shift+F6 exec xbacklight -set 60
  89. bindsym Shift+F7 exec xbacklight -set 70
  90. bindsym Shift+F8 exec xbacklight -set 80
  91. bindsym Shift+F9 exec xbacklight -set 90
  92. bindsym Shift+F0 exec xbacklight -set 100
  93. bindsym control+$mod+plus exec xbacklight -inc 2
  94. bindsym control+$mod+minus exec xbacklight -dec 2
  95. bindsym $mod+w exec sudo systemctl start netctl-auto@wlp3s0.service
  96. bindsym $mod+q exec sudo systemctl stop netctl-auto@wlp3s0.service
  97. {{ end }}
  98. # ]]] backlight #
  99. for_window [class="Peek"] floating enable
  100. # ]]] applications #
  101. # container display [[[ #
  102. # Font for window titles
  103. font pango:$sb_font 11
  104. bindsym $mod+s layout stacking
  105. # change container layout (stacked, tabbed, toggle split)
  106. bindsym $mod+t layout tabbed
  107. bindsym $mod+e layout toggle split
  108. # enter fullscreen mode for the focused container
  109. bindsym $mod+f fullscreen toggle
  110. # toggle tiling /floating
  111. bindsym $mod+Shift+space floating toggle
  112. # change focus between tiling / floating windows
  113. bindsym $mod+space focus mode_toggle
  114. # focus the parent container
  115. bindsym $mod+a focus parent
  116. # focus the child container
  117. #bindsym $mod+d focus child
  118. # gaps [[[ #
  119. for_window [class="^.*"] border pixel 3
  120. set $inner_gaps 40
  121. set $outer_gaps 0
  122. # remove window titlebars
  123. # for_window [class="^.*"] border pixel 1
  124. # gaps inner $inner_gaps
  125. # gaps outer $outer_gaps
  126. # gaps bottom 0
  127. gaps inner 0
  128. gaps outer 0
  129. # other gaps [[[ #
  130. # gaps horizontal 20
  131. # gaps vertical 10
  132. # gaps top
  133. # gaps left 20
  134. # gaps right 20
  135. # gaps bottom
  136. # ]]] other gaps #
  137. bindsym control+shift+plus gaps inner all set $inner_gaps;gaps outer all set $outer_gaps
  138. bindsym control+shift+0 gaps inner all set 0;gaps outer all set 0
  139. # ]]] gaps #
  140. # colors from pywal [[[ #
  141. set_from_resource $fg i3wm.color7 #f0f0f0
  142. # Set colors from Xresources
  143. # Change 'color7' and 'color2' to whatever colors you want i3 to use
  144. # from the generated scheme.
  145. # NOTE: The '#f0f0f0' in the lines below is the color i3 will use if
  146. # it fails to get colors from Xresources.
  147. set_from_resource $bg i3wm.color2 #f0f0f0
  148. # class border backgr. text indicator child_border
  149. client.focused $bg $bg $fg $bg $bg
  150. # client.unfocused $fg $bg $fg $bg $fg
  151. # client.urgent $bg $bg $fg $bg $bg
  152. # client.placeholder $bg $bg $fg $bg $bg
  153. # client.background $bg
  154. # ]]] colors from pywal #
  155. # ]]] container display #
  156. # moving windows [[[ #
  157. # Use Mouse+$mod to drag floating windows to their wanted position
  158. floating_modifier $mod
  159. # change focus
  160. bindsym control+h focus left
  161. bindsym control+j focus down
  162. bindsym control+k focus up
  163. bindsym control+l focus right
  164. # move workspace to other monitor
  165. bindsym $mod+minus move workspace to output left
  166. bindsym $mod+plus move workspace to output right
  167. # move focused window
  168. bindsym control+Shift+h move left
  169. bindsym control+Shift+j move down
  170. bindsym control+Shift+k move up
  171. bindsym control+Shift+l move right
  172. # split in horizontal orientation
  173. bindsym $mod+b split h
  174. bindsym Mod4+$mod+b split h; exec $term
  175. # split in vertical orientation
  176. bindsym $mod+v split v
  177. bindsym Mod4+$mod+v split v; exec $term
  178. # resizing windows #
  179. bindsym $mod+control+h resize grow width 5 px or 5 ppt
  180. bindsym $mod+control+k resize grow height 5 px or 5 ppt
  181. bindsym $mod+control+j resize shrink height 5 px or 5 ppt
  182. bindsym $mod+control+l resize shrink width 5 px or 5 ppt
  183. # bindsym control+Shift+x kill
  184. bindsym shift+x kill
  185. # ]]] moving windows #
  186. # backgrounds [[[ #
  187. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  188. bindsym control+$mod+q exec wal -i "$HOME/Pictures/Backgrounds/bright/editing"; exec ~/.cache/wal/colors.sh
  189. bindsym control+$mod+w exec /home/kevin/linux-config/scripts/bg-chooser; exec ~/.cache/wal/colors.sh
  190. bindsym $mod+r exec wal -i "$HOME/Pictures/Backgrounds/dim/editing"; exec ~/.cache/wal/colors.sh
  191. # bindsym $mod+r exec wal -i "$HOME/Pictures/Backgrounds/"; exec ~/.cache/wal/colors.sh
  192. bindsym control+$mod+z exec feh --bg-fill ~/Pictures/Backgrounds/dim/black.jpg
  193. {{ else }}
  194. bindsym $mod+q exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/editing")
  195. bindsym $mod+w exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing")
  196. # bindsym $mod+w exec ~/linux-config/scripts/bg-chooser
  197. bindsym $mod+r exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/editing")
  198. bindsym $mod+y exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/non-editing")
  199. {{ end }}
  200. # ]]] backgrounds #
  201. # ws names [[[ #
  202. set $ws1 "1 "
  203. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  204. set $secondary "HDMI2"
  205. set $main "eDP1"
  206. {{ else if eq .chezmoi.fullHostname "nzxt" }}
  207. set $secondary "DVI-I-1"
  208. set $main "HDMI-0"
  209. {{ end }}
  210. workspace $ws1 output $main
  211. bindsym $mod+F1 workspace $ws1; exec $term
  212. set $ws2 "2 "
  213. workspace $ws2 output $secondary
  214. bindsym $mod+F2 workspace $ws2; exec $term
  215. set $ws3 "3 "
  216. # set $ws3 "3 "
  217. workspace $ws3 output $main
  218. bindsym $mod+F3 workspace $ws3; exec $browser
  219. set $ws4 "4 "
  220. workspace $ws4 output $secondary
  221. bindsym $mod+F4 workspace $ws4; exec $term
  222. set $ws5 "5 "
  223. # set $ws5 "5 🎥"
  224. workspace $ws5 output $secondary
  225. assign [class="Steam"] $ws5
  226. bindsym $mod+F5 workspace $ws5; exec $browser
  227. bindsym Mod4+g workspace $ws5; layout stacking; exec urxvt -e steam
  228. bindsym Mod4+t workspace $ws5; exec thunderbird
  229. bindsym Mod4+5 workspace $ws5; exec cd ~/coding/ada-mario-prep && godot -e
  230. for_window [class="ada-mario-prep"] floating enable
  231. for_window [class="Move_mouse_with_head"] floating enable
  232. set $ws6 "6 "
  233. workspace $ws6 output $secondary
  234. assign [class="Slack"] $ws6
  235. bindsym Mod4+d workspace $ws6; exec discord
  236. # bindsym Mod4+i workspace $ws6; exec firefox -new-window https://riot.im/app/#/home
  237. bindsym Mod4+k workspace $ws6; exec slack
  238. set $ws7 "7 "
  239. # set $ws7 "7 📤"
  240. workspace $ws7 output $secondary
  241. bindsym $mod+F7 workspace $ws7; exec $term
  242. # bindsym Mod4+v workspace $ws7; exec VBoxManage startvm "369-a1"
  243. set $ws8 "8 "
  244. # set $ws8 "8 📊"
  245. # assign [class="jetbrains-"] $ws8
  246. workspace $ws8 output $secondary
  247. bindsym $mod+F8 workspace $ws8; exec $term
  248. set $ws9 "9 "
  249. # set $ws9 "9 🔧"
  250. workspace $ws9 output $secondary
  251. bindsym $mod+F9 workspace $ws9; exec $term
  252. set $ws10 "10 "
  253. # set $ws10 "10 🎵"
  254. assign [class="spotify"] $ws10
  255. workspace $ws10 output $secondary
  256. set $hp 2
  257. # bindsym Mod4+v workspace $ws10; exec urxvt -e alsamixer -c 0
  258. bindsym Mod4+v workspace $ws10; exec urxvt -e cava
  259. # bindsym Mod4+h workspace $ws10; exec urxvt -e alsamixer -c $hp
  260. bindsym Mod4+s workspace $ws10; exec spotify
  261. set $ws11 "11 "
  262. # set $ws11 "11 📊"
  263. # assign [class="Summoners War Exporter"] $ws11
  264. workspace $ws11 output $secondary
  265. bindsym $mod+F11 workspace $ws11; exec urxvt -e htop -s PERCENT_CPU
  266. set $ws12 "12 "
  267. bindsym $mod+F12 workspace $ws12; exec $term
  268. set $ws13 "13 "
  269. bindsym Mod4+F3 workspace $ws13; exec $term
  270. set $ws14 "14"
  271. set $ws15 "15"
  272. # ]]] ws names #
  273. # ws bindings [[[ #
  274. bindsym $mod+h workspace prev
  275. bindsym $mod+l workspace next
  276. bindsym $mod+1 workspace $ws1
  277. bindsym $mod+2 workspace $ws2
  278. bindsym $mod+3 workspace $ws3
  279. bindsym $mod+4 workspace $ws4
  280. bindsym $mod+5 workspace $ws5
  281. bindsym $mod+6 workspace $ws6
  282. bindsym $mod+7 workspace $ws7
  283. bindsym $mod+8 workspace $ws8
  284. bindsym $mod+9 workspace $ws9
  285. bindsym $mod+0 workspace $ws10
  286. bindsym Mod4+1 workspace $ws11
  287. # bindsym Mod4+2 workspace $ws12
  288. # bindsym Mod4+3 workspace $ws13
  289. # bindsym Mod4+4 workspace $ws14
  290. # bindsym Mod4+5 workspace $ws15
  291. # move container to ws [[[ #
  292. bindsym $mod+control+1 move container to workspace $ws1; workspace $ws1
  293. bindsym $mod+control+2 move container to workspace $ws2; workspace $ws2
  294. bindsym $mod+control+3 move container to workspace $ws3; workspace $ws3
  295. bindsym $mod+control+4 move container to workspace $ws4; workspace $ws4
  296. bindsym $mod+control+5 move container to workspace $ws5; workspace $ws5
  297. bindsym $mod+control+6 move container to workspace $ws6; workspace $ws6
  298. bindsym $mod+control+7 move container to workspace $ws7; workspace $ws7
  299. bindsym $mod+control+8 move container to workspace $ws8; workspace $ws8
  300. bindsym $mod+control+9 move container to workspace $ws9; workspace $ws9
  301. bindsym $mod+control+0 move container to workspace $ws10; workspace $ws10
  302. bindsym $mod+Shift+1 move container to workspace $ws11; workspace $ws11
  303. bindsym $mod+Shift+2 move container to workspace $ws12; workspace $ws12
  304. bindsym $mod+Shift+3 move container to workspace $ws13; workspace $ws13
  305. bindsym $mod+Shift+4 move container to workspace $ws14; workspace $ws14
  306. bindsym $mod+Shift+5 move container to workspace $ws15; workspace $ws15
  307. # ]]] move container to ws #
  308. # ]]] ws bindings #
  309. # reload config [[[ #
  310. bindsym $mod+control+r exec i3-msg restart
  311. bindsym $mod+Shift+c reload
  312. # bindsym $mod+control+r reload
  313. bindsym $mod+control+u exec xrdb ~/.Xresources
  314. # exit i3 (logs you out of your X session)
  315. bindsym control+$mod+s exec systemctl suspend
  316. bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
  317. # ]]] reload config #
  318. # status bar [[[ #
  319. # bar vars [[[ #
  320. # set $sb_font Hack NF Bold
  321. # set $sb_font EmojiOne
  322. set $sb_font DejaVuSansMono Nerd Font Mono Bold
  323. set $black #000000
  324. set $white #ffffff
  325. for_window [class="Yad"] floating enable
  326. # set $inactive_ws_bg $white
  327. set $inactive_ws_bg #444c52
  328. # set $inactive_ws_trans 96
  329. set $inactive_ws_trans 00
  330. # set $active_ws_trans 91
  331. set $active_ws_trans 4b
  332. set $focused_ws_text #ffffff
  333. # ]]] bar vars #
  334. # main bar [[[ #
  335. # set $bar_trans 64
  336. set $bar_trans 00
  337. set $main_ws_trans aa
  338. bar {
  339. i3bar_command i3bar -t
  340. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  341. font pango:$sb_font 17
  342. {{ else }}
  343. font pango:$sb_font 21
  344. {{ end }}
  345. colors {
  346. # 0 (transparent) -> 255 (opaque) in hex
  347. background $black$bar_trans
  348. # border, bg, text color
  349. # focused_workspace $inactive_ws_bg $bg $focused_ws_text
  350. focused_workspace $inactive_ws_bg $bg $fg
  351. # active = focused on other screen
  352. active_workspace $inactive_ws_bg $fg$active_ws_trans $fg
  353. inactive_workspace $inactive_ws_bg $inactive_ws_bg$inactive_ws_trans $fg
  354. }
  355. tray_output none
  356. # status_command i3blocks -c ~/.config/i3blocks/i3blocks.conf
  357. status_command 2>/tmp/i3blocks.err i3blocks -vvv -c ~/.config/i3blocks/i3blocks.conf | tee /tmp/i3blocks.out
  358. output $main
  359. wheel_up_cmd nop
  360. wheel_down_cmd nop
  361. }
  362. # ]]] main bar #
  363. # secondary bar [[[ #
  364. bar {
  365. output $secondary
  366. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  367. font pango:$sb_font 18
  368. {{ else }}
  369. font pango:$sb_font 25
  370. {{ end }}
  371. # output $main
  372. i3bar_command i3bar -t
  373. colors {
  374. background $black$bar_trans
  375. # border, bg, text color
  376. # focused_workspace $inactive_ws_bg $bg $focused_ws_text
  377. focused_workspace $inactive_ws_bg $bg $fg
  378. active_workspace $inactive_ws_bg $fg$active_ws_trans $fg
  379. inactive_workspace $inactive_ws_bg $inactive_ws_bg$inactive_ws_trans $fg
  380. }
  381. status_command i3blocks -c ~/.config/i3blocks/i3blocks-secondary.conf
  382. # status_command 2>/tmp/i3blocks-sam.err i3blocks -vvv -c ~/.config/i3blocks/sam-i3blocks.conf | tee /tmp/i3blocks-sam.out
  383. tray_output none
  384. wheel_up_cmd nop
  385. wheel_down_cmd nop
  386. }
  387. # ]]] secondary bar #
  388. # display bar [[[ #
  389. # bar {
  390. # i3bar_command i3bar -t
  391. # font pango:$sb_font 23
  392. # tray_output none
  393. # status_command i3blocks -c ~/.config/i3blocks/i3blocks-display.conf
  394. # output $secondary
  395. # wheel_up_cmd nop
  396. # wheel_down_cmd nop
  397. # }
  398. # ]]] display bar #
  399. # ]]] status bar #
  400. # media keys [[[ #
  401. # sink
  402. bindsym XF86AudioRaiseVolume exec amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks
  403. bindsym control+d exec ~/linux-config/scripts/change-sink dac
  404. # bindsym control+shift+d exec ~/linux-config/scripts/change-sink dac2
  405. bindsym control+o exec ~/linux-config/scripts/change-sink line-out
  406. # media
  407. bindsym XF86AudioLowerVolume exec amixer -q -D pulse sset Master 5%- && pkill -RTMIN+1 i3blocks
  408. bindsym XF86AudioMute exec amixer -q -D pulse sset Master toggle && pkill -RTMIN+1 i3blocks
  409. bindsym XF86AudioPlay exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
  410. bindsym XF86AudioStop exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"
  411. bindsym XF86AudioPrev exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"
  412. bindsym XF86AudioNext exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"
  413. # ]]] media keys #