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.

503 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 "$HOME/Pictures/Backgrounds/bright/editing"; exec ~/.cache/wal/colors.sh
  179. bindsym control+$mod+w exec /home/kevin/linux-config/scripts/bg-chooser; exec ~/.cache/wal/colors.sh
  180. bindsym $mod+r exec wal -i "$HOME/Pictures/Backgrounds/dim/editing"; exec ~/.cache/wal/colors.sh
  181. # bindsym $mod+r exec wal -i "$HOME/Pictures/Backgrounds/"; exec ~/.cache/wal/colors.sh
  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. bindsym $mod+r exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/editing") && $make_st_script
  188. bindsym $mod+y exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/non-editing") && $make_st_script
  189. {{ end }}
  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+t workspace $ws5; exec thunderbird
  218. bindsym Mod4+5 workspace $ws5; exec cd ~/coding/ada-mario-prep && godot -e
  219. for_window [class="ada-mario-prep"] floating enable
  220. for_window [class="Move_mouse_with_head"] floating enable
  221. set $ws6 "6 "
  222. workspace $ws6 output $secondary
  223. assign [class="Slack"] $ws6
  224. bindsym Mod4+d workspace $ws6; exec discord
  225. # bindsym Mod4+i workspace $ws6; exec firefox -new-window https://riot.im/app/#/home
  226. bindsym Mod4+k workspace $ws6; exec slack
  227. set $ws7 "7 "
  228. workspace $ws7 output $secondary
  229. bindsym $mod+F7 workspace $ws7; exec $term
  230. # bindsym Mod4+v workspace $ws7; exec VBoxManage startvm "369-a1"
  231. set $ws8 "8 "
  232. # assign [class="jetbrains-"] $ws8
  233. workspace $ws8 output $secondary
  234. bindsym $mod+F8 workspace $ws8; exec $term
  235. set $ws9 "9 "
  236. workspace $ws9 output $secondary
  237. bindsym $mod+F9 workspace $ws9; exec $term
  238. set $ws10 "10 "
  239. # set $ws10 "10 🎵"
  240. assign [class="spotify"] $ws10
  241. workspace $ws10 output $secondary
  242. set $hp 2
  243. # bindsym Mod4+v workspace $ws10; exec urxvt -e alsamixer -c 0
  244. bindsym Mod4+v workspace $ws10; exec urxvt -e cava
  245. # bindsym Mod4+h workspace $ws10; exec urxvt -e alsamixer -c $hp
  246. bindsym Mod4+s workspace $ws10; exec spotify
  247. set $ws11 "11 "
  248. # set $ws11 "11 📊"
  249. # assign [class="Summoners War Exporter"] $ws11
  250. workspace $ws11 output $secondary
  251. bindsym $mod+F11 workspace $ws11; exec urxvt -e htop -s PERCENT_CPU
  252. set $ws12 "12 "
  253. bindsym $mod+F12 workspace $ws12; exec $term
  254. set $ws13 "13 "
  255. bindsym Mod4+F3 workspace $ws13; exec $term
  256. set $ws14 "14"
  257. set $ws15 "15"
  258. # ]]] ws names #
  259. # ws bindings [[[ #
  260. bindsym $mod+h workspace prev
  261. bindsym $mod+l workspace next
  262. bindsym $mod+1 workspace $ws1
  263. bindsym $mod+2 workspace $ws2
  264. bindsym $mod+3 workspace $ws3
  265. bindsym $mod+4 workspace $ws4
  266. bindsym $mod+5 workspace $ws5
  267. bindsym $mod+6 workspace $ws6
  268. bindsym $mod+7 workspace $ws7
  269. bindsym $mod+8 workspace $ws8
  270. bindsym $mod+9 workspace $ws9
  271. bindsym $mod+0 workspace $ws10
  272. bindsym Mod4+1 workspace $ws11
  273. # bindsym Mod4+2 workspace $ws12
  274. # bindsym Mod4+3 workspace $ws13
  275. # bindsym Mod4+4 workspace $ws14
  276. # bindsym Mod4+5 workspace $ws15
  277. # move container to ws [[[ #
  278. bindsym $mod+control+1 move container to workspace $ws1; workspace $ws1
  279. bindsym $mod+control+2 move container to workspace $ws2; workspace $ws2
  280. bindsym $mod+control+3 move container to workspace $ws3; workspace $ws3
  281. bindsym $mod+control+4 move container to workspace $ws4; workspace $ws4
  282. bindsym $mod+control+5 move container to workspace $ws5; workspace $ws5
  283. bindsym $mod+control+6 move container to workspace $ws6; workspace $ws6
  284. bindsym $mod+control+7 move container to workspace $ws7; workspace $ws7
  285. bindsym $mod+control+8 move container to workspace $ws8; workspace $ws8
  286. bindsym $mod+control+9 move container to workspace $ws9; workspace $ws9
  287. bindsym $mod+control+0 move container to workspace $ws10; workspace $ws10
  288. bindsym $mod+Shift+1 move container to workspace $ws11; workspace $ws11
  289. bindsym $mod+Shift+2 move container to workspace $ws12; workspace $ws12
  290. bindsym $mod+Shift+3 move container to workspace $ws13; workspace $ws13
  291. bindsym $mod+Shift+4 move container to workspace $ws14; workspace $ws14
  292. bindsym $mod+Shift+5 move container to workspace $ws15; workspace $ws15
  293. # ]]] move container to ws #
  294. # ]]] ws bindings #
  295. # reload config [[[ #
  296. bindsym $mod+control+r exec i3-msg restart
  297. bindsym $mod+Shift+c reload
  298. # bindsym $mod+control+r reload
  299. bindsym $mod+control+u exec xrdb ~/.Xresources
  300. # exit i3 (logs you out of your X session)
  301. bindsym control+$mod+s exec systemctl suspend
  302. 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'"
  303. # ]]] reload config #
  304. # status bar [[[ #
  305. # bar vars [[[ #
  306. # set $sb_font Hack NF Bold
  307. # set $sb_font EmojiOne
  308. set $sb_font DejaVuSansMono Nerd Font Mono Bold
  309. set $black #000000
  310. set $white #ffffff
  311. for_window [class="Yad"] floating enable
  312. # set $inactive_ws_bg $white
  313. set $inactive_ws_bg #444c52
  314. #00ffff
  315. # set $inactive_ws_trans 96
  316. set $inactive_ws_trans 00
  317. # set $active_ws_trans 91
  318. set $active_ws_trans 4b
  319. set $focused_ws_text #ffffff
  320. # ]]] bar vars #
  321. # main bar [[[ #
  322. # set $bar_trans 64
  323. set $bar_trans 00
  324. set $main_ws_trans aa
  325. bar {
  326. i3bar_command i3bar -t
  327. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  328. font pango:$sb_font 17
  329. {{ else }}
  330. font pango:$sb_font 21
  331. {{ end }}
  332. colors {
  333. # 0 (transparent) -> 255 (opaque) in hex
  334. background $black$bar_trans
  335. # border, bg, text color
  336. # focused_workspace $inactive_ws_bg $bg $focused_ws_text
  337. focused_workspace $inactive_ws_bg $bg $fg
  338. # active = focused on other screen
  339. active_workspace $inactive_ws_bg $fg$active_ws_trans $fg
  340. inactive_workspace $inactive_ws_bg $inactive_ws_bg$inactive_ws_trans $fg
  341. }
  342. tray_output none
  343. # status_command i3blocks -c ~/.config/i3blocks/i3blocks.conf
  344. status_command 2>/tmp/i3blocks.err i3blocks -vvv -c ~/.config/i3blocks/i3blocks.conf | tee /tmp/i3blocks.out
  345. output $main
  346. wheel_up_cmd nop
  347. wheel_down_cmd nop
  348. }
  349. # ]]] main bar #
  350. # secondary bar [[[ #
  351. bar {
  352. output $secondary
  353. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  354. font pango:$sb_font 18
  355. {{ else }}
  356. font pango:$sb_font 25
  357. {{ end }}
  358. # output $main
  359. i3bar_command i3bar -t
  360. colors {
  361. background $black$bar_trans
  362. # border, bg, text color
  363. # focused_workspace $inactive_ws_bg $bg $focused_ws_text
  364. focused_workspace $inactive_ws_bg $bg $fg
  365. active_workspace $inactive_ws_bg $fg$active_ws_trans $fg
  366. inactive_workspace $inactive_ws_bg $inactive_ws_bg$inactive_ws_trans $fg
  367. }
  368. status_command i3blocks -c ~/.config/i3blocks/i3blocks-secondary.conf
  369. # status_command 2>/tmp/i3blocks-sam.err i3blocks -vvv -c ~/.config/i3blocks/sam-i3blocks.conf | tee /tmp/i3blocks-sam.out
  370. tray_output none
  371. wheel_up_cmd nop
  372. wheel_down_cmd nop
  373. }
  374. # ]]] secondary bar #
  375. # display bar [[[ #
  376. # bar {
  377. # i3bar_command i3bar -t
  378. # font pango:$sb_font 23
  379. # tray_output none
  380. # status_command i3blocks -c ~/.config/i3blocks/i3blocks-display.conf
  381. # output $secondary
  382. # wheel_up_cmd nop
  383. # wheel_down_cmd nop
  384. # }
  385. # ]]] display bar #
  386. # ]]] status bar #
  387. # media keys [[[ #
  388. # sink
  389. bindsym XF86AudioRaiseVolume exec amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks
  390. bindsym control+d exec ~/linux-config/scripts/change-sink dac
  391. # bindsym control+shift+d exec ~/linux-config/scripts/change-sink dac2
  392. bindsym control+o exec ~/linux-config/scripts/change-sink line-out
  393. # media
  394. bindsym XF86AudioLowerVolume exec amixer -q -D pulse sset Master 5%- && pkill -RTMIN+1 i3blocks
  395. bindsym XF86AudioMute exec amixer -q -D pulse sset Master toggle && pkill -RTMIN+1 i3blocks
  396. bindsym XF86AudioPlay exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
  397. bindsym XF86AudioStop exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"
  398. bindsym XF86AudioPrev exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"
  399. bindsym XF86AudioNext exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"
  400. # ]]] media keys #
  401. # vim: fdm=marker ft=i3.go-template