Skip to content
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

Issue with Flatpak Installation #62

Open
scotbud123 opened this issue Nov 15, 2018 · 6 comments · May be fixed by #65
Open

Issue with Flatpak Installation #62

scotbud123 opened this issue Nov 15, 2018 · 6 comments · May be fixed by #65

Comments

@scotbud123
Copy link

scotbud123 commented Nov 15, 2018

Hi there,

I'm wondering what the best way to go about using BD with the Flatpak version (a.k.a what Linix Mint uses as their software manager installer).

Because it installs to /var/lib/flatpak/app/com.discordapp.Discord instead of the normal location, I then get the message Could not find Discord executable. when I run BD.

This makes sense, but is there any way to go about fixing this other than installing Discord through the normal .deb off their website? Having Flatpak deal with updates and etc makes it a million times easier.

Thanks in advance guys!

Edit: To be more direct, the actual Discord location us a sub-folder of the one above:
/var/lib/flatpak/app/com.discordapp.Discord/x86_64/stable/3ac6f4539e8d5caaa8cc9e82fcaa75649d63c51c0eb7f930ae3f6f88659a5b63

@SparrowOchon
Copy link

SparrowOchon commented Dec 7, 2018

Names in Flatpak are not necessarily the same name for native discord. While discord is running you can run the following command to see the name of the running discord instance: ps -eo comm=, | grep 'cord'. In the case of Discord build under flathub the process name is lowercased.

In the app.py file change the following line;
if exe.startswith('Discord') and not exe.endswith('Helper'):
to
if exe.startswith('discord') and not exe.endswith('helper'):

And make sure that the Flatpak instance of Discord is running when installing BD.

@ElDifinitivo
Copy link

After installing and changing app.py as you stated in order for the script to work with a flatpak installation, I receive this Traceback error:

❯ beautifuldiscord --css ~/etc/discord_css/main.css
Found discord under /app/extra
Traceback (most recent call last):
  File "/home/$HOME/.local/bin/beautifuldiscord", line 11, in <module>
    sys.exit(main())
  File "/home/$HOME/.local/lib/python3.7/site-packages/beautifuldiscord/app.py", line 216, in main
    os.chdir(discord.script_path)
  File "/home/$HOME/.local/lib/python3.7/site-packages/beautifuldiscord/app.py", line 78, in script_path
    for subdirectory in os.listdir(config):
FileNotFoundError: [Errno 2] No such file or directory: '/home/$HOME/.config/extra'

Trying with python3.7 and flatpak v0.0.8.

@SparrowOchon
Copy link

SparrowOchon commented Apr 11, 2019

Did you spin your own flatpak file or did you pull one off flathub ?. This error seems to be based off the fact your extra folder is not in the expected location. Are you able to try mkdir -p ~/.config/extra/ and trying it again.

Edit: just noticed it's looking for /home/$HOME/.config/extra instead of /home/$USER/.config/extra might be related to the issue.

@Dormanil
Copy link

Dormanil commented Jun 9, 2019

I am assuming @ElDifinitivo was obfuscating their username in that console log. Either way, mkdir -p ~/.config/extra/ does not fix the issue, now I am stuck on this:

BeautifulDiscord) [kazumi@kagayakitai BeautifulDiscord]$ beautifuldiscord
Found discord under /app/extra
Traceback (most recent call last):
  File "/home/kazumi/aur/BeautifulDiscord/bin/beautifuldiscord", line 11, in <module>
    load_entry_point('BeautifulDiscord==0.1.0', 'console_scripts', 'beautifuldiscord')()
  File "/home/kazumi/aur/BeautifulDiscord/lib/python3.7/site-packages/beautifuldiscord/app.py", line 222, in main
    args.css = os.path.join(discord.script_path, 'discord-custom.css')
  File "/home/kazumi/aur/BeautifulDiscord/lib/python3.7/site-packages/beautifuldiscord/app.py", line 92, in script_path
    raise RuntimeError('Could not find discord application version under "{}".'.format(config))
RuntimeError: Could not find discord application version under "/home/kazumi/.config/extra".
(BeautifulDiscord) [kazumi@kagayakitai BeautifulDiscord]$ 

@SparrowOchon
Copy link

SparrowOchon commented Jun 18, 2019

From the log you posted it seems like /app/extra contains the files that should be in /.config/extra if you were to symlink the /app/extra folder to point to /.config/extra that should resolve the current issue. I'll update this PR when I get a chance to create a more complete fix.

Try looking for the directory containing the discord modules. The easiest way is to look for the file discord_desktop_core with the locate command. This will give you a path containing discords modules. Take that general path and symlink it to ~/.config/extra

As such if the modules are under ~/.config/discordcanary/0.0.xx/modules/discord_desktop_core you'd want to symlink ~/.config/extra to ~/.config/discordcanary

@SparrowOchon
Copy link

SparrowOchon commented Jul 2, 2019

Please retry with the PR #65, the Config paths are now dynamically fetched @ElDifinitivo @Dormanil. As for the error that will appear about unable to find the cssInjection simply navigate to the folder defined in the error message and change the permissions of the file.

@leovoel When users run discord through means such as flatpak the process is not able to relaunch through normal means as it requires the prefix flatpak run <Package Name>. For the time being I set it to tell the users to manually re-run the process. This should be rectified in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants