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.

508 lines
16 KiB

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