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.

525 lines
17 KiB

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