CLI config/dotfiles
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.

348 lines
9.1 KiB

  1. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. # sxhkdrc
  3. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. # Hotkey bindings for bspwm window management and other miscillaneous functions.
  5. # Reload configureation settings with <Alt> + <Escape>.
  6. # Get names from output of `xev` and key/mouse event.
  7. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9. # Reload Settings
  10. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11. # make sxhkd reload its configuration files:
  12. alt + Escape
  13. pkill -USR1 -x sxhkd
  14. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. # Closing Things
  16. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  17. # exit bspwm
  18. super + alt + Escape
  19. xlogout
  20. # pkill -x panel; bspc quit
  21. # close the current window
  22. alt + w
  23. bspc node --close
  24. # kill the current window
  25. alt + ctrl + shift + w
  26. bspc node --kill
  27. # toggle panel
  28. alt + super + p
  29. pgrep -x bspwm-panel > /dev/null && running=yes || running=no; \
  30. if [[ "$running" == yes ]]; then; \
  31. pkill -x panel; bspc config top_padding 0; \
  32. elif [[ "$running" == no ]]; then; \
  33. bspwm-panel &; \
  34. fi
  35. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. # Window Management
  37. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. # focus/swap window in <direction>
  39. alt + {_,shift +} {h,j,k,l}
  40. bspc node --{focus,swap} {west,south,north,east}
  41. # preselect window split in <direction>
  42. alt + ctrl + {h,j,k,l}
  43. bspc node --presel-dir \~{west,south,north,east}
  44. # push window edge in <direction>
  45. alt + super + {h,j,k,l}
  46. bspc node --resize {left -10 0,bottom 0 10,top 0 -10,right 10 0}
  47. # pull window edge in <direction>
  48. alt + super + shift + {h,j,k,l}
  49. bspc node --resize {right -10 0,top 0 10,bottom 0 -10,left 10 0}
  50. # move floating window
  51. alt + super + {Left,Down,Up,Right}
  52. bpsc node --move {-10 0,0 10,0 -10,10 0}
  53. # set split of parent node
  54. alt + {1-9}
  55. bspc node @parent --ratio 0.{1-9}
  56. # send window to prev/next monitor/desktop
  57. alt + {_,ctrl +} shift + bracket{left,right}
  58. type={monitor,desktop}; \
  59. direction={prev,next}; \
  60. bspc node --to-$type $direction; \
  61. bspc $type --focus $direction
  62. # toggle window floating/fullscreen/pseudo-tiled
  63. alt + {s,f,t}
  64. bspc node --state \~{floating,fullscreen,pseudo_tiled}
  65. # force tiled window
  66. alt + shift + t
  67. bspc node --state tiled
  68. # select window backward/forward in history, preserving order
  69. alt + {o,i}
  70. bspc wm --record-history off; \
  71. bspc node --focus {older,newer}; \
  72. bspc wm --record-history on
  73. # select window backward/forward in history
  74. alt + {_,shift} + Tab
  75. bspc node --focus {prev.local.leaf,next.local.leaf}
  76. # swap window with last focused window
  77. alt + apostrophe
  78. bspc node --swap last
  79. # send window to preselection
  80. alt + Return
  81. bspc node --to-node last.\!automatic --follow
  82. # select splitting ratio of window
  83. alt + ctrl + {1-9}
  84. bspc node --presel-ratio 0.{1-9}
  85. # focus clockwise/counterclockwise window
  86. alt + {_,shift + }c
  87. bspc node --focus {next,prev}
  88. # swap with biggest window
  89. alt + shift + b
  90. bspc node --swap biggest
  91. # insert receptacle
  92. alt + r
  93. bspc node --insert-receptacle
  94. # clear receptacles on current desktop
  95. alt + shift + r
  96. for win in `bspc query -N -n .leaf.\!window.local`; do bspc node $win --kill; done
  97. # send window to receptacle on current desktop
  98. alt + super + Return
  99. bspc node --to-node `bspc query -N -n .leaf.\!window.local` --follow
  100. # move node to adjacent receptacle (this doesn't seem to work...)
  101. alt + ctrl + super + {h,j,k,l}
  102. bspc node --to-node `bspc query -N -n {west,south,north,east}`
  103. # move node to receptacle on previous/next monitor/desktop
  104. alt + {_,shift +} super + bracket{left,right}
  105. type={monitor,desktop}; \
  106. direction={prev,next}; \
  107. bspc node --to-node `bspc query -N --$type $direction -n .leaf.\!window` --follow
  108. # make fullscreen across all monitors
  109. super + alt + f
  110. bspc node --state \~floating; xdotool getactivewindow windowsize 5920 1080 windowmove 0 0
  111. #bspc node -t --state \~floating; bspc config -w focused border_width 0; xdotool getactivewindow windowsize 5920 1080 windowmove 0 0
  112. # move a floating window
  113. super + {Left,Down,Up,Right}
  114. bspc node -v {-10 0,0 10,0 -10,10 0}
  115. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  116. # Desktop Management
  117. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  118. # focus prev/next desktop
  119. alt + ctrl + bracket{left,right}
  120. bspc desktop --focus {prev,next}.local
  121. # focus prev/next desktop, all monitors
  122. alt + ctrl + {Left,Right}
  123. for i in \{1..3\}; do \
  124. direction={prev,next}; \
  125. bspc desktop --focus $direction; \
  126. bspc monitor --focus $direction; \
  127. done
  128. # flip the tree horizonally/vertically
  129. alt + {_,super +} {_,shift +} slash
  130. bspc node @{/,parent} --flip {vertical,horizontal}
  131. # select nodes (new shortcuts needed)
  132. alt + {p,b,comma,period}
  133. bspc node --focus @{parent,brother,first,second}
  134. # circulate window leaves through tree
  135. alt + {period,comma}
  136. bspc node @parent --circulate {backward,forward}
  137. # rotate tree
  138. alt + shift + {period,comma}
  139. bspc node @parent --rotate {90,270}
  140. # increase/decrease window gap size
  141. alt + {minus,equal}
  142. bspc config -d focused window_gap $((`bspc config -d focused window_gap` {+,-} 6 ))
  143. # window gap to zero
  144. alt + super + 0
  145. bspc config -d focused window_gap 0
  146. # toggle tiled/monacle layout
  147. alt + m
  148. bspc desktop -l next
  149. # balance windows to occupy equivalent area
  150. alt + b
  151. bspc node -B
  152. # reset windows rooted at node to original split ratio
  153. alt + e
  154. bspc node --equalize
  155. # focus/send window to desktop
  156. #alt + {_,shift + }{1-9,0}
  157. # bspc {desktop -f,window -d} $(bspc query -M -m)/{i,ii,iii,iv,v,vi,vii,viii,ix,x}
  158. # select previous desktop
  159. alt + grave
  160. bspc desktop --focus last
  161. # toggle the private flag to keep a node where it is (?)
  162. #alt + ctrl + p
  163. # bspc node --flag private
  164. # toggle visibility of all windows on current desktop of current monitor
  165. alt + shift + v
  166. bspc node @/ --flag hidden
  167. # toggle visibility of all windows on current desktop of all monitors
  168. alt + v
  169. for i in \{1..3\}; do \
  170. bspc monitor --focus next; \
  171. bspc node @/ --flag hidden; \
  172. done
  173. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  174. # Monitor Management
  175. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  176. # focus monitor to the left/right
  177. alt + bracket{left,right}
  178. bspc monitor --focus {prev,next}
  179. # swap monitors
  180. alt + ctrl + super + bracket{left,right}
  181. direction={prev,next}; \
  182. bspc desktop --to-monitor $direction; \
  183. bspc monitor --focus $direction; \
  184. bspc desktop --to-monitor last; \
  185. bspc desktop --focus last
  186. # add merged virtual monitor
  187. alt + ctrl + super + m
  188. bspc wm -a merge 5920x1080+0+0
  189. alt + ctrl + super + shift + m
  190. bspc monitor merge -r
  191. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  192. # mouse actions
  193. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  194. # close window under pointer (Logitech MX Master)
  195. button10
  196. bspc node pointed --close
  197. # close window under pointer (Logitech MX Master 2S)
  198. ctrl + alt + Tab
  199. bspc node pointed --close
  200. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  201. # wm independent hotkeys
  202. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  203. # open a terminal
  204. alt + backslash
  205. urxvt
  206. # run dmenu launcher
  207. alt + space
  208. dmenu_recent -x 400 -w 1120 -y 525 -h 25 -o 0.75 -dim 0.5 -s 0
  209. #XDG_CURRENT_DESKTOP=KDE dmenu_recent -x 400 -w 1120 -y 525 -h 25 -o 0.75 -dim 0.5 -s 0
  210. # volume controls
  211. XF86AudioRaiseVolume
  212. true
  213. #amixer set Speaker 1%+
  214. XF86AudioLowerVolume
  215. true
  216. #amixer set Speaker 1%-
  217. XF86AudioMute
  218. togglemute
  219. #amixer set PCM toggle
  220. #amixer set Speaker toggle
  221. XF86AudioPlay
  222. playerctl play-pause
  223. XF86AudioPrev
  224. playerctl previous
  225. XF86AudioNext
  226. playerctl next
  227. ctrl + XF86AudioPlay
  228. true
  229. ctrl + XF86AudioPrev
  230. togglewaves
  231. ctrl + XF86AudioNext
  232. toggleengage
  233. # take a screenshot
  234. Print
  235. scrot -e 'mv $f ~/Images/Screenshots/.'
  236. shift + Print
  237. scrot --focused -e 'mv $f ~/Images/Screenshots/.'
  238. alt + Print
  239. scrot --select -e 'mv $f ~/Images/Screenshots/.'
  240. # refresh background image
  241. super + b
  242. feh --bg-center --no-xinerama ~/Images/DesktopImages/current
  243. # run xbmc
  244. super + x
  245. env SDL_VIDEO_FULLSCREEN_HEAD=1 kodi
  246. # turn on tv and mirror central monitor
  247. super + {_, alt +} t
  248. xrandr --output HDMI-0 {--mode 1920x1080 --rate 60 --same-as DVI-D-0, --off}
  249. # lock screen
  250. XF86Sleep
  251. i3lock --ignore-empty-password --show-failed-attempts --image=/home/djsissom/Local/share/wallpaper/current.png
  252. # lock screen
  253. super + l
  254. i3lock --ignore-empty-password --show-failed-attempts --image=/home/djsissom/Local/share/wallpaper/current.png
  255. #i3lock --ignore-empty-password --tiling --image=/home/djsissom/Local/share/wallpaper/current.png
  256. #i3lock --ignore-empty-password --dpms --inactivity-timeout 60 --tiling --image=/home/djsissom/Images/Desktop\ Images/current.png
  257. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258. # End
  259. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~