config 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. ##### My (demuredemeanor) i3 config
  2. # Uses tabstop=4; shiftwidth=4 tabs; foldmarker={{{,}}};
  3. # https://notabug.org/demure/dotfiles/
  4. # legacy repo http://github.com/demure/dotfiles
  5. # vim: set filetype=i3config:
  6. ## Set prefix to Super
  7. set $mod Mod4
  8. # Font for window titles. Will also be used by the bar unless a different font
  9. # is used in the bar {} block below.
  10. font pango:monospace 8
  11. # This font is widely installed, provides lots of unicode glyphs, right-to-left
  12. # text rendering and scalability on retina/hidpi displays (thanks to pango).
  13. #font pango:DejaVu Sans Mono 8
  14. ## If you try to go to the same workspace you are on, jump to last workspace
  15. workspace_auto_back_and_forth yes
  16. ### Variables ### {{{
  17. set $Locker i3lock -e -c 2E3436 && sleep 1
  18. ### Workspace Names ### {{{
  19. set $ws1 1:
  20. set $ws2 2:
  21. set $ws3 3:
  22. set $ws4 4
  23. set $ws5 5
  24. set $ws6 6
  25. set $ws7 7
  26. set $ws8 8
  27. set $ws9 9
  28. set $ws10 10
  29. ### End Workspace Names ### }}}
  30. ### End Variables ### }}}
  31. ### Bindings ### {{{
  32. ### i3 Keys ### {{{
  33. ## reload the configuration file
  34. bindsym $mod+Shift+c reload
  35. ## restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
  36. bindsym $mod+Shift+r exec i3-msg restart
  37. ## exit i3 (logs you out of your X session)
  38. 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'"
  39. ### End i3 Keys ### }}}
  40. ### Workspace Bindings ### {{{
  41. ### Last Workspace ### {{{
  42. ## Move to last workspace
  43. bindsym $mod+Tab workspace back_and_forth
  44. ## Send container to last workspace
  45. bindsym $mod+Shift+Tab move container to workspace back_and_forth
  46. ### End Last Workspace ### }}}
  47. ### Switch Workspace ### {{{
  48. ## switch to workspace
  49. bindsym $mod+1 workspace $ws1
  50. bindsym $mod+2 workspace $ws2
  51. bindsym $mod+3 workspace $ws3
  52. bindsym $mod+4 workspace $ws4
  53. bindsym $mod+5 workspace $ws5
  54. bindsym $mod+6 workspace $ws6
  55. bindsym $mod+7 workspace $ws7
  56. bindsym $mod+8 workspace $ws8
  57. bindsym $mod+9 workspace $ws9
  58. bindsym $mod+0 workspace $ws10
  59. ### End Switch Workspace ### }}}
  60. ### Send Workspace ### {{{
  61. ## move focused container to workspace
  62. bindsym $mod+Shift+1 move container to workspace $ws1
  63. bindsym $mod+Shift+2 move container to workspace $ws2
  64. bindsym $mod+Shift+3 move container to workspace $ws3
  65. bindsym $mod+Shift+4 move container to workspace $ws4
  66. bindsym $mod+Shift+5 move container to workspace $ws5
  67. bindsym $mod+Shift+6 move container to workspace $ws6
  68. bindsym $mod+Shift+7 move container to workspace $ws7
  69. bindsym $mod+Shift+8 move container to workspace $ws8
  70. bindsym $mod+Shift+9 move container to workspace $ws9
  71. bindsym $mod+Shift+0 move container to workspace $ws10
  72. ### End Send Workspace ### }}}
  73. ### Move Workspace Different Monitor ### {{{
  74. ## Move the current workspace to the next output
  75. bindsym $mod+Mod1+Left move workspace to output Left
  76. bindsym $mod+Mod1+Down move workspace to output Down
  77. bindsym $mod+Mod1+Up move workspace to output Up
  78. bindsym $mod+Mod1+Right move workspace to output right
  79. ### End Move Workspace Different Monitor ### }}}
  80. ### Cycle Through Workspaces ### {{{
  81. ## Added for touchegg
  82. bindsym $mod+u workspace prev
  83. bindsym $mod+o workspace next
  84. ### End Cycle Through Workspaces ### }}}
  85. ### End Workspace Bindings ### }}}
  86. ### Window Bindings ### {{{
  87. ## kill focused window
  88. bindsym $mod+Shift+q kill
  89. ### Sticky Windows, good for picture in picture (shows floating window on all workspaces)
  90. bindsym $mod+Shift+s sticky toggle
  91. ### Split Orientation ### {{{
  92. ## split in horizontal orientation
  93. bindsym $mod+h split h
  94. ## split in vertical orientation
  95. bindsym $mod+v split v
  96. ### End Split Orientation ### }}}
  97. ### End Window Bindings ### }}}
  98. ### Focus Bindings ### {{{
  99. ## enter fullscreen mode for the focused container
  100. bindsym $mod+f fullscreen toggle
  101. ## enter fullscreen mode over all monitors
  102. bindsym $mod+Shift+f fullscreen toggle global
  103. ### Tile / Float ### {{{
  104. ## toggle tiling / floating
  105. bindsym $mod+Shift+space floating toggle
  106. ## change focus between tiling / floating windows
  107. bindsym $mod+space focus mode_toggle
  108. ### End Tile / Float ### }}}
  109. ### Change Focus ### {{{
  110. ## change focus
  111. bindsym $mod+j focus left
  112. bindsym $mod+k focus down
  113. bindsym $mod+l focus up
  114. bindsym $mod+semicolon focus right
  115. ## alternatively, you can use the cursor keys:
  116. bindsym $mod+Left focus left
  117. bindsym $mod+Down focus down
  118. bindsym $mod+Up focus up
  119. bindsym $mod+Right focus right
  120. ### End Change Focus ### }}}
  121. ### Move Focused Window ### {{{
  122. ## move focused window
  123. bindsym $mod+Shift+j move left
  124. bindsym $mod+Shift+k move down
  125. bindsym $mod+Shift+l move up
  126. bindsym $mod+Shift+semicolon move right
  127. ## alternatively, you can use the cursor keys:
  128. bindsym $mod+Shift+Left move left
  129. bindsym $mod+Shift+Down move down
  130. bindsym $mod+Shift+Up move up
  131. bindsym $mod+Shift+Right move right
  132. ### End Move Focused Window ### }}}
  133. ### Focus Urgent Workspace {{{
  134. bindsym $mod+x [urgent=latest] focus
  135. ### End Focus Urgent Workspace ###}}}
  136. ### End Focus Bindings ### }}}
  137. ### Container Bindings ### {{{
  138. ### Change Container Layout ### {{{
  139. ## change container layout (stacked, tabbed, toggle split)
  140. bindsym $mod+s layout stacking
  141. bindsym $mod+w layout tabbed
  142. bindsym $mod+e layout toggle split
  143. ### End Change Container Layout ### }}}
  144. ### Parent / Child Container ### {{{
  145. ## focus the parent container
  146. bindsym $mod+a focus parent
  147. ## focus the child container
  148. bindsym $mod+d focus child
  149. ### End Parent / Child Container ### }}}
  150. ### End Container Bindings ### }}}
  151. ### Mouse Bindings ### {{{
  152. ## Use Mouse+$mod to drag floating windows to their wanted position
  153. floating_modifier $mod
  154. ## Seems like this only works on border or title bar...
  155. #bindsym --whole-window --border button6 workspace prev
  156. #bindsym --whole-window --border button7 workspace next
  157. ## Removed --whole-window as it started working, and touchpoint scrolling affected.
  158. bindsym --border button6 workspace prev
  159. bindsym --border button7 workspace next
  160. ### End Mouse Bindings ### }}}
  161. ### Scratch Pad ### {{{
  162. ## Make the currently focused window a scratchpad
  163. bindsym $mod+Shift+minus move scratchpad
  164. ## Show the first scratchpad window
  165. bindsym $mod+minus scratchpad show
  166. ### End Scratch Pad ### }}}
  167. ### User Interface Bindings ### {{{
  168. ### Brightness Bindings ### {{{
  169. bindsym XF86MonBrightnessUp exec xbacklight -inc 5 ## Increase screen brightness
  170. bindsym Shift+XF86MonBrightnessUp exec xbacklight -inc 1 ## Fine increase screen brightness
  171. bindsym XF86MonBrightnessDown exec xbacklight -dec 5 ## Decrease screen brightness
  172. bindsym Shift+XF86MonBrightnessDown exec xbacklight -dec 1 ## Fine decrease screen brightness
  173. bindsym $mod+XF86MonBrightnessUp exec xbacklight -set 100 ## Set max screen brightness
  174. bindsym $mod+XF86MonBrightnessDown exec xbacklight -set 1 ## Set min screen brightness
  175. ### End Brightness Bindings ### }}}
  176. ### Pulse Audio Controls ### {{{
  177. ## Softvol increase possible with pactl
  178. ## NOTE: due to HDMI output connect/disconnects causing sink number changes, sink '0' is now <strike>a command substitution<strike> @DEFAULT_SINK@
  179. ## NOTE: My thinkpad usb c gen 2 dock needs something to run the following to update the default sink:
  180. ## pactl set-default-sink $(pactl list short sinks | awk '/RUNNING/ {print $1}')
  181. bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% ## Increase sound volume
  182. bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1% ## Fine increase sound volume
  183. bindsym $mod+XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ 100% ## Set volume to "100%"
  184. bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% ## Decrease sound volume
  185. bindsym Shift+XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1% ## Fine decrease sound volume
  186. bindsym $mod+XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ 50% ## Set volume to "50%"
  187. bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle ## Mute sound
  188. bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle ## Toggle default mic mute
  189. bindsym $mod+XF86AudioMicMute exec --no-startup-id pactl list short sources | awk '/input.*RUNNING/ {system("pactl set-source-mute " $1 " toggle")}' ## Find and mute mics
  190. ## push to talk
  191. bindsym $mod+z exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 0 ## Hold to talk
  192. bindsym --release $mod+z exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 1 ## Release to mute
  193. bindsym $mod+Shift+z exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 0 ## Unmute
  194. bindsym XF86PickupPhone exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 0 ## Hold to talk
  195. bindsym --release XF86PickupPhone exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 1 ## Release to mute
  196. ### End Pulse Audio ### }}}
  197. ### Toggle redshift ### {{{
  198. bindsym $mod+slash exec --no-startup-id pkill -USR1 redshift
  199. ### End Toggle redshift ### }}}
  200. ### End User Interface Bindings ### }}}
  201. ### Program Call Bindings ### {{{
  202. ### Launch Term ### {{{
  203. ## start a terminal
  204. bindsym $mod+Return exec kitty
  205. ## Backup term of urxvt
  206. bindsym $mod+Shift+Return exec urxvt
  207. ## Emergency backup term
  208. bindsym $mod++mod1+Return exec i3-sensible-terminal
  209. ### End Launch Term ### }}}
  210. ### Screen Shots ### {{{
  211. bindsym $mod+Home exec --no-startup-id exec scrot -m -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## Backup binding
  212. bindsym Print exec --no-startup-id exec scrot -m -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/'
  213. #bindsym XF86Explorer exec --no-startup-id exec scrot -m -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## x260
  214. #bindsym XF86Favorites exec --no-startup-id exec scrot -m -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## x270
  215. bindsym XF86Display exec --no-startup-id exec scrot -m -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## xnano
  216. bindsym XF86Mail exec --no-startup-id exec scrot -m -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## sofle keyboard
  217. ## Note: you need to click on the window, after key combo, to capture it.
  218. ## Note: Needs to have startup ip, as interacts with GUI
  219. bindsym $mod+Shift+Home exec --no-startup-id scrot -s -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## Backup binding
  220. bindsym Shift+Print exec --no-startup-id scrot -s -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/'
  221. #bindsym Shift+XF86Explorer exec --no-startup-id scrot -s -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## x260
  222. #bindsym Shift+XF86Favorites exec --no-startup-id scrot -s -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## x270
  223. bindsym Shift+XF86Display exec --no-startup-id scrot -s -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## xnano
  224. bindsym Shift+XF86Mail exec --no-startup-id scrot -s -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## sofle keyboard
  225. bindsym Control+XF86Mail exec --no-startup-id scrot -s -F '%Y%m%d-%H%M%S_$wx$h_screen.png' -e 'mv $f ~/temp/' ## sofle keyboard
  226. ### End Screen Shots ### }}}
  227. ### Rofi Bindings ### {{{
  228. ## Use rofi, it's better
  229. ## start dmenu (a program launcher)
  230. #bindsym $mod+d exec dmenu_run
  231. bindsym $mod+p exec rofi -show run
  232. bindsym XF86Search exec rofi -show run ## sofle keyboard
  233. ### rofi-pass binding
  234. bindsym $mod+Shift+p exec rofi-pass
  235. bindsym Shift+XF86Search exec rofi-pass ## sofle keyboard
  236. bindsym Control+XF86Search exec rofi-pass ## sofle keyboard
  237. ### End Rofi Bindings ### }}}
  238. ### External IP Toggle For i3 polybar ### {{{
  239. ## awk -v TEMP=/tmp/i3_polybar_ip_toggle_${USER} 'BEGIN {{FILE=getline < TEMP < 0 ? "0" : "1"} {if($0==1){STATE=1} else {STATE=0}} {if(STATE==0){system("echo 1 > "TEMP)} else {system("echo 0 > "TEMP)}} }'
  240. #bindsym XF86LaunchA exec awk -v TEMP=/tmp/i3_polybar_ip_toggle_${USER} 'BEGIN {{FILE=getline < TEMP < 0 ? "0" : "1"} {if($0==1){STATE=1} else {STATE=0}} {if(STATE==0){system("echo 1 > "TEMP)} else {system("echo 0 > "TEMP)}} }' ## x260
  241. #bindsym XF86Display exec awk -v TEMP=/tmp/i3_polybar_ip_toggle_${USER} 'BEGIN {{FILE=getline < TEMP < 0 ? "0" : "1"} {if($0==1){STATE=1} else {STATE=0}} {if(STATE==0){system("echo 1 > "TEMP)} else {system("echo 0 > "TEMP)}} }' ## x270
  242. ### End External IP For i3 polybar ### }}}
  243. ### Clipster Clipboard Manager ### {{{
  244. bindsym $mod+c exec clipster -sc
  245. ### End Clipster ### }}}
  246. ### End Program Call Bindings ### }}}
  247. ### Misc Bindings ### {{{
  248. ### End Misc Bindings ### }}}
  249. ### End Bindings ### }}}
  250. ### i3 Modes ### {{{
  251. ### System Control Mode ### {{{
  252. mode "system-control" {
  253. bindsym l exec --no-startup-id $Locker, mode "default"
  254. bindsym e exec --no-startup-id i3-msg exit, mode "default"
  255. bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"
  256. bindsym h exec --no-startup-id $Locker && systemctl hibernate, mode "default"
  257. bindsym r exec --no-startup-id systemctl reboot, mode "default"
  258. bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
  259. bindsym c exec --no-startup-id sudo /usr/bin/tomb close all, mode "default"
  260. bindsym Shift+c exec --no-startup-id sudo /usr/bin/tomb slam, mode "default"
  261. ## Invert screen colors
  262. bindsym i exec --no-startup-id xcalib -invert -alter, mode "default"
  263. ## Set brightness to my default of 30%
  264. bindsym b exec --no-startup-id xbacklight -set 30, mode "default"
  265. ## One minute timer, big
  266. bindsym t exec urxvt -fn xft:PragmataProMono-Regular:pixelsize=70 -e termdown -WBb -c 10 -t TIME 1m, mode "default"
  267. ## One minute timer, small
  268. bindsym Shift+t exec urxvt -e termdown -WBb -c 10 -t TIME 1m, mode "default"
  269. ## Flip screen horizontally
  270. bindsym f exec --no-startup-id xrandr -x, mode "default"
  271. ## Flip screen vertically
  272. bindsym Shift+F exec --no-startup-id xrandr -y, mode "default"
  273. ## Toggle between $TZ and UTC in polybar
  274. bindsym u exec awk -v TEMP=/tmp/i3_polybar_utc_${USER} 'BEGIN {{FILE=getline < TEMP < 0 ? "0" : "1"} {if($0==1){STATE=1} else {STATE=0}} {if(STATE==0){system("echo 1 > "TEMP)} else {system("echo 0 > "TEMP)}} }', mode "default"
  275. ## Unload gpg keys
  276. bindsym g exec --no-startup-id gpgconf --kill gpg-agent, mode "default"
  277. ## Reload polybar
  278. bindsym k exec --no-startup-id "$HOME/.config/polybar/scripts/start_polybar.sh", mode "default"
  279. ## Toggle xss-lock, used for lock on idle
  280. bindsym Shift+l exec --no-startup-id "$HOME/projects/personal/scripts/toggler.sh xss-lock", mode "default"
  281. ## Toggle screen off on idle
  282. bindsym p exec --no-startup-id "$HOME/projects/personal/scripts/toggler.sh powersave", mode "default"
  283. bindsym --release Shift+x exec "xkill", mode "default"
  284. ## back to normal: Enter or Escape
  285. bindsym Return mode "default"
  286. bindsym Escape mode "default"
  287. }
  288. bindsym $mod+Pause mode "system-control"
  289. bindsym $mod+End mode "system-control"
  290. ## x270
  291. #bindsym XF86Tools mode "system-control"
  292. ## x1nano and sofle keyboard
  293. bindsym XF86Favorites mode "system-control"
  294. ### End System Control Mode ### }}}
  295. ### App Quick Launch ### {{{
  296. ## Launch mode, one app per key.
  297. mode "quick-launch" {
  298. bindsym a exec pavucontrol ; mode "default"
  299. bindsym b exec qutebrowser ; mode "default"
  300. bindsym c exec speedcrunch ; mode "default"
  301. bindsym f exec firefox ; mode "default"
  302. ## gksudo is dead
  303. #bindsym g exec gksudo gameconqueror ; mode "default"
  304. bindsym g exec urxvt -e sudo scanmem ; mode "default"
  305. bindsym Shift+m exec --no-startup-id sudo /usr/bin/tomb open -k ~/vault.tomb.key ~/vault.tomb -g ; mode "default"
  306. ## Handles tv3 python3 version too
  307. #bindsym n exec urxvt --title terminal_velocity -e sh -c "terminal_velocity || $HOME/.local/bin/tv3" ; mode "default"
  308. bindsym n exec urxvt --title terminal_notes -e sh -c "note" ; mode "default"
  309. bindsym o exec libreoffice ; mode "default"
  310. bindsym t exec i3-sensible-terminal ; mode "default"
  311. bindsym v exec $HOME/bin/start-vpn.sh ; mode "default"
  312. bindsym w exec urxvt -e connman-ncurses ; mode "default"
  313. ## Keeping this as an example
  314. ## gnome-disks will not launch twice, gparted will. Avoid that.
  315. #bindsym d exec ((pidof gpartedbin) || gksudo gparted); exec gnome-disks ; mode "default"
  316. bindsym Return mode "default"
  317. bindsym Escape mode "default"
  318. }
  319. #bindsym $mod+Shift+g mode "quick-launch"
  320. bindsym $mod+g mode "quick-launch"
  321. ### End App Quick Launch ### }}}
  322. ### App Focus Mode ### {{{
  323. mode "app-focus" {
  324. ## hardcoded focus keybindings
  325. bindsym b [class="(?i)qutebrowser"] focus, mode "default"
  326. bindsym w [class="(?i)terminal" title="weechat"] focus, mode "default"
  327. #bindsym m [class="(?i)icedove"] focus, mode "default"
  328. #bindsym f [class="(?i)spacefm"] focus, mode "default"
  329. bindsym z [class="(?i)zathura"] focus, mode "default"
  330. ## back to normal: Enter or Escape
  331. bindsym Return mode "default"
  332. bindsym Escape mode "default"
  333. }
  334. bindsym $mod+Shift+g mode "app-focus"
  335. ### End App Focus Mode ### }}}
  336. ### Resize Window Mode ### {{{
  337. ## resize window (you can also use the mouse for that)
  338. mode "resize" {
  339. ## These bindings trigger as soon as you enter the resize mode
  340. ## They resize the border in the direction you pressed, e.g.
  341. ## when pressing left, the window is resized so that it has
  342. ## more space on its left
  343. bindsym h resize shrink left 10 px or 10 ppt
  344. bindsym j resize shrink down 10 px or 10 ppt
  345. bindsym k resize shrink up 10 px or 10 ppt
  346. bindsym l resize shrink right 10 px or 10 ppt
  347. bindsym Shift+H resize grow left 10 px or 10 ppt
  348. bindsym Shift+J resize grow down 10 px or 10 ppt
  349. bindsym Shift+K resize grow up 10 px or 10 ppt
  350. bindsym Shift+L resize grow right 10 px or 10 ppt
  351. ## Same bindings, but for the arrow keys
  352. bindsym Left resize shrink left 10 px or 10 ppt
  353. bindsym Down resize shrink down 10 px or 10 ppt
  354. bindsym Up resize shrink up 10 px or 10 ppt
  355. bindsym Right resize shrink right 10 px or 10 ppt
  356. bindsym Shift+Left resize grow left 10 px or 10 ppt
  357. bindsym Shift+Down resize grow down 10 px or 10 ppt
  358. bindsym Shift+Up resize grow up 10 px or 10 ppt
  359. bindsym Shift+Right resize grow right 10 px or 10 ppt
  360. ## Go to precise mode
  361. bindsym p mode "resize_precise"
  362. ## Back to normal: Enter or Escape
  363. bindsym Return mode "default"
  364. bindsym Escape mode "default"
  365. }
  366. ### Precise Resize ### {{{
  367. mode "resize_precise" {
  368. bindsym h resize shrink left 1 px or 1 ppt
  369. bindsym j resize shrink down 1 px or 1 ppt
  370. bindsym k resize shrink up 1 px or 1 ppt
  371. bindsym l resize shrink right 1 px or 1 ppt
  372. bindsym Shift+H resize grow left 1 px or 1 ppt
  373. bindsym Shift+J resize grow down 1 px or 1 ppt
  374. bindsym Shift+K resize grow up 1 px or 1 ppt
  375. bindsym Shift+L resize grow right 1 px or 1 ppt
  376. ## Same bindings, but for the arrow keys
  377. bindsym Left resize shrink left 1 px or 1 ppt
  378. bindsym Down resize shrink down 1 px or 1 ppt
  379. bindsym Up resize shrink up 1 px or 1 ppt
  380. bindsym Right resize shrink right 1 px or 1 ppt
  381. bindsym Shift+Left resize grow left 1 px or 1 ppt
  382. bindsym Shift+Down resize grow down 1 px or 1 ppt
  383. bindsym Shift+Up resize grow up 1 px or 1 ppt
  384. bindsym Shift+Right resize grow right 1 px or 1 ppt
  385. ## Return to normal resize
  386. bindsym p mode "resize"
  387. ## Back to normal: Enter or Escape
  388. bindsym Return mode "default"
  389. bindsym Escape mode "default"
  390. }
  391. ### End Precise Resize ### }}}
  392. bindsym $mod+r mode "resize"
  393. ### End Resize Mode ### }}}
  394. ### Control spotify via spotify-tui and spotifyd ### {{{
  395. mode "control-spotify" {
  396. bindsym p exec --no-startup-id spotify-tui playback --toggle, mode "default"
  397. bindsym l exec --no-startup-id spotify-tui playback --like, mode "default"
  398. bindsym r exec --no-startup-id spotify-tui playback --repeat, mode "default"
  399. bindsym s exec --no-startup-id spotify-tui playback --shuffle, mode "default"
  400. bindsym comma exec --no-startup-id spotify-tui playback --previous, mode "default"
  401. bindsym period exec --no-startup-id spotify-tui playback --next, mode "default"
  402. bindsym Shift+less exec --no-startup-id spotify-tui playback --previous, mode "default"
  403. bindsym Shift+greater exec --no-startup-id spotify-tui playback --next, mode "default"
  404. ## back to normal: Enter or Escape
  405. bindsym Return mode "default"
  406. bindsym Escape mode "default"
  407. }
  408. bindsym $mod+m mode "control-spotify"
  409. ### End Control spotify via spotify-tui and spotifyd ### }}}
  410. ### Control Pianobar Mode ### {{{
  411. mode "control-pianobar" {
  412. bindsym p exec --no-startup-id ~/.config/pianobar/control-pianobar.sh play, mode "default"
  413. bindsym q exec --no-startup-id ~/.config/pianobar/control-pianobar.sh quit, mode "default"
  414. bindsym h exec --no-startup-id ~/.config/pianobar/control-pianobar.sh history, mode "default"
  415. bindsym n exec --no-startup-id ~/.config/pianobar/control-pianobar.sh next, mode "default"
  416. bindsym t exec --no-startup-id ~/.config/pianobar/control-pianobar.sh tired, mode "default"
  417. bindsym s exec --no-startup-id ~/.config/pianobar/control-pianobar.sh switchstation, mode "default"
  418. bindsym \, exec --no-startup-id ~/.config/pianobar/control-pianobar.sh previousstation, mode "default"
  419. bindsym . exec --no-startup-id ~/.config/pianobar/control-pianobar.sh nextstation, mode "default"
  420. bindsym l exec --no-startup-id ~/.config/pianobar/control-pianobar.sh love, mode "default"
  421. bindsym b exec --no-startup-id ~/.config/pianobar/control-pianobar.sh ban, mode "default"
  422. bindsym e exec --no-startup-id ~/.config/pianobar/control-pianobar.sh explain, mode "default"
  423. bindsym c exec --no-startup-id ~/.config/pianobar/control-pianobar.sh current, mode "default"
  424. ## back to normal: Enter or Escape
  425. bindsym Return mode "default"
  426. bindsym Escape mode "default"
  427. }
  428. #bindsym $mod+m mode "control-pianobar"
  429. ### End Control Pianobar Mode ### }}}
  430. ### Control mpd Mode ### {{{
  431. mode "control-mpd" {
  432. bindsym space exec --no-startup-id mpc -q toggle, mode "default"
  433. bindsym p exec --no-startup-id mpc -q play, mode "default"
  434. bindsym r exec --no-startup-id mpc -q random, mode "default"
  435. bindsym s exec --no-startup-id mpc -q stop, mode "default"
  436. bindsym q exec --no-startup-id mpc -q stop, mode "default"
  437. bindsym comma exec --no-startup-id mpc -q prev, mode "default"
  438. bindsym period exec --no-startup-id mpc -q next, mode "default"
  439. bindsym Shift+less exec --no-startup-id mpc -q prev, mode "default"
  440. bindsym Shift+greater exec --no-startup-id mpc -q next, mode "default"
  441. ## back to normal: Enter or Escape
  442. bindsym Return mode "default"
  443. bindsym Escape mode "default"
  444. }
  445. bindsym $mod+Shift+m mode "control-mpd"
  446. ### End Control mpd Mode ### }}}
  447. ## xrandr mode?
  448. ### End i3 Modes ### }}}
  449. ### Window Treatments ### {{{
  450. ## (adding "(?i)" means ignore case)
  451. ### Program Floating ### {{{
  452. for_window [class="mpv|feh|Pinentry|Gnome-calculator|Pavucontrol"] floating enable
  453. for_window [title="Steam - Update*|Steam - Self Updater|Event Tester|termdown"] floating enable
  454. ## Make wicd-curses and terminal_velocity pop up bigger, and centered
  455. ## Added second criteria to reduce false positives
  456. for_window [class="URxvt"] [title="wicd-curses|connman-ncurses|terminal_notes"] floating enable, resize set width 800px height 600px, move position center
  457. for_window [class="QtPass"] floating enable, resize set width 800px height 600px, move position center
  458. ### End Program Floating ### }}}
  459. ## Full screen
  460. for_window [title="ManaPlus"] fullscreen
  461. ## Disable border
  462. for_window [class="mpv|URxvt|kitty|(?i)chromium|terminator|qutebrowser|manaplus|(?i)firefox"] border 1pixel
  463. ## Tab view
  464. for_window [class="Virt-manager"] focus child, layout tabbed, focus
  465. ## Move mpv podcast window to bottom right corner
  466. for_window [class="mpv"] [title="podcast"] move position 1550 800
  467. ### Deal with pop ups ### {{{
  468. for_window [window_role="pop-up"] floating enable
  469. for_window [window_role="task_dialog"] floating enable
  470. for_window [title="Preferences$"] floating enable
  471. ### End Popups ### }}}
  472. ### Scratchpad ### {{{
  473. #for_window [title="nvPY"] move scratchpad
  474. ### End Scratchpad ### }}}
  475. ### End Window Treatments ### }}}
  476. ### Assign Application Workspace ### {{{
  477. #assign [class="(?i)spacefm"] $ws7
  478. ### End Assign Application Workspace ### }}}
  479. ### Exec Programs ### {{{
  480. ## Start polybar
  481. exec_always --no-startup-id $HOME/.config/polybar/scripts/start_polybar.sh
  482. exec --no-startup-id [ "$(xrandr | grep -o eDP-1)" = "eDP-1" ] && xrandr --output eDP-1 --primary
  483. ## shift + numlock for mouse mode num pad, see https://linuxreviews.org/HOWTO_use_the_numeric_keyboard_keys_as_mouse_in_XOrg
  484. #exec --no-startup-id setxkbmap -option keypad:pointerkeys
  485. exec --no-startup-id [ -e $HOME/.Xmodmap ] && xmodmap $HOME/.Xmodmap
  486. ## Set pulseaudio bell sound, and set volume
  487. exec --no-startup-id pactl upload-sample ~/.config/notice_beeps/tick.ogg bell && pactl load-module module-x11-bell sample=bell && xset b 75
  488. exec --no-startup-id compton -b
  489. ## autorandr needs profiles already added
  490. exec --no-startup-id srandrd autorandr
  491. #exec --no-startup-id srandrd $HOME/projects/personal/scripts/hdmi_sound_toggle.sh
  492. #exec --no-startup-id srandrd $HOME/.config/polybar/scripts/start_polybar.sh
  493. #exec --no-startup-id srandrd $HOME/.config/conky/start_conky.sh
  494. exec --no-startup-id nitrogen --restore
  495. exec --no-startup-id xss-lock -l -- i3lock -fnec 2E3436
  496. exec --no-startup-id udiskie
  497. exec --no-startup-id redshift
  498. exec --no-startup-id syncthing -no-browser
  499. exec --no-startup-id touchegg
  500. exec --no-startup-id unclutter
  501. exec --no-startup-id clipster -d
  502. ## Note to self, removed hard coded ~/.mpd from mpd-dynamic
  503. exec --no-startup-id mpd && mpd-dynamic
  504. exec --no-startup-id sleep 120 && spotifyd
  505. #exec --no-startup-id i3-msg "workspace $ws7; exec /usr/bin/spacefm"
  506. #exec --no-startup-id i3-msg "workspace $ws3; exec qutebrowser"
  507. exec --no-startup-id i3-msg "workspace $ws1; exec kitty"
  508. exec --no-startup-id sleep 30 && pkill -USR1 redshift
  509. exec --no-startup-id sleep 15 && autorandr -c
  510. exec --no-startup-id sleep 15 && $HOME/projects/personal/scripts/hdmi_sound_toggle.sh
  511. exec --no-startup-id sleep 15 && $HOME/.config/conky/start_conky.sh
  512. ### End Exec Programs ### }}}