├── icons ├── flatline-128.png ├── flatline-48.png └── flatline-98.png ├── other ├── promotion │ └── badges │ │ ├── chrome.png │ │ ├── firefox.png │ │ └── donate_paypal.svg └── flatline.svg ├── manifest.json ├── .github └── FUNDING.yml ├── LICENSE ├── README.md └── main.js /icons/flatline-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CleoMenezesJr/flatline/HEAD/icons/flatline-128.png -------------------------------------------------------------------------------- /icons/flatline-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CleoMenezesJr/flatline/HEAD/icons/flatline-48.png -------------------------------------------------------------------------------- /icons/flatline-98.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CleoMenezesJr/flatline/HEAD/icons/flatline-98.png -------------------------------------------------------------------------------- /other/promotion/badges/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CleoMenezesJr/flatline/HEAD/other/promotion/badges/chrome.png -------------------------------------------------------------------------------- /other/promotion/badges/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CleoMenezesJr/flatline/HEAD/other/promotion/badges/firefox.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Flatline", 4 | "version": "1.6", 5 | 6 | "description": "Select apps directly from your favorite software center by clicking Install from Flathub, apps.gnome and AppCenter.", 7 | 8 | "icons": { 9 | "48": "icons/flatline-48.png" 10 | }, 11 | 12 | "content_scripts": [ 13 | { 14 | "matches": [ 15 | "https://flathub.org/*", 16 | "https://apps.gnome.org/*", 17 | "https://appcenter.elementary.io/*" 18 | ], 19 | "js": ["main.js"] 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: cleomenezesjr # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Cleo Menezes Jr. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flatline 2 | 3 | ##### Select apps directly from your favorite software center by clicking Install from Flathub, apps.gnome and AppCenter. 4 | 5 | ## Installation 6 | 7 | [for Firefox](https://addons.mozilla.org/firefox/addon/flatline-flatpak/) 8 | [for Chrome](https://chrome.google.com/webstore/detail/flatline/cpbniogoilfagmcoipghkgnpmdglfmjm/)
9 | 10 | ##### Epiphany (GNOME Web) 11 | 12 | 1. Enable Web Extensions (This feature is experimental) 13 | - - > flatpak run --command=gsettings org.gnome.Epiphany set org.gnome.Epiphany.web:/org/gnome/epiphany/web/ enable-webextensions true 14 | 2. Download Flatline via addons.mazilla.org 15 | 3. Open GNOME Web and go to Preferences > Extensions 16 | 4. Click on Add New Extension and choose the file you previously downloaded 17 |
18 | 19 | ## The Why 20 | 21 | Flatline was created to facilitate the installation process of Flatpak applications from the websites flathub.org, app.gnome.org and appcenter.elementary.io. 22 | 23 | ## Support 24 | 25 | - [x] [Flathub](https://flathub.org/) 26 | - [x] [Flathub Beta](https://beta.flathub.org/) 27 | - [x] [Apps GNOME](https://apps.gnome.org/) 28 | - [x] [AppCenter](https://appcenter.elementary.io/) 29 | 30 | ## Requirements 31 | 32 | - [Flatpak](https://github.com/flatpak/flatpak) installed. 33 | - [Flathub](https://www.flatpak.org/setup/) and/or other Flatpak repository. 34 | - [GNOME Software](https://apps.gnome.org/app/org.gnome.Software/) or any software center with Flatpak support. 35 | 36 | ## Donations 37 | 38 | [Paypal donation](https://www.paypal.com/donate/?hosted_button_id=7KDCH44AMMCS2) 39 | [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/P5P2DSC5F) 40 | 41 | ## Known Limitations 42 | 43 | Flatline basically uses AppStream to tell GNOME Software (or any software center with Flatpak support) which app to show, however there is no way to specify which repository to show. 44 | When opening it will be necessary to manually choose the repository. 45 | If you use distributions that focus heavily on using Flatpaks like Fedora Silverblue, you won't notice this. 46 | 47 | ## Development 48 | 49 | 1. Clone the repository 50 | 2. Open Firefox browser and navigate to `about:debugging` 51 | 3. Click "Load Temporary Add-on" and from the file browser, choose `manifest.json` 52 | 53 | ## Special thanks 54 | 55 | I want to thank [Lains](https://github.com/lainsce) for taking the trouble to create such a cool icon, thanks also to [Nahuel](https://github.com/nahuelwexd) for bringing the idea to the table. 56 | -------------------------------------------------------------------------------- /other/flatline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | const checkExist = setInterval(() => { 2 | let title = document.querySelector("title"); 3 | 4 | if (title != null) { 5 | function callback(mutations) { 6 | const url = new URL(window.location); 7 | const pathname = url.pathname; 8 | 9 | if (url.hostname === "flathub.org") replaceFlathubButton(pathname); 10 | else if (url.hostname === "apps.gnome.org") 11 | replaceAppsGnomeLink(pathname); 12 | else if (url.hostname === "appcenter.elementary.io") 13 | replaceAppCenterLink(pathname); 14 | } 15 | let observer = new MutationObserver(callback); 16 | let config = { 17 | childList: true, 18 | subtree: true, 19 | attributes: true, 20 | characterData: true, 21 | }; 22 | 23 | observer.observe(title, config); 24 | clearInterval(checkExist); 25 | callback(); 26 | } 27 | }, 500); 28 | 29 | function replaceAppsGnomeLink(pathname) { 30 | const appsGnomeInstallButton = document.querySelector("a.text-button"); 31 | const occurrences = (pathname.match(/\//g) || []).length; 32 | const app = 33 | occurrences == 4 ? pathname.split("/")[3] : pathname.split("/")[2]; 34 | if (pathname.includes("/app/")) 35 | appsGnomeInstallButton.href = "appstream:" + app; 36 | } 37 | 38 | function replaceFlathubButton(pathname) { 39 | const languageButtonsLabel = { 40 | id: "Pasang", 41 | "pt-BR": "Instalar", 42 | ca: "Instal·lar", 43 | cs: "Nainstalovat", 44 | de: "Installieren", 45 | // "et" needs website translation 46 | es: "Instalar", 47 | eo: "Instali", 48 | fr: "Installer", 49 | hr: "Instaliraj", 50 | it: "Installa", 51 | lt: "Įdiegti", 52 | hu: "Telepítés", 53 | nl: "Installeren", 54 | // "nb-NO" needs website translation 55 | pl: "Zainstaluj", 56 | pt: "Instalar", 57 | fi: "Asenna", 58 | vi: "Cài đặt", 59 | tr: "Kur", 60 | // "el" needs website translation 61 | be: "Усталяваць", 62 | bg: "Инсталиране", 63 | ru: "Установить", 64 | uk: "Установити", 65 | ar: "ثبِّت", 66 | fa: "نصب", 67 | // "hi" needs website translation 68 | bn: "ইনস্টল করুন", 69 | ta: "நிறுவவும்", 70 | si: "ස්ථාපනය", 71 | ja: "インストール", 72 | "zh-Hans": "安装", 73 | "zh-Hant": "安裝", 74 | }; 75 | let currentLanguage; 76 | 77 | for (let key in languageButtonsLabel) { 78 | if (pathname.includes(`/${key}/`)) { 79 | currentLanguage = key; 80 | } 81 | } 82 | 83 | let oldButton = document 84 | .evaluate( 85 | `//*[text()="${languageButtonsLabel[currentLanguage] || "Install"}"]`, 86 | document, 87 | null, 88 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE 89 | ) 90 | .snapshotItem(0); 91 | 92 | if (oldButton) { 93 | let newButton = oldButton.cloneNode(true); 94 | 95 | if (newButton.id != "customInstallButton") { 96 | newButton.id = "customInstallButton"; 97 | newButton.removeAttribute("href"); 98 | newButton.href = 99 | "appstream:" + 100 | oldButton.href.split("/").pop().replace(".flatpakref", ""); 101 | oldButton.parentNode.replaceChild(newButton, oldButton); 102 | } 103 | } 104 | } 105 | 106 | function replaceAppCenterLink(pathname) { 107 | document.querySelectorAll("a").forEach((el) => { 108 | if (el.innerText == "Download as Flatpak") { 109 | el.href = "appstream:" + pathname; 110 | } 111 | }); 112 | } 113 | -------------------------------------------------------------------------------- /other/promotion/badges/donate_paypal.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 15 | 16 | 18 | 19 | 56 | 57 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | --------------------------------------------------------------------------------