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.

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