-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Flatpak/snap compatibility #26
Comments
Honestly, supporting flatpak and snap in betterdiscordctl has been a PITA… |
This function should be able to find the paths for both flatpak and snap but I haven't tested it: const {execSync} = require("child_process");
const getLinuxBasedir = function(channel) {
if (channel == "flatpak") {
const output = execSync("flatpak run --command=sh com.discordapp.Discord -c 'printf -- \"$XDG_CONFIG_HOME\"'");
return path.join(output.toString(), "discord");
}
if (channel == "snap") {
const output = execSync("echo 'printf -- \"$SNAP_USER_DATA\"' | snap run --shell discord");
return path.join(output.toString(), ".config", "discord");
}
return path.join(remote.app.getPath("userData"), "..", channel.toLowerCase().replace(" ", ""))
} It's up to you on how (and if) you will adapt the installer accordingly. |
Yeah I'm not sure yet about snap and flatpak support. It would also require a corresponding change in BD (at least for snap). |
Flatpak is also sandboxed so I assume it would require the same change. |
Also, don't forget Nix. |
Nix seems to work fine: NixOS/nixpkgs#118471 |
Good. Unfortunately, I have left discord (because it's garbage) so farewell, I won't be able to test it. |
I was interested in this feature myself, so I made this half-assed build with Flatpak compatibility. It seems to work, though. :) Here's how:
I've tested the install/repair/remove features and all of them work. I don't plan on upstreaming that |
About that fork, maybe flatpak option could be automatically applied when |
Or automatically applied anyway since it's a fork made specifically for flatpak… |
Thanks for the suggestions! It does make sense to make Flatpak the default one, so I did just that. I've updated the AppImage and instructions as well. |
if it ever gets installable on the normal installer put some more focus on flatpak. snap has security issues and flatpak has more priority on non canonical distros |
You can try |
+1
…On Fri, May 14 2021 at 12:43:51 PM -0700, alt1478 ***@***.***> wrote:
if it ever gets installable on the normal installer focus on flatpak.
snap has security issues and flatpak has more priority on non
canonical distros
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ3WNPAGGETY2TNL2HZFKWTTNV4PPANCNFSM42IQUUNQ>.
|
any update on this? |
Try betterdiscordctl as ObserverOfTime already said |
That's not an update |
It took you 2 months to come up with that retort? |
yes lol. i havent checked my gh notifs |
If we give the flatpak discord directory manually we get missing asar error, I solved by running this command: |
While ctl works for normal flatpak it'd be nice to see both beta and normal version since the beta on flathub is canary too. It stinks having to go back to the standard flatpak just to get compatibility on that end with @ObserverOfTime 's clt and just not having luck plugging in where it should be installed from what I can gather.... |
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
|
@ObserverOfTime LMFAO. You're the guy who made "betterdiscordctl". I noticed that you downvoted my clean solution 30 minutes after I posted it. The amount of saltiness in you doing without a word is hilarious. I'll upvote myself just to annoy you even more. 💋 |
Moving all discussion to #157 |
Is your feature request related to a problem? Please describe.
The current installer doesn't work in Flatpak.
Describe the solution you'd like
Add flatpak support. You might want to look into the code of
betterdiscordctl
to see how that would be done.Describe alternatives you've considered
I've tried changing the discord path to
~/.var/app/com.discordapp.Discord/config/discord
, but Discord just spit out a "fatal javascript error".The text was updated successfully, but these errors were encountered: