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

Flathub support #12

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
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
43 changes: 43 additions & 0 deletions flatpak/com.andersonlaverde.slacky.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
app-id: com.andersonlaverde.slacky
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: run.sh
base: org.electronjs.Electron2.BaseApp
base-version: '23.08'
finish-args:
- --share=ipc
- --socket=x11
- --socket=pulseaudio
- --share=network
- --filesystem=xdg-documents
- --filesystem=xdg-download
- --talk-name=org.freedesktop.Notifications

modules:
- name: slacky
buildsystem: simple
build-options:
env:
XDG_CACHE_HOME: /run/build/slacky/flatpak-node/cache
npm_config_cache: /run/build/slacky/flatpak-node/npm-cache
npm_config_nodedir: /usr/lib/sdk/node18
npm_config_offline: 'true'
ELECTRON_BUILDER_CACHE: /run/build/slacky/flatpak-node/electron-builder-cache
build-commands:
- npm install --offline
- npm run build
- . ../flatpak-node/electron-builder-arch-args.sh
- npm run pack -- $ELECTRON_BUILDER_ARCH_ARGS --linux flatpak --arm64
- cp -a dist/packages/* /app/main/
- install -Dm755 -t /app/bin/ ../run.sh
sources:
- type: git
url: https://github.com/andirsun/slack-arm64.git
tag: v0.0.2
- type: script
dest-filename: run.sh
commands:
- zypak-wrapper.sh /app/main/slacky "$@"
- type: file
path: generated-sources.json # Generated by flatpak-node-generator
8 changes: 5 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default class Main {
roundedCorners: true,
width: 1920,
height: 1080,
title: 'Slack ARM',
autoHideMenuBar: true,
title: 'Slacky',
center: true,
webPreferences: {
nodeIntegration: true
Expand All @@ -42,8 +42,10 @@ export default class Main {
})

Main.mainWindow.loadURL(SLACK_APP_URL, {
// TODO: Fix this hacky way to get around Slack's user agent check
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/53/7.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.71 Safari/537.36'
/**
* We have to emulate a supported Browser because arm64 + Electron is not supported by slack client app
*/
userAgent: 'Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'
})

Main.mainWindow.on('closed', Main.onClose)
Expand Down