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

Add flatpak support #485

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion injectors/linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const KnownLinuxPaths = Object.freeze([
'/usr/lib64/discord-canary',
'/opt/discord-canary',
'/opt/DiscordCanary',
`${homedir}/.local/bin/DiscordCanary` // https://github.com/powercord-org/powercord/pull/370
`${homedir}/.local/bin/DiscordCanary`, // https://github.com/powercord-org/powercord/pull/370
'/var/lib/flatpak/app/com.discordapp.DiscordCanary/current/active/files/discord-canary', // flatpak system install https://github.com/flathub/com.discordapp.DiscordCanary
`${homedir}/.local/share/flatpak/app/com.discordapp.DiscordCanary/current/active/files/discord-canary` // flatpak user install
]);


Expand Down
6 changes: 6 additions & 0 deletions injectors/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ exports.inject = async ({ getAppDir }) => {
console.log(`${AnsiEscapes.YELLOW}NOTE:${AnsiEscapes.RESET} If you already have BetterDiscord or another client mod injected, Powercord cannot run along with it!`);
console.log('Read our FAQ for more details: https://powercord.dev/faq#bd-and-pc');
return false;
} else if (appDir.includes('flatpak')) {
const command = appDir.startsWith('/var') ? 'sudo flatpak override' : 'flatpak override --user';

console.log(`${AnsiEscapes.YELLOW}NOTE:${AnsiEscapes.RESET} It seems like your Discord Canary install is a flatpak`);
console.log(' You need to update its permissions so it can access the powercord directory');
console.log(` You can do so by running ${AnsiEscapes.YELLOW}${command} --filesystem=${join(__dirname, '..')} com.discordapp.DiscordCanary${AnsiEscapes.RESET}`);
}

await mkdir(appDir);
Expand Down