summaryrefslogtreecommitdiff
path: root/modules/dashboard
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-27 17:56:46 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-27 17:56:46 +1000
commitb5d812586733353000e741bd4448f217e8ec1224 (patch)
tree99e8966c374538ce71e941cdeeaf76893cb882e6 /modules/dashboard
parentplugin: saveItem ensure parent dir (diff)
downloadcaelestia-shell-b5d812586733353000e741bd4448f217e8ec1224.tar.gz
caelestia-shell-b5d812586733353000e741bd4448f217e8ec1224.tar.bz2
caelestia-shell-b5d812586733353000e741bd4448f217e8ec1224.zip
internal: better copy
Diffstat (limited to 'modules/dashboard')
-rw-r--r--modules/dashboard/Wrapper.qml7
1 files changed, 5 insertions, 2 deletions
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)}`]);
}
}
}