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.

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