func (m Map) Set(btn bar.Button, handler func(bar.Event)) Map {
	m[btn] = handler
	return m
}
Set sets the click handler for a button, and returns the map for chaining.
package click  
import (
	"os/exec"
	"barista.run/bar"
)
func DiscardEvent(fn func()) func(bar.Event) {
	return func(bar.Event) { fn() }
}
func Click(do func(), includeBackAndForward ...bool) func(bar.Event) {
	btns := []bar.Button{bar.ButtonLeft, bar.ButtonMiddle, bar.ButtonRight}
	if len(includeBackAndForward) > 0 && includeBackAndForward[0] {
		btns = append(btns, bar.ButtonBack, bar.ButtonForward)
	}
	return Button(func(bar.Button) { do() }, btns...)
}
func Scroll(do func(bar.Button)) func(bar.Event) {
	return Button(do,
		bar.ScrollUp, bar.ScrollDown, bar.ScrollLeft, bar.ScrollRight)
}
func Button(do func(bar.Button), btns ...bar.Button) func(bar.Event) {
	return ButtonE(func(e bar.Event) { do(e.Button) }, btns...)
}
func ButtonE(handler func(bar.Event), btns ...bar.Button) func(bar.Event) {
	btnMap := map[bar.Button]bool{}
	for _, b := range btns {
		btnMap[b] = true
	}
	return func(e bar.Event) {
		if btnMap[e.Button] {
			handler(e)
		}
	}
}
func RunLeft(cmd string, args ...string) func(bar.Event) {
	return Left(func() {
		exec.Command(cmd, args...).Run()
	})
}
const fallbackButton = bar.Button(-1)
type Map map[bar.Button]func(bar.Event)
func (m Map) Handle(e bar.Event) {
	if handler, ok := m[e.Button]; ok {
		handler(e)
	} else if fallback, ok := m[fallbackButton]; ok {
		fallback(e)
	}
}