parent
9308c9b67f
commit
92f05c0028
2 changed files with 8 additions and 79 deletions
|
|
@ -19,67 +19,17 @@ Row {
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
color: Colours.palette.m3surfaceContainerHigh
|
color: Colours.palette.m3surfaceContainerHigh
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
text: "person"
|
||||||
|
fill: 1
|
||||||
|
font.pointSize: (info.implicitHeight / 2) || 1
|
||||||
|
}
|
||||||
|
|
||||||
CachingImage {
|
CachingImage {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
path: `${Paths.home}/.face`
|
path: `${Paths.home}/.face`
|
||||||
fillMode: Image.PreserveAspectCrop
|
|
||||||
smooth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: overlay
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: avatarRect.radius
|
|
||||||
color: Qt.rgba(0, 0, 0, 0.4)
|
|
||||||
opacity: mouseArea.containsMouse ? 1.0 : 0.0
|
|
||||||
visible: opacity > 0
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 300
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "photo_camera"
|
|
||||||
color: "white"
|
|
||||||
font.pointSize: info.implicitHeight / 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: avatarUpdateProc.running = true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: avatarUpdateProc
|
|
||||||
running: false
|
|
||||||
command: [`${Paths.home}/.local/share/caelestia/shell/scripts/caelestia-avatar-picker.sh`]
|
|
||||||
|
|
||||||
stdout: SplitParser {
|
|
||||||
onRead: {
|
|
||||||
notifyProc.running = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: notifyProc
|
|
||||||
running: false
|
|
||||||
command: [
|
|
||||||
"notify-send",
|
|
||||||
"-u", "low",
|
|
||||||
"-i", "dialog-information-symbolic",
|
|
||||||
"Profile Updated",
|
|
||||||
"Your avatar has been successfully changed.",
|
|
||||||
"-a", "Shell",
|
|
||||||
"-A", "OK=Got it!"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
#!/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"
|
|
||||||
Loading…
Add table
Reference in a new issue