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.

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