summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-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)}`]);
}
}
}