We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6649ed7 commit b6a01e5Copy full SHA for b6a01e5
1 file changed
keybinding/manager.go
@@ -5,9 +5,9 @@
5
package keybinding
6
7
import (
8
+ "fmt"
9
"os"
10
"os/exec"
- "path"
11
"path/filepath"
12
"strings"
13
"time"
@@ -1139,7 +1139,14 @@ func (m *Manager) execCmd(cmd string, viaStartdde bool) error {
1139
1140
if m.useNewAppManager {
1141
desktopExt := ".desktop"
1142
- name := strings.TrimSuffix(filepath.Base(cmd), path.Ext(cmd))
+ splitStr := strings.Split(cmd, " ")
1143
+ if len(splitStr) == 0 {
1144
+ err := fmt.Errorf("invalid command: %s", splitStr)
1145
+ return err
1146
+ }
1147
+
1148
+ name := splitStr[len(splitStr)-1]
1149
1150
desktopFileName := "daemon-keybinding-" + name + desktopExt
1151
1152
_, err := os.Stat(basedir.GetUserDataDir() + "/applications/" + desktopFileName)
0 commit comments