Advertisement
mayocz

sxhkdrc

May 17th, 2024
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.58 KB | None | 0 0
  1. #
  2. # wm independent hotkeys
  3. #
  4.  
  5. # control + t; {}
  6. #       {qtile cmd-obj -o group 1 -f focus_back}
  7.  
  8.  
  9. # control + shift + p
  10. #   flameshot gui
  11.  
  12.  
  13. control + t; {Return, space, control + e}
  14.         {kitty, rofi -show drun -font "udev gothic 20", xdo activate -n  emacs }
  15.  
  16. # terminal emulator
  17. super + Return
  18.         xdo activate -n  emacs && emacsclient --eval '(my/switch-eshell)'      
  19.     # kitty
  20.  
  21. # program launcher
  22. # super + @space
  23. #   dmenu_run
  24.  
  25. # make sxhkd reload its configuration files:
  26. super + Escape
  27.     pkill -USR1 -x sxhkd
  28.  
  29. #
  30. # bspwm hotkeys
  31. #
  32.  
  33. # quit/restart bspwm
  34. super + alt + {q,r}
  35.     bspc {quit,wm -r}
  36.  
  37. # close and kill
  38. # super + {_,shift + }w
  39. #   bspc node -{c,k}
  40.  
  41. control + t; {_,shift + } k
  42.         bspc node -{c,k}
  43.  
  44. # alternate between the tiled and monocle layout
  45. # super + m
  46. #   bspc desktop -l next
  47.  
  48. control + t; m
  49.         ~/.config/bspwm/bin/bspwm-monacle
  50.     # bspc desktop -l next && bspc config -d I top_padding 0
  51.     # bspc desktop -l {next}
  52.  
  53. control + t; s
  54.         flameshot gui
  55.  
  56. control + t; control + e
  57.         xdo activate -n  emacs     
  58.  
  59. # send the newest marked node to the newest preselected node
  60. super + y
  61.     bspc node newest.marked.local -n newest.!automatic.local
  62.  
  63. # swap the current node and the biggest window
  64. super + g
  65.     bspc node -s biggest.window
  66.  
  67. #
  68. # state/flags
  69. #
  70.  
  71. # set the window state
  72. # super + {t,shift + t,s,f}
  73. #   bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
  74. # control + t + u was totally albitrary :)     
  75. control + t; {t,shift + t,u,f}
  76.     bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
  77.  
  78. # set the node flags
  79. super + ctrl + {m,x,y,z}
  80.     bspc node -g {marked,locked,sticky,private}
  81.  
  82. #
  83. # focus/swap
  84. #
  85.  
  86. # focus the node in the given direction
  87. super + {_,shift + }{h,j,k,l}
  88.     bspc node -{f,s} {west,south,north,east}
  89.  
  90. # focus the node for the given path jump
  91. # super + {p,b,comma,period}
  92. #   bspc node -f @{parent,brother,first,second}
  93.  
  94. # focus the next/previous window in the current desktop
  95. super + {_,shift + }c
  96.     bspc node -f {next,prev}.local.!hidden.window
  97. # WAIT: handle {prev}
  98. control + t; {control + t}
  99.     bspc node -f {next}.local.!hidden.window
  100.  
  101. # focus the next/previous desktop in the current monitor
  102. super + bracket{left,right}
  103.     bspc desktop -f {prev,next}.local
  104.  
  105. # focus the last node/desktop
  106. super + {grave,Tab}
  107.     bspc {node,desktop} -f last
  108.  
  109. control + t; {control + t, control + s}
  110.         bspc {node,desktop} -f last
  111.  
  112. # focus the older or newer node in the focus history
  113. # super + {o,i}
  114. #   bspc wm -h off; \
  115. #   bspc node {older,newer} -f; \
  116. #   bspc wm -h on
  117.  
  118. control + t; {o,i}
  119.     bspc wm -h off; \
  120.     bspc node {older,newer} -f; \
  121.     bspc wm -h on
  122.  
  123. # focus or send to the given desktop
  124. super + {_,shift + }{1-9,0}
  125.     bspc {desktop -f,node -d} '^{1-9,10}'
  126.  
  127. #
  128. # preselect
  129. #
  130.  
  131. # preselect the direction
  132. super + ctrl + {h,j,k,l}
  133.     bspc node -p {west,south,north,east}
  134.  
  135. # preselect the ratio
  136. super + ctrl + {1-9}
  137.     bspc node -o 0.{1-9}
  138.  
  139. # cancel the preselection for the focused node
  140. # super + ctrl + space
  141. #   bspc node -p cancel
  142.  
  143. # cancel the preselection for the focused desktop
  144. super + ctrl + shift + space
  145.     bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
  146.  
  147. #
  148. # move/resize
  149. #
  150.  
  151. # expand a window by moving one of its side outward
  152. super + alt + {h,j,k,l}
  153.     bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
  154.  
  155. # contract a window by moving one of its side inward
  156. super + alt + shift + {h,j,k,l}
  157.     bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
  158.  
  159. # move a floating window
  160. super + {Left,Down,Up,Right}
  161.     bspc node -v {-20 0,0 20,0 -20,20 0}
  162.  
  163. # super + shift + {comma,period}
  164. #   light {-U,-A} {2,2}
  165.  
  166. # super + {semicolon,colon}
  167. #   playerctl {next,previous}
  168.  
  169. # Speaker/output volume.  Requires `amixer` and dedicated keys.
  170. XF86Audio{Mute,LowerVolume,RaiseVolume}
  171.     amixer set Master {toggle,5%-,5%+}
  172.  
  173. # (define-key *top-map* (kbd "XF86AudioMute") "volume-toggle-mute")
  174.  
  175. # https://github.com/baskerville/sxhkd/issues/237
  176. mod3 + n
  177.      xdo activate -n  emacs && emacsclient --eval '(consult-notes)'
  178.  
  179. mod3 + d
  180.      xdo activate -n  emacs && emacsclient --eval '(consult-dir)'
  181.  
  182. mod3 + a
  183.      xdo activate -n  emacs && emacsclient --eval '(org-agenda nil "a")'       
  184.  
  185. mod3 + t
  186.         xdo activate -n  emacs && emacsclient --eval '(find-file today-journal)'
  187.        
  188. super + ctrl + l
  189.         sleep 1 && xset dpms force off
  190. # l
  191. # mod3; n
  192. #      xdo activate -n  emacs && emacsclient --eval '(my-consult-notes)'
  193. # (define-key *top-map* (kbd "C-s-l") "exec sleep 1 && xset dpms force off")
  194.  
  195. # xdo activate -n  emacs && emacsclient --eval '(call-interactively 'kill-ring-save)'
  196.  
  197.  
  198. mod3 + c
  199.         orgtrans
  200.     # && xdo activate -n  emacs
  201.  
  202. mod3 + s
  203.         ss.sh
  204.        
  205. control + t; c
  206.     colorpicker --short --one-shot --preview | xclip -selection clipboard
  207.  
  208.         # emacsclient --eval '(car kill-ring)'             
  209.         # emacsclient --eval '(insert "mmmmm")'
  210.  
  211. mod3 + 1
  212.         xdo activate -n Navigator && sleep 0.1 &&xdotool key alt+1
  213.         # xdo xdotool key alt+1
  214.        
  215.         # xdo activate -n Navigator && xdotool key control+o
  216.         # ~/.dotfiles/.config/bspwm/bin/firefox-focus-tab 2
  217.  
  218. mod3 + g
  219.         xdo activate -n Navigator
  220.  
  221. mod3 + a
  222.      xdo activate -n  emacs && emacsclient --eval '(org-agenda nil "a")'       
  223.  
  224. # mod3 + u
  225. #       capture_firefox.sh
  226.  
  227. # mod3 + t
  228. # control + x; control + f
  229. #       xdo activate -n  emacs && emacsclient --eval '(my/switch-eshell)'              
  230.  
  231. # Control the laptop's screen brightness (requires `xbacklight`).
  232. XF86MonBrightness{Down,Up}
  233.     xbacklight {-dec 2,-inc 2}
  234.  
  235. # control + t; control + c
  236. #       orgtrans
  237.         # toggle_osd_level;
  238.     # emacsclient --eval '(with-current-buffer (window-buffer) (insert-custom-heading))'
  239.  
  240.  
  241. control + t; control + c
  242.         ~/.config/bin/orgtrans_firefox
  243.         # sleep 0.1; xdotool key --clearmodifiers Control+c; clipboard_content=$(xclip -selection clipboard -o);emacsclient --eval "(with-current-buffer (window-buffer) (firefox-custom-heading \"$clipboard_content\"))";xdo activate -n emacs
  244.  
  245. # sleep 1 && xdo activate -n emacs && toggle_osd_level
  246.         # toggle_osd_level && sleep 0.1 && xdo activate -n emacs  
  247.         # xdo activate -n emacs
  248.         # sleep 0.1; xdotool key --clearmodifiers v && emacsclient --eval '(with-current-buffer (window-buffer) (insert-custom-heading))' && xdotool key --clearmodifiers v
  249.        
  250.         # xdo activate -n Navigator
  251.     # emacsclient --eval '(my-test)'       
  252.  
  253. control + t; control + n
  254.         sleep 1 && xset dpms force off
  255.         # xdo activate -n  mpv     
  256.  
  257. # alt + Tab;
  258. #       bspc node -f {next}.local.!hidden.window
  259.         # bspc node --focus next.local
  260.         # bspc desktop last -f
  261.         # bspc node -f last
  262.    
  263.  
  264.  
  265. ctrl + alt + l
  266.         sleep 1 && xset dpms force off
  267.  
  268. super + q
  269.         ~/check_emacs_window.sh
  270.  
  271.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement