-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EPIC] Snap and Flatpak compatibility #157
Comments
Snap is also sandboxed.
This is, unfortunately, true. |
Fedora and Ubuntu, two of the biggest distros, according to Panic! at the Distro, now prefer installing through Flatpak and Snap respectively. |
Yet another reason to use Arch. |
The solution is not to use Arch. This isn't an Arch vs. other distros thread. Please keep your distro supremacy out of here and make actually useful comments. |
The solution in Fedora is to actually use DNF instead of some dumb GUI that may use flatpak. |
I have just installed discord via flatpak on my arch based distro and it seems currently installing betterdiscord into the flatpak is not a trivial task and basically not supported? I tried passing the path to the discord executable or the discord directory to |
ahh, the betterdiscord installer I guess can't handle it, but the (older?) betterdiscordctl can do it? (https://gist.github.com/ObserverOfTime/d7e60eb9aa7fe837545c8cb77cf31172) |
Hey... I don't see what all the fuss is about and why this has been discussed for years, or even why anyone needs or trusts those "fancy" "betterdiscordctl" or "BetterDiscord-Installer.AppImage" tools anyway. It's literally just 1 little
I wrote this oneliner which automatically installs/updates BetterDiscord. It's really that easy, yes. Compare my simple line below to the huge, bloated code (example) of the other methods...
📓 The Code:DISC_CONFIG="$HOME/.var/app/com.discordapp.Discord/config/discord" && BD_ASAR=betterdiscord.asar && wget --timestamping -P "${DISC_CONFIG}/../BetterDiscord/data" -- "https://github.com/BetterDiscord/BetterDiscord/releases/latest/download/${BD_ASAR}" && DISC_VER="$(ls --sort=time --time=creation "${DISC_CONFIG}" | grep -E -m 1 '^[0-9]+\.[0-9]+\.[0-9]+$')" && echo -e "require('../../../../BetterDiscord/data/${BD_ASAR}');\nmodule.exports = require('./core.asar');" | tee "${DISC_CONFIG}/${DISC_VER}/modules/discord_desktop_core/index.js" && echo -e "\nBetterDiscord installed. Restart Discord if currently running." || echo -e "\nInstallation failed."
😎 You can set the Discord version that you want to install into as follows:
🍓 How to use:Just run that command, and it will do the following:
That's it. Just save this command somewhere. Run it once. That's it. Run it again when you want to update BetterDiscord. You can run it as many times as you want, since it won't change anything if BetterDiscord is already installed and up-to-date.
⬆️ Making an easy auto-update alias:You can even make an alias in your alias betterdiscord-update="DISC_CONFIG=\"\$HOME/.var/app/com.discordapp.Discord/config/discord\" && BD_ASAR=betterdiscord.asar && wget --timestamping -P \"\${DISC_CONFIG}/../BetterDiscord/data\" -- \"https://github.com/BetterDiscord/BetterDiscord/releases/latest/download/\${BD_ASAR}\" && DISC_VER=\"\$(ls --sort=time --time=creation \"\${DISC_CONFIG}\" | grep -E -m 1 '^[0-9]+\\.[0-9]+\\.[0-9]+\$')\" && echo -e \"require('../../../../BetterDiscord/data/\${BD_ASAR}');\\nmodule.exports = require('./core.asar');\" | tee \"\${DISC_CONFIG}/\${DISC_VER}/modules/discord_desktop_core/index.js\" && echo -e \"\\nBetterDiscord installed. Restart Discord if currently running.\" || echo -e \"\\nInstallation failed.\"" (Be sure to set your personal
|
This comment was marked as off-topic.
This comment was marked as off-topic.
It's always amusing seeing someone so confidently proclaim, "that code is so bloated! just use this: {700 character unreadable one-liner with a quarter the functionality". |
@Parent5446 You seriously mean that you work at Google yet are incapable of reading two shell commands? One And I would rather be 45 easily audited, clean words (652 characters) than the 670 awfully written, self-updating spaghetti LINES (20661 characters/2301 words) with such awful newbie practices such as hard-coding the absolute path to the BetterDiscord.asar, meaning that Discord breaks if it's moved, lmfao. Seriously, the hard-coded path is astonishing since the default index.js literally contains a relative path already, as if to hint "hey, use a relative path, dummy". But not only is it bloated and shoddily written. You also have to trust the author never to add malware to it. Both solutions install BetterDiscord into any Discord or Canary client. What else exactly do you need? 😂 My solution also supports the Discord CANARY Flatpak by the way, unlike the one you use. So my one-liner has more features. In fact, my solution does error checking along every step of the installation, so it is completely reliable. Seriously, what else do you need? If you are gonna say "uninstallation" then lmao, why would you uninstall BetterDiscord? And if you do, then it is literally just a matter of deleting the BetterDiscord folder and removing the reference to it from Discord's index.js. Something that doesn't need a script, since it is super obvious from the one-liner exactly where that file resides. But again, why would anyone uninstall BetterDiscord? It is literally a better version of Discord. I will never use your bloated, pointless script for something so easily solved in 45 words. |
as an end user I prefer graphical applications. And betterdiscordctl is at least readable and easy to use. If you don't wanna do either of those, then at least you could have written your comment not as toxic as you did. Just say you would rather use a single line of stacked commands and anyone, who prefers that, there u go. |
Thoughts on your code being "unreliable spaghetti with awful newbie practices". @bb010g |
Please direct design criticism of
237 lines are help text & argument parsing. The argument parsing is extremely boilerplate & easily auditable. Bash is not a great language. 66 lines are semver parsing & comparison for the auto-updating functionality, which you can disable in one line, and is disabled when I would love to have a better updating system than the current setup, and when available, I'd recommend using I do believe that
You do have to trust me not to add malware to it. If you want to manually review changes, disable auto-update.
This is an open issue (bb010g/betterdiscordctl#143). I've been busy with work, but will get to this in the next few days if nobody else does first.
This may be simple for technical users, but not everyone wants to bother discovering how BetterDiscord's internals work, and If someone wants to uninstall BetterDiscord, |
Sure, I'll have a look at fixing the BetterDiscord-Installer code. @bb010g Don't worry, you're in good company. The BetterDiscord-Installer code is spaghetti too, such as defining static variables with dynamic values outside functions, using dynamic data that is created inside other functions, and then using those global, static variables as input data for functions that take ZERO arguments, all while passing data to other scripts by importing those scripts so that they inherit the variables (rather than using function parameters). It's a total... mess. In pseudocode, BetterDiscord-Installer does things like this: // file: core.js:
const discordPath = getDiscordPath();
require("./install.js");
// file: install.js:
const bdFile = path.join(discordPath, "BetterDiscord.asar");
function write() {
writeto(bdFile);
} They literally forgot how passing arguments works. 🤣 It will make it a bit trickier to fix the bugs and untangle some of this mess. I'll see about making BetterDiscord-Installer work on Linux again, and adding Flatpak support to it. The code is a mess but it shouldn't be too terrible to rewrite the spaghetti parts that are involved with paths and installation. 👍 Edit: It's done. Releasing the pull request tomorrow since it's time to sleep. Edit: Today, instead of submitting the pull request, I decided to throw in a lot more surprises for people (you'll have to wait and see, otherwise it wouldn't be a surprise). But I didn't have much time today since this is a project that I don't personally use, and I have a lot of other important things to do. But everything related to BetterDiscord-Installer is done now, and the pull request and an AppImage for users will be released tomorrow! |
The BetterDiscord installer doesn't support Flatpak or Snap. The first Linux distros start seemlessly integrating these types of packages in their software store and as their main method of installation.
Well, to be fair saying that the installer doesn't support snap isn't quite right either. Rather it explicitly blocks installing to snap even though it would otherwise be supported.
Installer/src/renderer/actions/paths.js
Lines 84 to 87 in 1bf733d
Flatpak on the other hand actually needs some more work because of it's sandboxing by the looks of it. More specifically it can't read the
betterdiscord.asar
from user's config directory, so it needs to be installed in the flatpak's config directory.The snap installation has a related problem. because it's
betterdiscord.asar
is in the user config directory while the detected config directory is in the snap package's directory the autoupdate functionality of BD is expected to fail.From a chat with @Tropix126 I could gather that it wasn't always compatible but changing it to injection method to inject the
require
statement in thediscord_desktop_core/index.js
module seems to have made it otherwise compatible. In factbetterdiscordctl
's installation method is identical to the installer. The only relevant change for BD installation is changing the config directory detection depending on the detected.betterdiscordctl's installation steps for comparison (warning: identical to the installer)
.toLowercase().replace(" ","")
everywhereDiscord - Snap
andDiscord - Flatpak
platform as needed,The text was updated successfully, but these errors were encountered: