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.

522 lines
17 KiB

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