~/.config/sxhkd/sxhkdrc file
#
# wm independent hotkeys
#
# terminal emulator
alt + Return
gnome-terminal
# program launcher
alt + space
dmenu_run
# make sxhkd reload its configuration files:
alt + Escape
pkill -USR1 -x sxhkd
#
# bspwm hotkeys
#
# quit bspwm normally
alt + shift + Escape
bspc quit
# close and kill
alt + {_,shift + }w
bspc node -{c,k}
# alternate between the tiled and monocle layout
alt + m
bspc desktop -l next
# if the current node is automatic, send it to the last manual, otherwise pull the last leaf
#alt + y
# bspc query -N -n focused.automatic && bspc node -n last.!automatic || bspc node last.leaf -n focused
# swap the current node and the biggest node
alt + g
bspc node -s biggest
#
# state/flags
#
# set the window state
#alt + {t,shift + t,s,f}
# bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
#alt + ctrl + {x,y,z}
# bspc node -g {locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
#alt + {_,shift + }{h,j,k,l}
# bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
#alt + {p,b,comma,period}
#bspc node -f @{parent,brother,first,second}
alt + {comma,period}
bspc desktop -C {backward,forward}
alt + shift + {comma, period}
bspc desktop -F {vertical,horizontal}
# focus the next/previous node
alt + {_,shift + }c
bspc node -f {next,prev}
# focus the next/previous desktop
#alt + bracket{left,right}
# bspc desktop -f {prev,next}
# focus the last node/desktop
#alt + {grave,Tab}
# bspc {node,desktop} -f last
# focus the older or newer node in the focus history
#alt + {o,i}
# bspc wm -h off; \
# bspc node {older,newer} -f; \
# bspc wm -h on
# focus or send to the given desktop
alt + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
#
# preselect
#
# preselect the direction
alt + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
alt + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
alt + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
alt + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# expand a window by moving one of its side outward
alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
#bspc window -e {left -10,down +10,up -10,right +10}
# contract a window by moving one of its side inward
alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
#bspc window -e {right -10,up +10,down -10,left +10}
# Mouse binding
~button1
bspc pointer -g focus
alt + button{1-3}
bspc pointer -g {move, resize_side,resize_corner}
# move a floating window
#alt + {Left,Down,Up,Right}
#bspc node -v {-20 0,0 20,0 -20,20 0}
~/.config/bspwm/bspwmrc
#! /bin/sh sxhkd & bspc config border_width 1 bspc config window_gap 2 bspc config split_ratio 0.52 bspc config borderless_monocle true bspc config gapless_monocle true bspc config focus_by_distance true bspc config focus_follows_pointer true bspc monitor -d I II III IV V #bspc monitor VGA-1 -d I II III IV V #bspc monitor DVI-I-1 -d VI VII VIII IX X #hsetroot -fill /home/xzhang/tmp/desktop.jpg bspc rule -a Gimp desktop='^8' state=floating follow=on bspc rule -a Chromium desktop='^2' bspc rule -a mplayer2 state=floating bspc rule -a Kupfer.py focus=on bspc rule -a Screenkey manage=off # panel &

