From b5d812586733353000e741bd4448f217e8ec1224 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 27 Aug 2025 17:56:46 +1000 Subject: internal: better copy --- modules/dashboard/Wrapper.qml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/dashboard/Wrapper.qml') diff --git a/modules/dashboard/Wrapper.qml b/modules/dashboard/Wrapper.qml index befc859..ba5dad6 100644 --- a/modules/dashboard/Wrapper.qml +++ b/modules/dashboard/Wrapper.qml @@ -4,6 +4,7 @@ import qs.components import qs.components.filedialog import qs.config import qs.utils +import Caelestia import Quickshell import Quickshell.Hyprland import QtQuick @@ -20,8 +21,10 @@ Item { filterLabel: qsTr("Image files") filters: Images.validImageExtensions onAccepted: path => { - Paths.copy(path, `${Paths.home}/.face`); - Quickshell.execDetached(["notify-send", "-a", "caelestia-shell", "-u", "low", "-h", `STRING:image-path:${path}`, "Profile picture changed", `Profile picture changed to ${Paths.shortenHome(path)}`]); + if (CUtils.copyFile(`file://${path}`, `${Paths.home}/.face`)) + Quickshell.execDetached(["notify-send", "-a", "caelestia-shell", "-u", "low", "-h", `STRING:image-path:${path}`, "Profile picture changed", `Profile picture changed to ${Paths.shortenHome(path)}`]); + else + Quickshell.execDetached(["notify-send", "-a", "caelestia-shell", "-u", "critical", "Unable to change profile picture", `Failed to change profile picture to ${Paths.shortenHome(path)}`]); } } } -- cgit v1.2.3-freya