-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
698 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
pkgs/desktops/deepin/go-package/dde-daemon/0001-fix-wrapped-name-for-verifyExe.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/dock/process_info.go b/dock/process_info.go | ||
index 83c61d58..e2970f3a 100644 | ||
--- a/dock/process_info.go | ||
+++ b/dock/process_info.go | ||
@@ -119,6 +119,16 @@ func verifyExe(exe, cwd, firstArg string) bool { | ||
return false | ||
} | ||
logger.Debugf("firstArgPath: %q", firstArgPath) | ||
+ if exe == firstArgPath { | ||
+ return true | ||
+ } | ||
+ if strings.HasSuffix(exe, "-wrapped") { | ||
+ exeBase := filepath.Base(exe) | ||
+ if (len(exeBase) <= 9) { | ||
+ return false | ||
+ } | ||
+ exe = exe[0:len(exe)-len(exeBase)] + exeBase[1:len(exeBase)-8] | ||
+ } | ||
return exe == firstArgPath | ||
} | ||
|
27 changes: 27 additions & 0 deletions
27
pkgs/desktops/deepin/go-package/dde-daemon/0002-dont-set-PATH.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/bin/dde-system-daemon/main.go b/bin/dde-system-daemon/main.go | ||
index e39fa46b..95461df1 100644 | ||
--- a/bin/dde-system-daemon/main.go | ||
+++ b/bin/dde-system-daemon/main.go | ||
@@ -78,10 +78,6 @@ func main() { | ||
// fix no PATH when was launched by dbus | ||
if os.Getenv("PATH") == "" { | ||
logger.Warning("No PATH found, manual special") | ||
- err = os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin") | ||
- if err != nil { | ||
- logger.Warning(err) | ||
- } | ||
} | ||
|
||
// 系统级服务,无需设置LANG和LANGUAGE,保证翻译不受到影响 | ||
diff --git a/grub2/modify_manger.go b/grub2/modify_manger.go | ||
index a811770b..30e9561e 100644 | ||
--- a/grub2/modify_manger.go | ||
+++ b/grub2/modify_manger.go | ||
@@ -21,7 +21,6 @@ const ( | ||
) | ||
|
||
func init() { | ||
- _ = os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin") | ||
} | ||
|
||
type modifyManager struct { |
101 changes: 101 additions & 0 deletions
101
pkgs/desktops/deepin/go-package/dde-daemon/0003-search-in-XDG-directories.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
diff --git a/accounts/user.go b/accounts/user.go | ||
index 900033c6..f8827fb2 100644 | ||
--- a/accounts/user.go | ||
+++ b/accounts/user.go | ||
@@ -15,6 +15,7 @@ import ( | ||
"strings" | ||
"sync" | ||
|
||
+ "github.com/adrg/xdg" | ||
dbus "github.com/godbus/dbus" | ||
"github.com/linuxdeepin/dde-daemon/accounts/users" | ||
authenticate "github.com/linuxdeepin/go-dbus-factory/com.deepin.daemon.authenticate" | ||
@@ -649,7 +650,12 @@ func getUserSession(homeDir string) string { | ||
} | ||
|
||
func getSessionList() []string { | ||
- fileInfoList, err := ioutil.ReadDir("/usr/share/xsessions") | ||
+ xsessionPath, err := xdg.SearchDataFile("xsessions") | ||
+ if err != nil { | ||
+ return nil; | ||
+ } | ||
+ | ||
+ fileInfoList, err := ioutil.ReadDir(xsessionPath) | ||
if err != nil { | ||
return nil | ||
} | ||
diff --git a/appearance/fsnotify.go b/appearance/fsnotify.go | ||
index a409d0ba..ff674600 100644 | ||
--- a/appearance/fsnotify.go | ||
+++ b/appearance/fsnotify.go | ||
@@ -5,12 +5,15 @@ | ||
package appearance | ||
|
||
import ( | ||
+ "errors" | ||
+ "io/fs" | ||
"os" | ||
"path" | ||
"path/filepath" | ||
"strings" | ||
"time" | ||
|
||
+ "github.com/adrg/xdg" | ||
"github.com/fsnotify/fsnotify" | ||
"github.com/linuxdeepin/dde-daemon/appearance/background" | ||
"github.com/linuxdeepin/dde-daemon/appearance/subthemes" | ||
@@ -100,9 +103,14 @@ func (m *Manager) watchGtkDirs() { | ||
gtkDirs = []string{ | ||
path.Join(home, ".local/share/themes"), | ||
path.Join(home, ".themes"), | ||
- "/usr/local/share/themes", | ||
- "/usr/share/themes", | ||
} | ||
+ for _, dataPath := range xdg.DataDirs { | ||
+ gtkPath := filepath.Join(dataPath, "themes"); | ||
+ if _, err := os.Stat(gtkPath); err != nil && errors.Is(err, fs.ErrNotExist) { | ||
+ continue | ||
+ } | ||
+ gtkDirs = append(gtkDirs, gtkPath); | ||
+ } | ||
|
||
m.watchDirs(gtkDirs) | ||
} | ||
@@ -112,9 +120,14 @@ func (m *Manager) watchIconDirs() { | ||
iconDirs = []string{ | ||
path.Join(home, ".local/share/icons"), | ||
path.Join(home, ".icons"), | ||
- "/usr/local/share/icons", | ||
- "/usr/share/icons", | ||
} | ||
+ for _, dataPath := range xdg.DataDirs { | ||
+ iconPath := filepath.Join(dataPath, "icons"); | ||
+ if _, err := os.Stat(iconPath); err != nil && errors.Is(err, fs.ErrNotExist) { | ||
+ continue | ||
+ } | ||
+ iconDirs = append(iconDirs, iconPath); | ||
+ } | ||
|
||
m.watchDirs(iconDirs) | ||
} | ||
diff --git a/apps/utils.go b/apps/utils.go | ||
index 8863d6c2..dd6f8e16 100644 | ||
--- a/apps/utils.go | ||
+++ b/apps/utils.go | ||
@@ -11,6 +11,7 @@ import ( | ||
"strconv" | ||
"strings" | ||
"syscall" | ||
+ "github.com/adrg/xdg" | ||
) | ||
|
||
func intSliceContains(slice []int, a int) bool { | ||
@@ -96,7 +97,7 @@ func removeDesktopExt(name string) string { | ||
} | ||
|
||
func getSystemDataDirs() []string { | ||
- return []string{"/usr/share", "/usr/local/share"} | ||
+ return xdg.DataDirs | ||
} | ||
|
||
// get user home |
Oops, something went wrong.