From f661b7a9b1ee17339b7e19949893b85672574b27 Mon Sep 17 00:00:00 2001 From: chenhongtao Date: Fri, 26 Jan 2024 16:29:11 +0800 Subject: [PATCH] Revert the commit "fix: keybinding cmd split error" This reverts commit b6a01e5dfad16e17446090c0281edab0a1a90391. --- debian/changelog | 6 ++++++ keybinding/manager.go | 11 ++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 036758c3b..09572aceb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dde-daemon (6.0.34) unstable; urgency=medium + + * revert fix for keybinding for linglong + + -- chenhongtao Fri, 26 Jan 2024 16:31:11 +0800 + dde-daemon (6.0.33) unstable; urgency=medium * fix: keybinding cmd split error diff --git a/keybinding/manager.go b/keybinding/manager.go index c9e6f8313..de86c6aa5 100644 --- a/keybinding/manager.go +++ b/keybinding/manager.go @@ -5,9 +5,9 @@ package keybinding import ( - "fmt" "os" "os/exec" + "path" "path/filepath" "strings" "time" @@ -1139,14 +1139,7 @@ func (m *Manager) execCmd(cmd string, viaStartdde bool) error { if m.useNewAppManager { desktopExt := ".desktop" - splitStr := strings.Split(cmd, " ") - if len(splitStr) == 0 { - err := fmt.Errorf("invalid command: %s", splitStr) - return err - } - - name := splitStr[len(splitStr)-1] - + name := strings.TrimSuffix(filepath.Base(cmd), path.Ext(cmd)) desktopFileName := "daemon-keybinding-" + name + desktopExt _, err := os.Stat(basedir.GetUserDataDir() + "/applications/" + desktopFileName)