##################################
# STARTING CONFIGURATION
##################################

# alterning workspace between each screen
workspace 1 output DVI-I-1
workspace 2 output HDMI-1
workspace 3 output DVI-I-1
workspace 4 output HDMI-1
workspace 5 output DVI-I-1
workspace 6 output DVI-I-1
workspace 7 output DVI-I-1
workspace 8 output DVI-I-1
workspace 9 output DVI-I-1

# ALSA key binding
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym Shift+XF86AudioPrev exec --no-startup-id playerctl position 3-
bindsym Shift+XF86AudioNext exec --no-startup-id playerctl position 3+

##################################
# PROGRAMS STARTED AUTOMATICALLY
##################################

# cadence will take care of all we need :
# - Config tells Cadence to start LADISH, export MIDI hw and start A2J ;
# - LADISH implies JACK starts, then it will starts needed apps (e.g. Non-Mixer)
exec --no-startup-id cadence-session-start --start
exec --no-startup-id catia

# automate port mapping for applications
exec --no-startup-id jack-matchmaker -p ~/.config/jack-matchmaker/patterns

# Start ALSA/Jack bridge for RODE mic
exec_always --no-startup-id zita-a2j -d hw:Mini -j Rode -c 1

##################################
# BINDINGS FOR STARTING PROGRAMS
##################################

bindsym $mod+b exec --no-startup-id ~/.config/i3/scripts/brightness.sh

# auto-connect to available and trusted bluetooth devices
# bound to a special button of my mouse that's the trick
bindsym Pause exec --no-startup-id bluetooth-autoconnect

##################################
# BINDINGS FOR STANDARD OPERATIONS
##################################

##################################
# OPERATIONS FOR SPECIFIC WINDOWS
##################################

# Scratchpad
for_window [class="Catia*"] mark "jack", move scratchpad
bindsym $mod+Shift+j [con_mark="jack"] scratchpad show, move position center
for_window [class="Pianoteq STAGE"] floating enable, move position center
assign [class="Pianoteq STAGE"] → number 6