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.

306 lines
8.2 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
  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, or clear receptacles on current desktop
  91. alt + {_,shift} + r
  92. insert={true,false}; \
  93. $insert && bspc node --insert-receptacle || \
  94. for win in `bspc query -N -n .leaf.\!window.local`; do bspc node $win --kill; done
  95. # make fullscreen across all monitors
  96. super + alt + f
  97. bspc node --state \~floating; xdotool getactivewindow windowsize 5920 1080 windowmove 0 0
  98. #bspc node -t --state \~floating; bspc config -w focused border_width 0; xdotool getactivewindow windowsize 5920 1080 windowmove 0 0
  99. # move a floating window
  100. super + {Left,Down,Up,Right}
  101. bspc node -v {-10 0,0 10,0 -10,10 0}
  102. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  103. # Desktop Management
  104. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105. # focus prev/next desktop
  106. alt + ctrl + bracket{left,right}
  107. bspc desktop --focus {prev,next}.local
  108. # focus prev/next desktop, all monitors
  109. alt + ctrl + {Left,Right}
  110. for i in \{1..3\}; do \
  111. direction={prev,next}; \
  112. bspc desktop --focus $direction; \
  113. bspc monitor --focus $direction; \
  114. done
  115. # flip the tree horizonally/vertically
  116. alt + {_,super +} {_,shift +} slash
  117. bspc node @{/,parent} --flip {vertical,horizontal}
  118. # select nodes (new shortcuts needed)
  119. alt + {p,b,comma,period}
  120. bspc node --focus @{parent,brother,first,second}
  121. # circulate window leaves through tree
  122. alt + {period,comma}
  123. bspc node @parent --circulate {backward,forward}
  124. # rotate tree
  125. alt + shift + {period,comma}
  126. bspc node @parent --rotate {90,270}
  127. # increase/decrease window gap size
  128. alt + {minus,equal}
  129. bspc config -d focused window_gap $((`bspc config -d focused window_gap` {+,-} 6 ))
  130. # window gap to zero
  131. alt + super + 0
  132. bspc config -d focused window_gap 0
  133. # toggle tiled/monacle layout
  134. alt + m
  135. bspc desktop -l next
  136. # balance windows to occupy equivalent area
  137. alt + b
  138. bspc node -B
  139. # reset windows rooted at node to original split ratio
  140. alt + e
  141. bspc node --equalize
  142. # focus/send window to desktop
  143. #alt + {_,shift + }{1-9,0}
  144. # bspc {desktop -f,window -d} $(bspc query -M -m)/{i,ii,iii,iv,v,vi,vii,viii,ix,x}
  145. # select previous desktop
  146. alt + grave
  147. bspc desktop --focus last
  148. # toggle the private flag to keep a node where it is (?)
  149. #alt + ctrl + p
  150. # bspc node --flag private
  151. # toggle visibility of all windows on current desktop of current monitor
  152. alt + shift + v
  153. bspc node @/ --flag hidden
  154. # toggle visibility of all windows on current desktop of all monitors
  155. alt + v
  156. for i in \{1..3\}; do \
  157. bspc monitor --focus next; \
  158. bspc node @/ --flag hidden; \
  159. done
  160. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  161. # Monitor Management
  162. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  163. # focus monitor to the left/right
  164. alt + bracket{left,right}
  165. bspc monitor --focus {prev,next}
  166. # swap monitors
  167. alt + ctrl + super + bracket{left,right}
  168. direction={prev,next}; \
  169. bspc desktop --to-monitor $direction; \
  170. bspc monitor --focus $direction; \
  171. bspc desktop --to-monitor last; \
  172. bspc desktop --focus last
  173. # add merged virtual monitor
  174. alt + ctrl + super + m
  175. bspc wm -a merge 5920x1080+0+0
  176. alt + ctrl + super + shift + m
  177. bspc monitor merge -r
  178. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  179. # mouse actions
  180. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181. # close window under pointer (Logitech MX Master)
  182. button10
  183. bspc node pointed --close
  184. # close window under pointer (Logitech MX Master 2S)
  185. ctrl + alt + Tab
  186. bspc node pointed --close
  187. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  188. # wm independent hotkeys
  189. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  190. # open a terminal
  191. alt + backslash
  192. urxvt
  193. # run dmenu launcher
  194. alt + space
  195. dmenu_recent -x 400 -w 1120 -y 525 -h 25 -o 0.75 -dim 0.5 -s 0
  196. #XDG_CURRENT_DESKTOP=KDE dmenu_recent -x 400 -w 1120 -y 525 -h 25 -o 0.75 -dim 0.5 -s 0
  197. # volume controls
  198. XF86AudioRaiseVolume
  199. amixer set Speaker 1%+
  200. XF86AudioLowerVolume
  201. amixer set Speaker 1%-
  202. XF86AudioMute
  203. amixer set PCM toggle
  204. #amixer set Speaker toggle
  205. # take a screenshot
  206. Print
  207. scrot -e 'mv $f ~/Images/Screenshots/.'
  208. shift + Print
  209. scrot --focused -e 'mv $f ~/Images/Screenshots/.'
  210. alt + Print
  211. scrot --select -e 'mv $f ~/Images/Screenshots/.'
  212. # refresh background image
  213. super + b
  214. feh --bg-center --no-xinerama ~/Images/DesktopImages/current
  215. # run xbmc
  216. super + x
  217. env SDL_VIDEO_FULLSCREEN_HEAD=1 kodi
  218. # turn on tv and mirror central monitor
  219. super + {_, alt +} t
  220. xrandr --output HDMI-0 {--auto --same-as DVI-D-0, --off}
  221. # lock screen
  222. super + l
  223. i3lock --ignore-empty-password --show-failed-attempts --image=/home/djsissom/Local/share/wallpaper/current.png
  224. #i3lock --ignore-empty-password --tiling --image=/home/djsissom/Local/share/wallpaper/current.png
  225. #i3lock --ignore-empty-password --dpms --inactivity-timeout 60 --tiling --image=/home/djsissom/Images/Desktop\ Images/current.png
  226. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  227. # End
  228. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~