feat: linux improvements

Co-authored-by: Dr4iv3rNope <Dr4iv3rNope@users.noreply.github.com>
This commit is contained in:
ZavaruKitsu 2023-06-05 17:23:17 +03:00
parent e0bf550932
commit a53c40e03b
9 changed files with 22 additions and 22 deletions

2
.gitmodules vendored
View file

@ -27,7 +27,7 @@
url = https://github.com/desktop-app/codegen.git
[submodule "Telegram/lib_ui"]
path = Telegram/lib_ui
url = https://github.com/desktop-app/lib_ui.git
url = https://github.com/AyuGram/lib_ui.git
[submodule "Telegram/lib_lottie"]
path = Telegram/lib_lottie
url = https://github.com/desktop-app/lib_lottie.git

View file

@ -1747,8 +1747,8 @@ endif()
if (LINUX AND DESKTOP_APP_USE_PACKAGED)
include(GNUInstallDirs)
configure_file("../lib/xdg/org.telegram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml")
configure_file("../lib/xdg/org.ayugram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/org.ayugram.desktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/org.ayugram.desktop.metainfo.xml")
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "telegram.png")
@ -1757,6 +1757,6 @@ if (LINUX AND DESKTOP_APP_USE_PACKAGED)
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "telegram.png")
install(FILES "../lib/xdg/org.telegram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
install(FILES "../lib/xdg/org.ayugram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.ayugram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
endif()

View file

@ -54,6 +54,6 @@
</qresource>
<qresource prefix="/misc">
<file alias="default_shortcuts-custom.json">../../default_shortcuts-custom.json</file>
<file alias="org.telegram.desktop.desktop">../../../../lib/xdg/org.telegram.desktop.desktop</file>
<file alias="org.ayugram.desktop.desktop">../../../../lib/xdg/org.ayugram.desktop.desktop</file>
</qresource>
</RCC>

View file

@ -110,7 +110,7 @@ static void t_desktop_application_init(TDesktopApplication *application) {
namespace Platform {
namespace {
constexpr auto kDesktopFile = ":/misc/org.telegram.desktop.desktop"_cs;
constexpr auto kDesktopFile = ":/misc/org.ayugram.desktop.desktop"_cs;
bool PortalAutostart(bool start, bool silent) {
if (cExeName().isEmpty()) {
@ -485,7 +485,7 @@ bool GenerateDesktopFile(
hashMd5Hex(exePath.constData(), exePath.size(), md5Hash);
}
QFile::remove(u"%1org.telegram.desktop.%2.desktop"_q.arg(
QFile::remove(u"%1org.ayugram.desktop.%2.desktop"_q.arg(
targetPath,
md5Hash));
}
@ -686,11 +686,11 @@ void start() {
md5Hash.data());
}
return u"org.telegram.desktop._%1.desktop"_q.arg(
return u"org.ayugram.desktop._%1.desktop"_q.arg(
md5Hash.constData());
}
return u"org.telegram.desktop.desktop"_q;
return u"org.ayugram.desktop.desktop"_q;
}());
LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName()));

@ -1 +1 @@
Subproject commit 83cab52cd6ba93e9292405b23358d8dde3f95567
Subproject commit 435b884b8bc05457b2d9b46a84c05d44f10dace9

2
cmake

@ -1 +1 @@
Subproject commit a41fa6e14006204f3fea7993a775e14f8fdde9fc
Subproject commit 1c07a71d6fde4e71ca9f98d343d09d7503ef15d2

View file

@ -1,8 +1,8 @@
[Desktop Entry]
Name=AyuGram Desktop
Comment=Unofficial desktop version of Telegram messaging app
TryExec=telegram-desktop
Exec=telegram-desktop -- %u
TryExec=ayugram-desktop
Exec=DESKTOPINTEGRATION=1 ayugram-desktop -- %u
Icon=telegram
Terminal=false
StartupWMClass=AyuGram
@ -16,6 +16,6 @@ X-GNOME-UsesNotifications=true
X-GNOME-SingleWindow=true
[Desktop Action quit]
Exec=telegram-desktop -quit
Exec=ayugram-desktop -quit
Name=Quit Telegram
Icon=application-exit

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop">
<id>org.telegram.desktop</id>
<id>org.ayugram.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>Telegram Desktop</name>
<summary>Fast. Secure. Powerful.</summary>
<name>AyuGram Desktop</name>
<summary>Unofficial desktop version of Telegram messaging app</summary>
<description>
<p>Pure instant messaging — simple, fast, secure, and synced across all your devices. One of the world's top 10 most downloaded apps with over 500 million active users.</p>
<p>FAST: Telegram is the fastest messaging app on the market, connecting people via a unique, distributed network of data centers around the globe.</p>
@ -83,8 +83,8 @@
<content_attribute id="money-gambling">none</content_attribute>
<content_attribute id="money-advertising">moderate</content_attribute>
</content_rating>
<launchable type="desktop-id">org.telegram.desktop.desktop</launchable>
<launchable type="desktop-id">org.ayugram.desktop.desktop</launchable>
<provides>
<binary>telegram-desktop</binary>
<binary>ayugram-desktop</binary>
</provides>
</component>

View file

@ -19,7 +19,7 @@ apps:
command-chain:
- bin/desktop-launch
common-id: org.telegram.desktop
desktop: usr/share/applications/org.telegram.desktop.desktop
desktop: usr/share/applications/org.ayugram.desktop.desktop
autostart: telegram-desktop_telegram-desktop.desktop
plugs:
- alsa
@ -91,7 +91,7 @@ parts:
plugin: cmake
source: .
source-type: git
parse-info: [usr/share/metainfo/org.telegram.desktop.metainfo.xml]
parse-info: [usr/share/metainfo/org.ayugram.desktop.metainfo.xml]
build-environment:
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s