#  ╔═╗═╗ ╦╦ ╦╦╔═╔╦╗╦═╗╔═╗  
#  ╚═╗╔╩╦╝╠═╣╠╩╗ ║║╠╦╝║    
#  ╚═╝╩ ╚═╩ ╩╩ ╩═╩╝╩╚═╚═╝  
#			

# Show keybindings help
alt + F1
	KeybindingsHelp
	
# Open Terminal (alacritty)
super + Return
	OpenApps --terminal
	
# Open floating Terminal
super + shift + Return
	OpenApps --floating

# Menu aplicaciones
super + d
	OpenApps --menu

# Scratchpad
super + alt + o
	tdrop -a -w 70% -h 35% -y 0 -x 15%  --class scratch alacritty --class=scratch

# Power off, Reboot, Log out, Lockscreen
ctrl + shift + alt + {p,r,q,l}
	{systemctl poweroff, systemctl reboot,bspc quit,lockscreen}

# jgmenu
~button3
  xqp 0 $(xdo id -N Bspwm -n root) && jgmenu --csv-file=~/.config/bspwm/scripts/menu.txt --config-file=~/.config/bspwm/jgmenurc


# Apps
alt + {f,g,e,p,w,r,t,s,v,m}
	{firefox, \
	 geany, \
	 thunar, \
	 pavucontrol, \
	 whatsapp-nativefier --disable-gpu, \
	 OpenApps --ranger, \
	 telegram-desktop, \
	 env LD_PRELOAD=/usr/lib/spotify-adblock.so spotify --disable-gpu --no-zygote %U, \
	 OpenApps --nvim, \
	 OpenApps --music}

# Hide/Show Bar (Polybar and/or eww)
#super + {h,u}
#	HideBar {-h,-u}

# Change transparency on focused window
ctrl + alt + {plus,minus,t}
	{picom-trans -c -o +3, picom-trans -c -o -1, picom-trans -c -d}

# Screenshot Now
Print
	ScreenShoTer --now

# Screenshot Select
super + z
	ScreenShoTer --sel

# Screenshot in 10s
shift + Print
	ScreenShoTer --in10

# Screenshot active window
ctrl + Print
	ScreenShoTer --active

# Reload sxhkd
super + Escape
	pkill -USR1 -x sxhkd; dunstify -u low -i ~/.config/bspwm/assets/reload.svg 'sxhkd' 'The configuration file has been reloaded successfully!'

# Random wallpaper
shift + alt + w
	feh -z --no-fehbg --bg-fill ~/.config/bspwm/karla/walls/

#
# bspwm hotkeys
#

# Reload BSPWM
shift + alt + r
	bspc wm -r

# close and kill
super + {_,shift + }c
	bspc node -{c,k}

# kill window
alt + F4
    xkill

####

# rotate desktop
super + r
	bspc node @/ --rotate {90,-90}

# Circulate the leaves of the tree
super + c
	bspc node @/ --circulate {backward,forward}

# Make split ratios equal
super + equal
	bspc node @/ --equalize

# Make split ratios balanced
super + minus
	bspc node @/ --balance

# alternate between the tiled and monocle layout
super + m
	bspc desktop -l next

# swap the current node and the biggest node
super + g
	bspc node -s biggest

# set the window state
super + {t,shift + t,s,f}
	bspc node -t {tiled,pseudo_tiled,floating,fullscreen}

# set the node flags
ctrl + alt + {m,x,s,p,i}
	bspc node -g {marked,locked,sticky,private,hidden}

# Focused desktop window gaps scroll
shift + alt + {1,2}
	bspc config -d focused window_gap $((`bspc config -d focused window_gap` {-,+} 2 ))

# Global window gaps scroll
ctrl + alt + {1,2}
	bspc config window_gap $(( $(bspc config window_gap) {-,+} 2 ))

# focus the node in the given direction
super + {_,shift + }{Left,Down,Up,Right}
	bspc node -{f,s} {west,south,north,east}

# focus the node for the given path jump
super + {Left,Down,Up,Right
	bspc node -f @{parent,brother,first,second}

# focus the next/previous node in the current desktop
shift + alt + {q,e}
	bspc node -f {next,prev}.local

# focus the next/previous desktop in the current monitor
shift + alt + {a,d}
	bspc desktop -f {prev,next}.local

# focus the last node/desktop
super + {grave,Tab}
	bspc {node,desktop} -f last

# focus the older or newer node in the focus history
super + {o,i}
	bspc wm -h off; \
	bspc node {older,newer} -f; \
	bspc wm -h on

# focus or send to the given desktop
super + {_,shift + }{1-9,0}
	bspc {desktop -f,node -d} '^{1-9,10}'

#
# preselect
#

# preselect the direction
super + ctrl + {Left,Down,Up,Right}
	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
Escape
	bspc node -p cancel

# cancel the preselection for the focused desktop
super + Escape
	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
super + alt + {Right,Up,Down,Left}
	bspc node -z {left -10 0,bottom 0 10,top 0 -10,right 10 0}

# contract a window by moving one of its side inward
super + alt + shift + {Right,Up,Down,Left}
	bspc node -z {right -10 0,top 0 10,bottom 0 -10,left 10 0}

# move a floating window
alt + shift + {Left,Down,Up,Right}
	bspc node -v {-10 0,0 10,0 -10,10 0}

# Manage brightness
XF86MonBrightness{Up,Down}
    sh Brightness {up,down}

# Volume control
XF86Audio{RaiseVolume,LowerVolume,Mute}
	Volume{ --inc, --dec, --toggle}

# Music Control
XF86Audio{Next,Prev,Play,Stop}
	MediaControl {--next,--previous,--toggle,--stop}
