mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-03 21:54:05 +02:00
Support icon themes in snap
This commit is contained in:
parent
228bbc1e8e
commit
594bb8a76b
2 changed files with 13 additions and 3 deletions
|
@ -759,7 +759,9 @@ QImage DefaultApplicationIcon() {
|
|||
}
|
||||
|
||||
QString ApplicationIconName() {
|
||||
static const auto Result = QGuiApplication::desktopFileName().remove(
|
||||
static const auto Result = (KSandbox::isSnap()
|
||||
? u"snap.%1."_q.arg(qEnvironmentVariable("SNAP_INSTANCE_NAME"))
|
||||
: QString()) + QGuiApplication::desktopFileName().remove(
|
||||
u"._"_q + Core::Launcher::Instance().instanceHash());
|
||||
return Result;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
name: telegram-desktop
|
||||
adopt-info: telegram
|
||||
icon: Telegram/Resources/art/icon512@2x.png
|
||||
|
||||
base: core24
|
||||
grade: stable
|
||||
|
@ -151,7 +150,16 @@ parts:
|
|||
craftctl set version="$version"
|
||||
override-build: |
|
||||
craftctl default
|
||||
rm -rf "$CRAFT_PART_INSTALL/usr/share/icons"
|
||||
|
||||
APP_ID=org.telegram.desktop
|
||||
sed -i "s/^Icon=$APP_ID$/Icon=snap.telegram-desktop./g" "$CRAFT_PART_INSTALL/usr/share/applications/$APP_ID.desktop"
|
||||
for i in $(find "$CRAFT_PART_INSTALL/usr/share/icons" -name "$APP_ID*.svg" -o -name "$APP_ID*.png"); do
|
||||
PREFIXED="$(dirname "$i")/snap.$CRAFT_PROJECT_NAME.$(basename "$i" | sed "s/$APP_ID//")"
|
||||
mv "$i" "$PREFIXED"
|
||||
DEST="$(dirname "$i" | sed 's@usr/share@meta/gui@')"
|
||||
mkdir -p "$DEST"
|
||||
cp -r "$PREFIXED" "$DEST"
|
||||
done
|
||||
after:
|
||||
- ada
|
||||
- ffmpeg
|
||||
|
|
Loading…
Add table
Reference in a new issue