##---------- Keybindings for bspwm ----------##

# Terminal (alacritty)
super + ctrl + t
	/home/lildurden/.config/bspwm/bin/bspterm

# Floating terminal
super + shift + Return
	/home/lildurden/.config/bspwm/bin/bspterm -f

##---------- Rofi Launcher & Menus ----------##

# Rofi App Launcher
super + d
	sh ~/.config/bspwm/rofi/bin/launcher

# Rofi Network Menu
super + n
	networkmanager_dmenu

# Rofi Menus
super + {w,m,x,r}
	sh ~/.config/bspwm/rofi/bin/{windows,mpd,powermenu,asroot}

ctrl + alt + {s,n,t}
	sh ~/.config/bspwm/rofi/bin/{screenshot,network,themes}

##---------- Applications ----------##

# Launch Apps
ctrl + super + f
	pcmanfm

# add to tabbed container
ctrl + alt + {Left,Down,Up,Right}
    tabc attach $(bspc query -N -n) {$(bspc query -N -n west),$(bspc query -N -n south),$(bspc query -N -n north),$(bspc query -N -n east)}

# create/remove from tabbed container
super + z 
    id=$(bspc query -N -n); \
    [[ "$(tabc printclass $id)" == "tabbed" ]] \
    && tabc detach $id \
    || tabc create $id 

# toggle autoattach in tabbed container
super + shift + z 
    tabc autoattach $(bspc query -N -n) 

##---------- system ----------##

# Take a screenshot
alt + shift + 3
	scrot 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f'

alt + shift + 2
	scrot -s 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f'
	
# Take a screenshot in 5 second
alt + Print	
	scrot -d 5 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f'

# Brighness control
XF86MonBrightness{Up,Down}
        xbacklight {+5,-5}
	#backlight{-up,-down}


# Volume control
XF86Audio{RaiseVolume,LowerVolume}
        pactl set-sink-volume @DEFAULT_SINK@ {+5,-5}% && pactl set-sink-mute 0 0
	#volume{-up,-down}

XF86AudioMute
        pactl set-sink-mute @DEFAULT_SINK@ toggle
	#amixer set Master toggle
	
# Music control
XF86Audio{Next,Prev,Play,Stop}
	mpc {next,prev,toggle,stop}

##---------- Bspwm ----------##

# Lockscreen
alt + shift + l
    i3lock -c 000000 && sleep 1
    #bsplock

# Reload Keybindings
super + alt + r
	pkill -USR1 -x sxhkd

# Quit/Restart bspwm
ctrl + alt + {q,r}
	bspc {quit,wm -r}

# Close App
super + shift + q
	bspc node -c

# kill
ctrl + alt + Escape
    xkill

# Fullscreen or Monocle
super + shift + f
	bspc desktop -l next

# Fullscreen
super + f
      bspc node -t \~fullscreen

# Split horizontal, vertical or cancel
super + {h,v,q}
	bspc node -p {east,south,cancel}

# Preselect the ratio
super + ctrl + {1-9}
	bspc node -o 0.{1-9}

# Toggle beetwen floating & tiled
super + shift + space
    bspc node -t "~"{floating,tiled}

# Pseudo Tiled & tiled mode
super + {p,t}
    bspc node -t {pseudo_tiled,tiled}

# Set the node flags
super + alt + {m,x,y,z}
	bspc node -g {marked,locked,sticky,private}

# Send the window to another edge of the screen
super + {_,shift + }{Left,Down,Up,Right}
	bspc node -{f,s} {west,south,north,east}

# Change focus to next window, including floating window
alt + {_,shift + }Tab
	bspc node -f {next.local,prev.local}

# Switch workspace
ctrl + alt + {Left,Right}
	bspc desktop -f {prev.local,next.local}

# Switch to last opened workspace
super + {Tab,grave}
	bspc {node,desktop} -f last

# Send focused window to another workspace
super + {_,shift + }{1-9}
	bspc {desktop -f,node -d} '^{1-9}'

super + {_,shift + }{0}
	bspc {desktop -f,node -d} '^{10}'

# Expanding windows
super + control + {Left,Right,Up,Down}
	bspc node -z {left -20 0,right 20 0,top 0 -20,bottom 0 20}
	
## Shrinking windows
super + alt + {Left,Right,Up,Down}
	bspc node -z {left 20 0,right -20 0,top 0 20,bottom 0 -20}
	
## Move floating windows
alt + shift + {Left,Down,Up,Right}
	bspc node -v {-20 0,0 20,0 -20,20 0}

# Hide/Unhide Window
super + shift + i
	/home/lildurden/.config/bspwm/bin/winmask		

# start browser
ctrl + super + w
	firefox	

# start browser
ctrl + super + m
	/usr/bin/thunderbird	

##---------- EOF ----------##
