{"id":341618,"date":"2022-11-23T15:00:50","date_gmt":"2022-11-23T15:00:50","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=341618"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=341618","title":{"rendered":"<span>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Flatpak \u0432 Compose Desktop<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0422\u0435, \u043a\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Compose Multiplatform, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u0432 \u043a\u0430\u043a \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0414\u043b\u044f Linux \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b: <em>Deb<\/em> &#8212; &#171;\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435&#187; \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f <a href=\"https:\/\/www.debian.org\/index.ru.html\" rel=\"noopener noreferrer nofollow\">Debian<\/a>-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432; <em>Rpm<\/em> &#8212; \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f <a href=\"https:\/\/getfedora.org\/ru\/\" rel=\"noopener noreferrer nofollow\">Fedora<\/a>, RHEL; <a href=\"https:\/\/appimage.org\/\" rel=\"noopener noreferrer nofollow\"><em>AppImage<\/em><\/a> &#8212; portable \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u043e\u0434\u043d\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c). \u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 &#8212; \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 \u043e\u0434\u043d\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443(Debian \u0438 Fedora \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e), \u0432\u0442\u043e\u0440\u043e\u0433\u043e &#8212; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0432 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432. \u041d\u0435\u0433\u043e\u0434\u0443\u044f \u0441 \u044d\u0442\u043e\u0433\u043e, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c compose-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 <a href=\"https:\/\/flatpak.org\/\" rel=\"noopener noreferrer nofollow\"><em>Flatpak<\/em><\/a> &#8212; \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0434\u043b\u044f <em>sandboxed<\/em> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. Sandboxed apps &#8212; \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c. Flatpak \u0434\u0430\u0435\u0442 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\/\u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b. \u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/docs.flatpak.org\/en\/latest\/portal-api-reference.html\" rel=\"noopener noreferrer nofollow\">Portals<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432 Flatpak, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a\u0430\u043c\u0435\u0440\u0435, \u043f\u043e\u043a\u0430\u0437\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u043d\u0435\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Flatpak \u0432 Compose Multiplatform \u043d\u0435\u0442.<\/p>\n<h2>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c?<\/h2>\n<ul>\n<li>\n<p>\u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e Flatpak. \u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/flatpak.org\/setup\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/li>\n<li>\n<p>Flatpak-builder &#8212; \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 flatpak-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u0431\u044b\u0447\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0441\u0430\u043c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>org.freedesktop.Sdk<\/code> \u0438 <code>org.freedesktop.Platform<\/code> \u0432\u0435\u0440\u0441\u0438\u0438 <code>22.08<\/code> \u0447\u0435\u0440\u0435\u0437 flatpak.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Flatpak?<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 Compose Desktop \u0438\u0437 \u0442\u0430\u0440\u0433\u0435\u0442\u043e\u0432 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0435\u0435 AppImage, \u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e. \u041e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e gradle task <code>packageAppImage<\/code>. \u0411\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 <code>build\/compose\/binaries\/main\/app\/[appName]\/<\/code>, \u0433\u0434\u0435 [appName] &#8212; \u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\/\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430:<\/p>\n<pre><code>MyApp     \u251c\u2500\u2500 bin     \u2502\u00a0\u00a0 \u2514\u2500\u2500 MyApp     \u2514\u2500\u2500 lib         \u251c\u2500\u2500 app\/         \u251c\u2500\u2500 libapplauncher.so         \u251c\u2500\u2500 runtime\/         \u2514\u2500\u2500 MyApp.png<\/code><\/pre>\n<p> \u0412 \u043f\u0430\u043f\u043a\u0435 bin \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0430\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c. \u0412 \u043f\u0430\u043f\u043a\u0435 lib \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f &#171;\u043a\u0438\u0448\u043a\u0438&#187; \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: app &#8212; jar-\u043d\u0438\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b. <code>libapplauncher.so<\/code> &#8212; \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438. <code>runtime<\/code> &#8212; \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. <code>MyApp.png<\/code> &#8212; \u0438\u043a\u043e\u043d\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f).<\/p>\n<p>\u0421\u0430\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a <strong>\u0431\u0435\u0437 \u043f\u0430\u043f\u043a\u0438<\/strong> <strong>lib\/ \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f!<\/strong><\/p>\n<h2>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0438 \u0438\u043a\u043e\u043d\u043a\u0443<\/h2>\n<p>\u0414\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e Flatpak-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u0435\u043d <em>\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442<\/em>. \u0410\u043d\u0430\u043b\u043e\u0433 \u0432 Android-\u043c\u0438\u0440\u0435 &#8212; <em>AndroidManifest.xml<\/em>. \u041e\u043d \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0412 <em>Flatpak<\/em> \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u044f json \u0438\u043b\u0438 yaml.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <em>src\/desktopMain\/resources\/flatpak\/manifest.yml:<\/em><\/p>\n<pre><code class=\"yaml\">app-id: com.company.myapp runtime: org.freedesktop.Platform runtime-version: '22.08' sdk: org.freedesktop.Sdk command: \/app\/bin\/MyApp finish-args:     - --share=network     - --socket=x11     - --socket=fallback-x11     - --device=dri modules:     - name: myapp       buildsystem: simple       build-commands:         - cp -r bin\/ \/app\/bin\/         - cp -r lib\/ \/app\/lib\/         - mkdir -p \/app\/share\/applications         - install -D com.company.myapp.desktop \/app\/share\/applications\/com.company.myapp.desktop         - mkdir -p \/app\/share\/icons\/hicolor\/scalable\/apps\/         - cp -r logo_round_preview.svg \/app\/share\/icons\/hicolor\/scalable\/apps\/com.company.myapp.svg       sources:         - type: file           path: logo_round_preview.svg         - type: dir           path: \"bin\/\"           dest: \"bin\/\"         - type: dir           path: \"lib\/\"           dest: \"lib\/\"         - type: file           path: com.company.myapp.desktop<\/code><\/pre>\n<ul>\n<li>\n<p>(1) Id \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u043a\u0430\u043a applicationId \u0432 Android). <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(2) \u041a\u0430\u043a\u043e\u0439 runtime \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c <code>org.freedesktop.Platform<\/code> \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 runtime. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(3) \u0412\u0435\u0440\u0441\u0438\u044f runtime. \u041e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(4) Sdk \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(5) \u041f\u0443\u0442\u044c \u043a \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(6-10) \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ol>\n<li>\n<p><code>--share=network<\/code> &#8212; \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443.<\/p>\n<\/li>\n<li>\n<p><code>--socket=x11<\/code> &#8212; \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043a\u043e\u043d\u043d\u043e\u043c\u0443 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0443 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/X_Window_System\" rel=\"noopener noreferrer nofollow\">X11<\/a>. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 Compose Desktop \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/wayland.freedesktop.org\/\" rel=\"noopener noreferrer nofollow\">Wayland<\/a>. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p><code>--socket=fallback-x11<\/code> &#8212; \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u0447\u0438\u0441\u0442\u044b\u043c Wayland(\u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e). <em>\u041e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e<\/em><\/p>\n<\/li>\n<li>\n<p><code>--device=dri<\/code> &#8212; \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GPU. <em>\u041e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e<\/em><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>(11-31) \u041c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438(\u0441\u043f\u0438\u0441\u043e\u043a).<\/p>\n<\/li>\n<li>\n<p>(12) \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p>(13) \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>(14-20) \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>(15-16) \u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 bin \u0438 lib \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u0432 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>(17) \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u043a\u043e\u043d\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>(18) \u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0424\u0430\u0439\u043b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0442\u0430\u043a [appId].desktop, \u0433\u0434\u0435 [appId] &#8212; id \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>(19) \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u0430 \u0438\u043a\u043e\u043d\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>(20) \u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043a\u043e\u043d\u043a\u0438 \u0432 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e svg. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/docs.flatpak.org\/en\/latest\/conventions.html?highlight=icon#application-icons\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>(21-31) \u0420\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u043c\u043e\u0434\u0443\u043b\u044e:<\/p>\n<ul>\n<li>\n<p>(22) \u0422\u0438\u043f \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u0421\u0430\u043c\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 &#8212; <em>file<\/em> \u0438 <em>dir<\/em><\/p>\n<\/li>\n<li>\n<p>(23) \u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443. \u0422\u0430\u043a\u0436\u0435, \u0432\u043c\u0435\u0441\u0442\u043e <code>path<\/code> \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c <code>url<\/code> \u0438 \u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u043a\u043e\u043d\u043a\u0438 <em>src\/desktopMain\/resources\/flatpak\/icon.desktop<\/em>. \u041e\u043d \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435(\u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c <strong>\u0432\u0441\u0451<\/strong>):<\/p>\n<pre><code class=\"vhdl\">[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=false Exec=\/app\/bin\/MyApp Name=MyApp Icon=com.company.myapp <\/code><\/pre>\n<ol>\n<li>\n<p> \u0423\u043a\u0430\u0437\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044d\u0442\u043e \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u043a\u043e\u043d\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430(UTF-8, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f).<\/p>\n<\/li>\n<li>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0438\u043f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; Application.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c <code>true<\/code>, \u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0442\u044c \u043a \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u0432 \u043b\u0430\u0443\u043d\u0447\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043a\u043e\u043d\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 id \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 app id, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438\u043a\u043e\u043d\u043a\u0443)<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c svg, \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043a\u043e\u043d\u043a\u0443 \u0432 <code>src\/desktopMain\/resources\/<\/code>. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b, \u0441\u043c\u043e\u0442\u0440\u0438\u043c <a href=\"https:\/\/docs.flatpak.org\/en\/latest\/conventions.html?highlight=icon#application-icons\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c Gradle<\/h2>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 AppImage \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0432 <code>build.gradle.kts<\/code>:<\/p>\n<pre><code class=\"kotlin\">compose.desktop {   \/\/...   application {     \/\/...     nativeDistributions {       \/\/...       targetFormats(         TargetFormat.AppImage,         \/\/ \u0414\u0440\u0443\u0433\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b       )     }   } }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 task \u0432 \u0442\u043e\u0442 \u0436\u0435 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"kotlin\">val appId = \"com.company.myapp\" tasks.register(\"packageFlatpak\") {     dependsOn(\"packageAppImage\")     doLast {         delete {             delete(\"$buildDir\/flatpak\/bin\/\")             delete(\"$buildDir\/flatpak\/lib\/\")         }         copy {             from(\"$buildDir\/compose\/binaries\/main\/app\/MyApp\/\")             into(\"$buildDir\/flatpak\/\")             exclude(\"$buildDir\/compose\/binaries\/main\/app\/MyApp\/lib\/runtime\/legal\")         }         copy {             from(\"$rootDir\/src\/desktopMain\/resources\/logo_round_preview.svg\")             into(\"$buildDir\/flatpak\/\")         }         copy {             from(\"$rootDir\/src\/desktopMain\/resources\/logo_round.svg\")             into(\"$buildDir\/flatpak\/\")         }         copy {             from(\"$rootDir\/src\/desktopMain\/resources\/flatpak\/manifest.yml\")             into(\"$buildDir\/flatpak\/\")             rename {                 \"$appId.yml\"             }         }         copy {             from(\"$rootDir\/src\/desktopMain\/resources\/flatpak\/icon.desktop\")             into(\"$buildDir\/flatpak\/\")             rename {                 \"$appId.desktop\"             }         }         exec {             workingDir(\"$buildDir\/flatpak\")             commandLine(\"flatpak-builder --install --user --force-clean --state-dir=build\/flatpak-builder --repo=build\/flatpak-repo build\/flatpak-target $appId.yml\".split(\" \"))         }     } }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 task \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 <code>build\/flatpak<\/code>, \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 ide, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d task:<\/p>\n<pre><code class=\"kotlin\">tasks.register(\"runFlatpak\") {     dependsOn(\"packageFlatpak\")     doLast {         exec {             commandLine(\"flatpak run $appId\".split(\" \"))         }     } }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u0440\u0430\u0434\u043b\u0430 \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 <code>Gradle Tasks -> other<\/code>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cc5\/9d8\/2e0\/cc59d82e0fd40f50a9b693a8a498ced3.png\" alt=\"\" title=\"\" width=\"520\" height=\"628\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cc5\/9d8\/2e0\/cc59d82e0fd40f50a9b693a8a498ced3.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0432\u0430\u0436\u0434\u044b \u043a\u043b\u0438\u043a\u043d\u0435\u043c \u043f\u043e \u043d\u0435\u043c\u0443, \u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 task.<\/p>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439<\/h2>\n<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434 <code>isSystemInDarkTheme<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>false<\/code>, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Flatpak. \u0417\u0434\u0435\u0441\u044c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 Portals. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0438\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0442\u0435\u043c\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044d\u0442\u043e api \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">gdbus call --session --dest=org.freedesktop.portal.Desktop --object-path=\/org\/freedesktop\/portal\/desktop --method=org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0435\u043c\u043d\u0443\u044e \u0442\u0435\u043c\u0443 \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<pre><code>(&lt;&lt;uint32 1>>,)<\/code><\/pre>\n<p>\u0413\u0434\u0435 <code>1<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0435\u043c\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430. \u0415\u0441\u043b\u0438 \u043e\u043d\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430, \u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e <code>1<\/code> \u0431\u0443\u0434\u0435\u0442 <code>0<\/code>.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430:<\/p>\n<pre><code class=\"kotlin\">suspend fun runInShell(command: String): Process {     return ProcessBuilder(*command.split(\" \").toTypedArray())         .redirectError(ProcessBuilder.Redirect.INHERIT)         .start().apply {             waitFor(60, TimeUnit.MINUTES)         } }  suspend fun Process.readString(): String {     var o = \"\"     val b = BufferedReader(InputStreamReader(inputStream))     var line = \"\"     while (b?.readLine()?.also { line = it } != null) o += line     return o }<\/code><\/pre>\n<p>\u041d\u0430 \u0432\u0445\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0443 <code>runInShell<\/code> \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 <code>commonMain<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c expect Composable-\u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0442\u0435\u043c\u0443 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435:<\/p>\n<pre><code class=\"kotlin\">@Composable expect fun platformIsSystemInDarkTheme(): Boolean<\/code><\/pre>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 <code>desktopMain<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438\u043c\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437 \u0432 0.1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0442\u0435\u043c\u0443:<\/p>\n<pre><code class=\"kotlin\">private const val command =     \"gdbus call --session --dest=org.freedesktop.portal.Desktop --object-path=\/org\/freedesktop\/portal\/desktop --method=org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme\"  @Composable actual fun platformIsSystemInDarkTheme(): Boolean {     var darkTheme by remember { mutableStateOf(false) }     LaunchedEffect(true) {         while (true) {             kotlin.runCatching {                 val str = runInShell(command).readString()                 darkTheme = str[10] == '1'             }             delay(100)         }     }     return darkTheme }<\/code><\/pre>\n<p>\u0412 \u0444\u0443\u043d\u0446\u0438\u0438, \u0433\u0434\u0435 \u0432\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0435 \u0442\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434(<strong>\u043e\u0434\u0438\u043d \u0440\u0430\u0437!<\/strong>):<\/p>\n<pre><code class=\"kotlin\">@Composable fun AppTheme(     darkTheme: Boolean = platformIsSystemInDarkTheme(),     dynamicColor: Boolean = true,     content: @Composable () -> Unit ) {   \/\/... }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0442\u0435\u043c\u0443.<\/p>\n<h2>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u0438<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c compose \u0434\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442(\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 alpha-\u0432\u0435\u0440\u0441\u0438\u044f\u0445). \u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442, \u0442\u043e \u0443\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>undecorated<\/code> \u0438 <code>transparent<\/code> \u0432 Composable-\u043e\u043a\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"kotlin\">fun main() =    application {     Window(       onCloseRequest = {         exitApplication()       },        title = \"MyApp\",       undecorated = true, \/\/ \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f       transparent = true \/\/ \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f       ) {         \/\/ content       }   }<\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043c\u0443 Flatpak, \u0442\u043e \u0447\u0438\u0442\u0430\u0439\u0442\u0435 <a href=\"https:\/\/docs.flatpak.org\/en\/latest\/index.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c <a href=\"https:\/\/gitlab.com\/colorata\/wallman\/-\/tree\/efa37bbe348ea3b04430375cd895aaa9f7a3ea17\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0447\u0443\u043a\u0447\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 &#8212; \u043f\u0438\u0448\u0438\u0442\u0435.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/701078\/\"> https:\/\/habr.com\/ru\/post\/701078\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0422\u0435, \u043a\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Compose Multiplatform, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u0432 \u043a\u0430\u043a \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0414\u043b\u044f Linux \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b: <em>Deb<\/em> &#8212; &#171;\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435&#187; \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f <a href=\"https:\/\/www.debian.org\/index.ru.html\" rel=\"noopener noreferrer nofollow\">Debian<\/a>-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432; <em>Rpm<\/em> &#8212; \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f <a href=\"https:\/\/getfedora.org\/ru\/\" rel=\"noopener noreferrer nofollow\">Fedora<\/a>, RHEL; <a href=\"https:\/\/appimage.org\/\" rel=\"noopener noreferrer nofollow\"><em>AppImage<\/em><\/a> &#8212; portable \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u043e\u0434\u043d\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c). \u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 &#8212; \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 \u043e\u0434\u043d\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443(Debian \u0438 Fedora \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e), \u0432\u0442\u043e\u0440\u043e\u0433\u043e &#8212; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0432 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432. \u041d\u0435\u0433\u043e\u0434\u0443\u044f \u0441 \u044d\u0442\u043e\u0433\u043e, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c compose-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 <a href=\"https:\/\/flatpak.org\/\" rel=\"noopener noreferrer nofollow\"><em>Flatpak<\/em><\/a> &#8212; \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0434\u043b\u044f <em>sandboxed<\/em> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. Sandboxed apps &#8212; \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c. Flatpak \u0434\u0430\u0435\u0442 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\/\u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b. \u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/docs.flatpak.org\/en\/latest\/portal-api-reference.html\" rel=\"noopener noreferrer nofollow\">Portals<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432 Flatpak, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a\u0430\u043c\u0435\u0440\u0435, \u043f\u043e\u043a\u0430\u0437\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u043d\u0435\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Flatpak \u0432 Compose Multiplatform \u043d\u0435\u0442.<\/p>\n<h2>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c?<\/h2>\n<ul>\n<li>\n<p>\u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e Flatpak. \u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/flatpak.org\/setup\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/li>\n<li>\n<p>Flatpak-builder &#8212; \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 flatpak-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u0431\u044b\u0447\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0441\u0430\u043c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>org.freedesktop.Sdk<\/code> \u0438 <code>org.freedesktop.Platform<\/code> \u0432\u0435\u0440\u0441\u0438\u0438 <code>22.08<\/code> \u0447\u0435\u0440\u0435\u0437 flatpak.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Flatpak?<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 Compose Desktop \u0438\u0437 \u0442\u0430\u0440\u0433\u0435\u0442\u043e\u0432 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0435\u0435 AppImage, \u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e. \u041e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e gradle task <code>packageAppImage<\/code>. \u0411\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 <code>build\/compose\/binaries\/main\/app\/[appName]\/<\/code>, \u0433\u0434\u0435 [appName] &#8212; \u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\/\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430:<\/p>\n<pre><code>MyApp     \u251c\u2500\u2500 bin     \u2502\u00a0\u00a0 \u2514\u2500\u2500 MyApp     \u2514\u2500\u2500 lib         \u251c\u2500\u2500 app\/         \u251c\u2500\u2500 libapplauncher.so         \u251c\u2500\u2500 runtime\/         \u2514\u2500\u2500 MyApp.png<\/code><\/pre>\n<p> \u0412 \u043f\u0430\u043f\u043a\u0435 bin \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0430\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c. \u0412 \u043f\u0430\u043f\u043a\u0435 lib \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f &#171;\u043a\u0438\u0448\u043a\u0438&#187; \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: app &#8212; jar-\u043d\u0438\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b. <code>libapplauncher.so<\/code> &#8212; \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438. <code>runtime<\/code> &#8212; \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. <code>MyApp.png<\/code> &#8212; \u0438\u043a\u043e\u043d\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f).<\/p>\n<p>\u0421\u0430\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a <strong>\u0431\u0435\u0437 \u043f\u0430\u043f\u043a\u0438<\/strong> <strong>lib\/ \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f!<\/strong><\/p>\n<h2>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0438 \u0438\u043a\u043e\u043d\u043a\u0443<\/h2>\n<p>\u0414\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e Flatpak-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u0435\u043d <em>\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442<\/em>. \u0410\u043d\u0430\u043b\u043e\u0433 \u0432 Android-\u043c\u0438\u0440\u0435 &#8212; <em>AndroidManifest.xml<\/em>. \u041e\u043d \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0412 <em>Flatpak<\/em> \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u044f json \u0438\u043b\u0438 yaml.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <em>src\/desktopMain\/resources\/flatpak\/manifest.yml:<\/em><\/p>\n<pre><code class=\"yaml\">app-id: com.company.myapp runtime: org.freedesktop.Platform runtime-version: '22.08' sdk: org.freedesktop.Sdk command: \/app\/bin\/MyApp finish-args:     - --share=network     - --socket=x11     - --socket=fallback-x11     - --device=dri modules:     - name: myapp       buildsystem: simple       build-commands:         - cp -r bin\/ \/app\/bin\/         - cp -r lib\/ \/app\/lib\/         - mkdir -p \/app\/share\/applications         - install -D com.company.myapp.desktop \/app\/share\/applications\/com.company.myapp.desktop         - mkdir -p \/app\/share\/icons\/hicolor\/scalable\/apps\/         - cp -r logo_round_preview.svg \/app\/share\/icons\/hicolor\/scalable\/apps\/com.company.myapp.svg       sources:         - type: file           path: logo_round_preview.svg         - type: dir           path: \"bin\/\"           dest: \"bin\/\"         - type: dir           path: \"lib\/\"           dest: \"lib\/\"         - type: file           path: com.company.myapp.desktop<\/code><\/pre>\n<ul>\n<li>\n<p>(1) Id \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u043a\u0430\u043a applicationId \u0432 Android). <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(2) \u041a\u0430\u043a\u043e\u0439 runtime \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c <code>org.freedesktop.Platform<\/code> \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 runtime. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(3) \u0412\u0435\u0440\u0441\u0438\u044f runtime. \u041e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(4) Sdk \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(5) \u041f\u0443\u0442\u044c \u043a \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>(6-10) \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ol>\n<li>\n<p><code>--share=network<\/code> &#8212; \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443.<\/p>\n<\/li>\n<li>\n<p><code>--socket=x11<\/code> &#8212; \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043a\u043e\u043d\u043d\u043e\u043c\u0443 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0443 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/X_Window_System\" rel=\"noopener noreferrer nofollow\">X11<\/a>. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 Compose Desktop \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/wayland.freedesktop.org\/\" rel=\"noopener noreferrer nofollow\">Wayland<\/a>. <strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p><code>--socket=fallback-x11<\/code> &#8212; \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u0447\u0438\u0441\u0442\u044b\u043c Wayland(\u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e). <em>\u041e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e<\/em><\/p>\n<\/li>\n<li>\n<p><code>--device=dri<\/code> &#8212; \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GPU. <em>\u041e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e<\/em><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>(11-31) \u041c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438(\u0441\u043f\u0438\u0441\u043e\u043a).<\/p>\n<\/li>\n<li>\n<p>(12) \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p>(13) \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>(14-20) \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>(15-16) \u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 bin \u0438 lib \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u0432 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>(17) \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u043a\u043e\u043d\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>(18) \u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0424\u0430\u0439\u043b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0442\u0430\u043a [appId].desktop, \u0433\u0434\u0435 [appId] &#8212; id \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>(19) \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u0430 \u0438\u043a\u043e\u043d\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>(20) \u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043a\u043e\u043d\u043a\u0438 \u0432 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e svg. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/docs.flatpak.org\/en\/latest\/conventions.html?highlight=icon#application-icons\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>(21-31) \u0420\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u043c\u043e\u0434\u0443\u043b\u044e:<\/p>\n<ul>\n<li>\n<p>(22) \u0422\u0438\u043f \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u0421\u0430\u043c\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 &#8212; <em>file<\/em> \u0438 <em>dir<\/em><\/p>\n<\/li>\n<li>\n<p>(23) \u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443. \u0422\u0430\u043a\u0436\u0435, \u0432\u043c\u0435\u0441\u0442\u043e <code>path<\/code> \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c <code>url<\/code> \u0438 \u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u043a\u043e\u043d\u043a\u0438 <em>src\/desktopMain\/resources\/flatpak\/icon.desktop<\/em>. \u041e\u043d \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435(\u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c <strong>\u0432\u0441\u0451<\/strong>):<\/p>\n<pre><code class=\"vhdl\">[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=false Exec=\/app\/bin\/MyApp Name=MyApp Icon=com.company.myapp <\/code><\/pre>\n<ol>\n<li>\n<p> \u0423\u043a\u0430\u0437\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044d\u0442\u043e \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u043a\u043e\u043d\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430(UTF-8, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f).<\/p>\n<\/li>\n<li>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0438\u043f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; Application.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c <code>true<\/code>, \u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0442\u044c \u043a \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u0432 \u043b\u0430\u0443\u043d\u0447\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043a\u043e\u043d\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 id \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 app id, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438\u043a\u043e\u043d\u043a\u0443)<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c svg, \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043a\u043e\u043d\u043a\u0443 \u0432 <code>src\/desktopMain\/resources\/<\/code>. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b, \u0441\u043c\u043e\u0442\u0440\u0438\u043c <a href=\"https:\/\/docs.flatpak.org\/en\/latest\/conventions.html?highlight=icon#application-icons\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c Gradle<\/h2>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 AppImage \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0432 <code>build.gradle.kts<\/code>:<\/p>\n<pre><code class=\"kotlin\">compose.desktop {   \/\/...   application {     \/\/...     nativeDistributions {       \/\/...       targetFormats(         TargetFormat.AppImage,         \/\/ \u0414\u0440\u0443\u0433\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b       )     }   } }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 task \u0432 \u0442\u043e\u0442 \u0436\u0435 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"kotlin\">val appId = \"com.company.myapp\" tasks.register(\"packageFlatpak\") {     dependsOn(\"packageAppImage\")     doLast {         delete {             delete(\"$buildDir\/flatpak\/bin\/\")             delete(\"$buildDir\/flatpak\/lib\/\")         }         copy {             from(\"$buildDir\/compose\/binaries\/main\/app\/MyApp\/\")             into(\"$buildDir\/flatpak\/\")             exclude(\"$buildDir\/compose\/binaries\/main\/app\/MyApp\/lib\/runtime\/legal\")         }         copy {             from(\"$rootDir\/src\/desktopMain\/resources\/logo_round_preview.svg\")             into(\"$buildDir\/flatpak\/\")         }         copy {             from(\"$rootDir\/src\/desktopMain\/resources\/logo_round.svg\")             into(\"$buildDir\/flatpak\/\")         }         copy {             from(\"$rootDir\/src\/desktopMain\/resources\/flatpak\/manifest.yml\")             into(\"$buildDir\/flatpak\/\")             rename {                 \"$appId.yml\"             }         }         copy {             from(\"$rootDir\/src\/desktopMain\/resources\/flatpak\/icon.desktop\")             into(\"$buildDir\/flatpak\/\")             rename {                 \"$appId.desktop\"             }         }         exec {             workingDir(\"$buildDir\/flatpak\")             commandLine(\"flatpak-builder --install --user --force-clean --state-dir=build\/flatpak-builder --repo=build\/flatpak-repo build\/flatpak-target $appId.yml\".split(\" \"))         }     } }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 task \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 <code>build\/flatpak<\/code>, \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 ide, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d task:<\/p>\n<pre><code class=\"kotlin\">tasks.register(\"runFlatpak\") {     dependsOn(\"packageFlatpak\")     doLast {         exec {             commandLine(\"flatpak run $appId\".split(\" \"))         }     } }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u0440\u0430\u0434\u043b\u0430 \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 <code>Gradle Tasks -> other<\/code>:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0432\u0430\u0436\u0434\u044b \u043a\u043b\u0438\u043a\u043d\u0435\u043c \u043f\u043e \u043d\u0435\u043c\u0443, \u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 task.<\/p>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439<\/h2>\n<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434 <code>isSystemInDarkTheme<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>false<\/code>, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Flatpak. \u0417\u0434\u0435\u0441\u044c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 Portals. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0438\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0442\u0435\u043c\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044d\u0442\u043e api \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">gdbus call --session --dest=org.freedesktop.portal.Desktop --object-path=\/org\/freedesktop\/portal\/desktop --method=org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0435\u043c\u043d\u0443\u044e \u0442\u0435\u043c\u0443 \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<pre><code>(&lt;&lt;uint32 1>>,)<\/code><\/pre>\n<p>\u0413\u0434\u0435 <code>1<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0435\u043c\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430. \u0415\u0441\u043b\u0438 \u043e\u043d\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430, \u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e <code>1<\/code> \u0431\u0443\u0434\u0435\u0442 <code>0<\/code>.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430:<\/p>\n<pre><code class=\"kotlin\">suspend fun runInShell(command: String): Process {     return ProcessBuilder(*command.split(\" \").toTypedArray())         .redirectError(ProcessBuilder.Redirect.INHERIT)         .start().apply {             waitFor(60, TimeUnit.MINUTES)         } }  suspend fun Process.readString(): String {     var o = \"\"     val b = BufferedReader(InputStreamReader(inputStream))     var line = \"\"     while (b?.readLine()?.also { line = it } != null) o += line     return o }<\/code><\/pre>\n<p>\u041d\u0430 \u0432\u0445\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0443 <code>runInShell<\/code> \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 <code>commonMain<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c expect Composable-\u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0442\u0435\u043c\u0443 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435:<\/p>\n<pre><code class=\"kotlin\">@Composable expect fun platformIsSystemInDarkTheme(): Boolean<\/code><\/pre>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 <code>desktopMain<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438\u043c\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437 \u0432 0.1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0442\u0435\u043c\u0443:<\/p>\n<pre><code class=\"kotlin\">private const val command =     \"gdbus call --session --dest=org.freedesktop.portal.Desktop --object-path=\/org\/freedesktop\/portal\/desktop --method=org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme\"  @Composable actual fun platformIsSystemInDarkTheme(): Boolean {     var darkTheme by remember { mutableStateOf(false) }     LaunchedEffect(true) {<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-341618","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/341618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=341618"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/341618\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=341618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=341618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=341618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}