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.

473 lines
18 KiB

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