# {{@@ header() @@}}
#  _____      ____ _ _   _
# / __\ \ /\ / / _` | | | |
# \__ \\ V  V / (_| | |_| |
# |___/ \_/\_/ \__,_|\__, |
#                    |___/

set $dexec mode default;exec

###############################################################
# Music
###############################################################

bindsym --locked $mod+m mode Music
mode Music bindsym {

    d $dexec musmenu delete
    f $dexec musmenu search
    a $dexec dzadd
    s $dexec pulse-sink

    Shift+y $dexec musmenu yank

    Ctrl+a $dexec musmenu padd
    Ctrl+c   exec musmenu pclear
    Ctrl+s $dexec musmenu psave
    Ctrl+o $dexec musmenu pload
    Ctrl+d $dexec musmenu pdelete

    --locked {
        --to-code {
            $tabL  exec volumesh -d 10
            $tabR  exec volumesh -i 10

            $Right exec mpc next
            $Left  exec mpc prev
            $Up    exec volumesh --mpd -i 10
            $Down  exec volumesh --mpd -d 10
            Shift+$Right exec mpc seek +10
            Shift+$Left  exec mpc seek -10
        }


        m       exec   volumesh -t
        Shift+u $dexec mpc add / && mpdDup && notify-send "update playlist"
        Shift+l $dexec terminal clyrics -p

        space $dexec mpc toggle
        p     mode Playerctl

        escape mode default
        q      mode default

    }

}

mode Playerctl bindsym --locked {

    --to-code {
        $tabL  exec volumesh -d 10
        $tabR  exec volumesh -i 10

        $Right exec playerctl next
        $Left  exec playerctl previous
        $Up    exec playerctl volume +10
        $Down  exec playerctl volume -10
    }

    p     mode Music
    space $dexec playerctl play-pause

    escape mode default
    q      mode default
}


###############################################################
# Passthrough
###############################################################

mode Passthrough {
    bindsym $mod+escape mode default;exec notify-send "Passthrough off"
}
bindsym $mod+escape mode Passthrough;exec notify-send "Passthrough on"

# vim: ft=i3
