summary refs log tree commit diff
path: root/pkgs/desktops
diff options
context:
space:
mode:
authorrewine <lhongxu@outlook.com>2023-05-09 10:54:18 +0800
committerrewine <lhongxu@outlook.com>2023-05-09 18:08:20 +0800
commitda98a5a6a5080bb3917db407f53d789f5c2e8297 (patch)
tree8491f7a7edf90d5b7d45955c19c07afcd25b7abb /pkgs/desktops
parentfd40cef8d797670e203a27a91e4b8e6decf0b90c (diff)
deepin.dde-daemon: fix can't set custom wallpapers
Diffstat (limited to 'pkgs/desktops')
-rw-r--r--pkgs/desktops/deepin/go-package/dde-daemon/0005-fix-custom-wallpapers-path.diff22
-rw-r--r--pkgs/desktops/deepin/go-package/dde-daemon/default.nix15
2 files changed, 36 insertions, 1 deletions
diff --git a/pkgs/desktops/deepin/go-package/dde-daemon/0005-fix-custom-wallpapers-path.diff b/pkgs/desktops/deepin/go-package/dde-daemon/0005-fix-custom-wallpapers-path.diff
new file mode 100644
index 0000000000000..0dcd7366e0dfd
--- /dev/null
+++ b/pkgs/desktops/deepin/go-package/dde-daemon/0005-fix-custom-wallpapers-path.diff
@@ -0,0 +1,22 @@
+diff --git a/bin/dde-system-daemon/wallpaper.go b/bin/dde-system-daemon/wallpaper.go
+index d4af13da..1ff36f84 100644
+--- a/bin/dde-system-daemon/wallpaper.go
++++ b/bin/dde-system-daemon/wallpaper.go
+@@ -24,7 +24,7 @@ import (
+ 
+ const maxCount = 5
+ const maxSize = 32 * 1024 * 1024
+-const wallPaperDir = "/usr/share/wallpapers/custom-wallpapers/"
++const wallPaperDir = "/var/lib/dde-daemon/wallpapers/custom-wallpapers/"
+ 
+ func GetUserDir(username string) (string, error) {
+ 	dir := filepath.Join(wallPaperDir, username)
+@@ -136,7 +136,7 @@ func (d *Daemon) SaveCustomWallPaper(sender dbus.Sender, username string, file s
+ 		"-u",
+ 		username,
+ 		"--",
+-		"head",
++		"@coreutils@/bin/head",
+ 		"-c",
+ 		"0",
+ 		file,
diff --git a/pkgs/desktops/deepin/go-package/dde-daemon/default.nix b/pkgs/desktops/deepin/go-package/dde-daemon/default.nix
index 3890e6a23a0fc..b9a1da5ca2e80 100644
--- a/pkgs/desktops/deepin/go-package/dde-daemon/default.nix
+++ b/pkgs/desktops/deepin/go-package/dde-daemon/default.nix
@@ -32,6 +32,9 @@
 , xdotool
 , getconf
 , dbus
+, coreutils
+, util-linux
+, dde-session-ui
 }:
 
 buildGoPackage rec {
@@ -55,6 +58,10 @@ buildGoPackage rec {
       src = ./0004-aviod-use-hardcode-path.patch;
       inherit dbus;
     })
+    (substituteAll {
+      src = ./0005-fix-custom-wallpapers-path.diff;
+      inherit coreutils;
+    })
   ];
 
   postPatch = ''
@@ -70,7 +77,7 @@ buildGoPackage rec {
     substituteInPlace system/uadp/crypto.go \
       --replace "/usr/share/uadp" "/var/lib/dde-daemon/uadp"
 
-    substituteInPlace appearance/background/{background.go,custom_wallpapers.go} accounts/user.go bin/dde-system-daemon/wallpaper.go \
+    substituteInPlace appearance/background/{background.go,custom_wallpapers.go} accounts/user.go \
      --replace "/usr/share/wallpapers" "/run/current-system/sw/share/wallpapers"
 
     substituteInPlace appearance/manager.go timedate/zoneinfo/zone.go \
@@ -138,6 +145,12 @@ buildGoPackage rec {
     runHook postInstall
   '';
 
+  preFixup = ''
+    gappsWrapperArgs+=(
+      --prefix PATH : "${lib.makeBinPath [ util-linux dde-session-ui ]}"
+    )
+  '';
+
   postFixup = ''
     for f in "$out"/lib/deepin-daemon/*; do
       echo "Wrapping $f"