summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAmstel <shinamusuteru.rdc@gmail.com>2025-06-11 14:50:31 +0800
committerAmstel <shinamusuteru.rdc@gmail.com>2025-06-11 14:50:31 +0800
commit9308c9b67f491ff32c57d037f16ac6e9148f9dae (patch)
treee18f5cc757fe04d0a89a3f98f6e06d1183020135 /scripts
parentFixed Logout Function (diff)
downloadcaelestia-shell-9308c9b67f491ff32c57d037f16ac6e9148f9dae.tar.gz
caelestia-shell-9308c9b67f491ff32c57d037f16ac6e9148f9dae.tar.bz2
caelestia-shell-9308c9b67f491ff32c57d037f16ac6e9148f9dae.zip
Dashboard Avatar Picker 1.0a
This will allows users to update/change their profile icon from the dashboard by clicking the profile icon. ### How it works? > Once the profile icon is clicked it will launch zenity file picker. Once selected the target new profile Icon this script will do the following: - Deletes the current ~/.face - Deletes all .face cached files in ~/.cache/caelestia/thumbnails/ - Copies the new selected profile-icon to ~/.face ### Issues - Once the profile is update, the user must manually reload the shell by restarting the shell session. **NOTE:** Make sure to chmod +x the picker.sh before using. Dependencies: - zenity
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/caelestia-avatar-picker.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/caelestia-avatar-picker.sh b/scripts/caelestia-avatar-picker.sh
new file mode 100755
index 0000000..4ca5cfb
--- /dev/null
+++ b/scripts/caelestia-avatar-picker.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+export DISPLAY=${DISPLAY:-:0}
+export DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS:-"unix:path=/run/user/$UID/bus"}
+
+# Pick an image file with zenity
+FILE=$(zenity --file-selection --file-filter="Images | *.png *.jpg *.jpeg *.webp")
+
+# Exit if cancelled
+[ -z "$FILE" ] && exit 1
+
+# Deletes existing ~/.face & caches
+rm -f "$HOME/.face"
+rm -f "$HOME/.cache/caelestia/thumbnails/@0x0-exact.png"
+rm -f "$HOME/.cache/caelestia/thumbnails/@93x93-exact.png"
+rm -f "$HOME/.cache/caelestia/thumbnails/@93x94-exact.png"
+rm -f "$HOME/.cache/caelestia/thumbnails/@94x94-exact.png"
+
+cp "$FILE" "$HOME/.face"
+
+echo "$HOME/.face"