Make launchProgram only respond to left-button mouse clicks

Signed-off-by: AKP <tom@tdpain.net>
This commit is contained in:
akp 2022-11-02 09:20:54 +00:00
parent ff63987689
commit b65a148b60
No known key found for this signature in database
GPG key ID: AA5726202C8879B7

View file

@ -33,6 +33,10 @@ func (g *LaunchProgram) GetNameAndInstance() (string, string) {
}
func (g *LaunchProgram) OnClick(event *i3bar.ClickEvent) bool {
if event.Button != i3bar.LeftMouseButton {
return false
}
process, err := os.StartProcess(g.Executable, []string{g.Executable}, &os.ProcAttr{Files: []*os.File{os.Stdin, os.Stdout, os.Stderr}})
if err != nil {
log.Error().Err(err).Str("location", "launchProgram_onClick").Msg("Could not start process")