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.

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