#+TITLE: Simple X Hotkey Daemon :DRAWER: #+PROPERTY: header-args :comments no #+PROPERTY: header-args+ :mkdirp yes #+PROPERTY: header-args+ :tangle ~/.config/sxhkd/sxhkdrc :END: * Basic #+begin_src conf super + ctrl + x xkill #+end_src #+begin_src conf # make sxhkd reload its configuration files: super + Escape pkill -USR1 -x sxhkd # Update Polybar super + r $HOME/.config/polybar/scripts/launch.sh #+end_src * Start Applications #+begin_src conf # Start program launcher super + d rofi -show run # Launch categorized menu super + shift + d rofi -show drun # Start Sound Manager super + shift + s pavucontrol # Start Bluetooth Manager super + shift + b blueman-manager # Windows Switch super + shift + w rofi -show window # Bookmarks super + shift + f $HOME/bin/bukurun # Passwords super + shift + p rofi-pass #+end_src #+begin_src conf # Start Terminal super + Return termite # Tmux Terminal super + shift + Return termite -e 'tmux' # Start Command line Calendar super + shift + c termite -e "khal interactive" # File Manager super + o alacritty -e "ranger" # Browser super + i qutebrowser #+end_src * Multimedia keys ** Sound #+begin_src conf XF86AudioMute amixer -D pulse sset Master toggle XF86AudioRaiseVolume amixer -D pulse sset Master 2%+ XF86AudioLowerVolume amixer -D pulse sset Master 2%- #+end_src ** Backlight #+begin_src conf XF86MonBrightnessUp xbacklight -inc 10 XF86MonBrightnessDown xbacklight -dec 10 #+end_src ** Change Tracks #+begin_src conf super + period mpc toggle super + {greater,less} mpc {next,prev} #+end_src #+begin_src conf XF86AudioPlay mpc toggle XF86AudioNext mpc next XF86AudioPrev mpc prev #+end_src ** Print Screen #+begin_src conf Print ~/bin/screenshot XF86Display rofi -show window #+end_src ** Other #+begin_src conf XF86Search rofi -show run #+end_src * Set shut down, restart and locking features #+begin_src conf XF86PowerOff $HOME/scripts/quit.sh super + 0 $HOME/scripts/quit.sh #+end_src * Command Mode #+begin_src conf # Command line Calendar Client (khal) super + space ; c termite -e "khal interactive" # GUI Calendar (Google Calendar) super + space ; shift + c qutebrowser https://calendar.google.com/ # Ranger super + space ; r alacritty -e "ranger" # pcmanfm: GUI file manager super + space ; shift + r pcmanfm; # Mails with neomutt super + space ; m termite -e "tmux -L neomutt attach" super + space ; shift + m termite -e "neomutt -R" # Weechat super + space ; w termite -e "tmux -L weechat attach" # News with newsboat super + space ; n termite -e "tmux -L newsboat attach" # Music with ncmpcpp super + space ; p termite -e "tmux -L ncmpcpp attach" # Print Screen super + space ; shift + p ~/bin/screenshot # Browser with qutebrowser super + space ; i qutebrowser; # Browser with firefox super + space ; shift + i firefox; # Emacs Client super + space ; e emacsclient -create-frame --alternate-editor="" # Full Emacs - Usefull when installing packages super + space ; shift + e emacs; #+end_src * Change Keyboard Layout #+begin_src conf super + ctrl + d setxkbmap -layout us -variant intl -option caps:escape super + shift + d setxkbmap -layout us -option caps:escape #+end_src * BSPWM related :PROPERTIES: :header-args:conf+: :tangle ~/.config/sxhkd/sxhkdrc.bspwm :END: ** BSPWM hotkeys #+begin_src conf # quit/restart bspwm super + alt + {q,r} bspc {quit,wm -r} # close and kill super + {_,shift + }q bspc node -{c,k} #+end_src ** Monocle Layout #+begin_src conf # alternate between the tiled and monocle layout super + f bspc desktop -l next # focus the next/previous node in the current desktop super + c bspc node -f next.local #+end_src ** Set the window State #+begin_src conf # set the window state super + {t,s, shift + f} bspc node -t {tiled,floating,fullscreen} #+end_src ** Sticky Window #+begin_src conf # set the node flags super + ctrl + y bspc node -g sticky #+end_src ** focus/swap #+begin_src conf # Focus/swap the node in the given direction super + {_,shift + }{h,j,k,l} bspc node -{f,s} {west,south,north,east} # focus the last Node super + Tab bspc node -f last # Swap to the last Desktop super + shift + b bspc node -s last #+end_src #+begin_src conf # Focus the next/previous desktop in the current monitor super + {p,n} bspc desktop -f {prev,next}.local # focus the last Desktop super + b bspc desktop -f last # focus or send to the given desktop super + {_,ctrl + }{1-9} bspc {desktop -f,node -d} '^{1-9}' # Send and Focus to the given desktop super + shift + {1-9} bspc node -d '^{1-9}' --follow #+end_src ** Preselect #+begin_src conf # preselect the direction super + ctrl + {h,j,k,l} bspc node -p {west,south,north,east} # preselect the ratio # super + ctrl + {1-9} # bspc node -o 0.{1-9} # cancel the preselection for the focused node super + ctrl + space bspc node -p cancel #+end_src ** Resize #+begin_src conf # expand a window by moving one of its side outward super + alt + {h,j,k,l} bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} # contract a window by moving one of its side inward super + alt + shift + {h,j,k,l} bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} #+end_src #+begin_src conf # move a floating window super + {Left,Down,Up,Right} bspc node -v {-20 0,0 20,0 -20,20 0} #+end_src * I3 related :PROPERTIES: :header-args:conf+: :tangle ~/.config/sxhkd/sxhkdrc.i3 :END: ** BSPWM hotkeys #+begin_src conf # quit/restart bspwm super + alt + {q,r} i3-msg {quit,restart} # close and kill super + {_,shift + }q i3-msg {kill,kill} #+end_src ** Monocle Layout #+begin_src conf # alternate between the tiled and monocle layout super + f i3-msg layout toggle tabbed split # focus the next/previous node in the current desktop # super + c # bspc node -f next.local #+end_src ** Set the window State #+begin_src conf # set the window state super + {t,s, shift + f} i3-msg {fullscreen disavle,floating toggle,fullscreen toggle} #+end_src ** Sticky Window #+begin_src conf super + ctrl + y i3-msg sticky toggle #+end_src ** focus/swap #+begin_src conf # Focus/swap the node in the given direction super + {_,shift + }{h,j,k,l} i3-msg {focus,move} {left,down,up,right} # focus the last Node # super + Tab # bspc node -f last # Swap to the last Desktop # super + shift + b # bspc node -s last #+end_src #+begin_src conf # Focus the next/previous desktop in the current monitor super + {p,n} i3-msg workspace {prev,next} # focus the last Desktop super + b i3-msg workspace back_and_forth # focus or send to the given desktop super + {1-9} i3-msg workspace '{1-9}' super + ctrl + {1-9} i3-msg move container to workspace '{1-9}' super + shift + {1-9} WP={1-9} && i3-msg move container to workspace $WP && i3-msg workspace $WP #+end_src ** Change focus between tiling / floating windows #+begin_src conf super + a i3-msg focus mode_toggle #+end_src ** Preselect Preselect the direction #+begin_src conf super + ctrl + {h,j,k,l} i3-msg split {h,v,v,h} #+end_src ** Resize Expand/Shrink a window #+begin_src conf super + alt + h i3-msg resize shrink width 10 px or 10 ppt super + alt + j i3-msg resize grow height 10 px or 10 ppt super + alt + k i3-msg resize shrink height 10 px or 10 ppt super + alt + l i3-msg resize grow width 10 px or 10 ppt #+end_src