depot/third_party/nixpkgs/pkgs/desktops/deepin/go-package/startdde/0001-avoid-use-hardcode-path.patch
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

61 lines
1.7 KiB
Diff

diff --git a/misc/auto_launch/chinese.json b/misc/auto_launch/chinese.json
index 14b8bff..2b2c412 100644
--- a/misc/auto_launch/chinese.json
+++ b/misc/auto_launch/chinese.json
@@ -3,7 +3,7 @@
"Priority": 9,
"Group": [
{
- "Command": "/usr/bin/dde-file-manager",
+ "Command": "dde-file-manager",
"Wait": false,
"Args": [
"-d"
@@ -25,7 +25,7 @@
"Priority": 7,
"Group": [
{
- "Command": "/usr/bin/dde-shutdown",
+ "Command": "dde-shutdown",
"Wait": false,
"Args": [
"-d"
diff --git a/session.go b/session.go
index da76626..bf9a2c4 100644
--- a/session.go
+++ b/session.go
@@ -14,6 +14,7 @@ import (
"sync"
"syscall"
"time"
+ "strings"
"github.com/adrg/xdg"
"github.com/godbus/dbus/v5"
@@ -85,7 +86,7 @@ type SessionManager struct {
}
const (
- cmdShutdown = "/usr/bin/dde-shutdown"
+ cmdShutdown = "dde-shutdown"
lockFrontDest = "org.deepin.dde.LockFront1"
lockFrontIfc = lockFrontDest
lockFrontObjPath = "/org/deepin/dde/LockFront1"
@@ -458,7 +459,7 @@ func (m *SessionManager) SetLocked(sender dbus.Sender, value bool) *dbus.Error {
return dbusutil.ToError(err)
}
- if exe == "/usr/bin/dde-lock" {
+ if strings.Contains(exe, "dde-lock") {
m.setLocked(value)
return nil
}
@@ -478,7 +479,7 @@ func (m *SessionManager) SetLocked(sender dbus.Sender, value bool) *dbus.Error {
return dbusutil.ToError(fmt.Errorf("desktop file %q is invalid", desktopFile))
}
exe = info.GetExecutable()
- if exe != "/usr/bin/dde-lock" {
+ if strings.Contains(exe, "dde-lock") {
return dbusutil.ToError(fmt.Errorf("exe %q of desktop file %q is invalid", exe, desktopFile))
}