Unverified Commit c70f9cd1 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #230800 from wineee/wallpapers

deepin.dde-daemon: fix can't set custom wallpapers
parents 47d50c95 da98a5a6
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
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,
+14 −1
Original line number Diff line number Diff line
@@ -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"