Skip to content

Commit 168202d

Browse files
committed
Added an exec command action handler
1 parent ed32a91 commit 168202d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

actionhandlers/exec.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package actionhandlers
2+
3+
import (
4+
streamdeck "github.com/magicmonkey/go-streamdeck"
5+
"os/exec"
6+
)
7+
8+
type ExecAction struct {
9+
Command *exec.Cmd
10+
}
11+
12+
func (action *ExecAction) Pressed(btn streamdeck.Button) {
13+
action.Command.Start()
14+
}
15+
16+
func NewExecAction(command *exec.Cmd) *ExecAction {
17+
return &ExecAction{Command: command}
18+
}

0 commit comments

Comments
 (0)