config 27 KB

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