Skip to content

Commit 54a34b6

Browse files
committed
Add Debian package build
The changes include: - Adding Debian package as build target - Bumping version to 0.4.0 - Adding settings module and channel selection - Refactoring modules into dedicated directories - Removing unused files and code cleanup - Adding app restart functionality - Installing React dev tools in dev mode
1 parent 77061f7 commit 54a34b6

File tree

17 files changed

+1141
-34
lines changed

17 files changed

+1141
-34
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"appId": "com.ragestudio.comty-desktop",
3+
"productName": "comty-desktop",
4+
"files": [
5+
"src/**/**",
6+
"resources/**/**",
7+
"!electron.vite.config.{js,ts,mjs,cjs}",
8+
"!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}",
9+
"!{.env,.env.*,.npmrc,pnpm-lock.yaml}"
10+
],
11+
"win": {
12+
"executableName": "Comty",
13+
"icon": "resources/icon.ico"
14+
},
15+
"nsis": {
16+
"artifactName": "${productName}-${version}-setup.${ext}",
17+
"shortcutName": "${productName}",
18+
"uninstallDisplayName": "${productName}",
19+
"createDesktopShortcut": "always"
20+
},
21+
"mac": {
22+
"icon": "resources/icon.icns",
23+
"notarize": false
24+
},
25+
"dmg": {
26+
"artifactName": "${productName}-${version}.${ext}"
27+
},
28+
"linux": {
29+
"target": ["AppImage", "deb"],
30+
"maintainer": "ragestudio.net",
31+
"category": "Entertainment",
32+
"icon": "resources/icon-512.png"
33+
},
34+
"appImage": {
35+
"artifactName": "${productName}-${version}.${ext}"
36+
},
37+
"npmRebuild": false
38+
}

packages/desktop/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
{
2+
<<<<<<< HEAD
23
"name": "@comty/desktop",
34
"version": "0.1.0",
5+
=======
6+
"name": "comty-desktop",
7+
"appName": "Comty",
8+
"processName": "comty-desktop",
9+
"version": "0.4.0",
10+
>>>>>>> c3cd0d3c (Add Debian package build)
411
"license": "MIT",
512
"type": "module",
613
"main": "./src/main.js",
714
"scripts": {
815
"dev": "electron ."
916
},
1017
"devDependencies": {
18+
<<<<<<< HEAD
1119
"electron": "^37.2.1"
20+
=======
21+
"electron": "^37.2.1",
22+
"electron-builder": "^26.0.12",
23+
"electron-devtools-installer": "^4.0.0"
24+
>>>>>>> c3cd0d3c (Add Debian package build)
1225
},
1326
"dependencies": {
1427
"electron-store": "^10.1.0"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"desktop:app_channel": "stable"
3+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import ElectronStore from "electron-store"
2+
3+
import defaults from "./default.json" with { type: "json" }
4+
5+
export default class Settings {
6+
constructor(main) {
7+
this.main = main
8+
this.store = new ElectronStore({
9+
name: "settings",
10+
defaults: defaults,
11+
})
12+
13+
return this.store
14+
}
15+
}

packages/desktop/src/flags.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
export default (app) => {
2+
if (process.argv.some((arg) => arg === "--no-flags")) return
3+
4+
const disableFeatures = [
5+
"UseChromeOSDirectVideoDecoder",
6+
"HardwareMediaKeyHandling",
7+
"MediaSessionService",
8+
"WebRtcAllowInputVolumeAdjustment",
9+
"Vulkan",
10+
]
11+
const enableFeatures = [
12+
"WebRTC",
13+
"WebRtcHideLocalIpsWithMdns",
14+
"PlatformHEVCEncoderSupport",
15+
"EnableDrDc",
16+
"CanvasOopRasterization",
17+
"UseSkiaRenderer",
18+
]
19+
20+
if (process.platform === "linux") {
21+
// enableFeatures.push("PulseaudioLoopbackForScreenShare")
22+
23+
if (!process.argv.some((arg) => arg === "--no-vaapi")) {
24+
enableFeatures.push(
25+
"AcceleratedVideoDecodeLinuxGL",
26+
"AcceleratedVideoEncoder",
27+
"AcceleratedVideoDecoder",
28+
"AcceleratedVideoDecodeLinuxZeroCopyGL",
29+
)
30+
}
31+
}
32+
33+
if (process.platform === "win32") {
34+
disableFeatures.push("CalculateNativeWinOcclusion")
35+
}
36+
37+
const switches = [
38+
["enable-gpu-rasterization"],
39+
["enable-zero-copy"],
40+
["disable-low-res-tiling"],
41+
["disable-site-isolation-trials"],
42+
[
43+
"enable-hardware-overlays",
44+
"single-fullscreen,single-on-top,underlay",
45+
],
46+
["autoplay-policy", "no-user-gesture-required"],
47+
["enable-speech-dispatcher"],
48+
["disable-http-cache"], // Work around https://github.com/electron/electron/issues/40777
49+
["gtk-version", "3"], // https://github.com/electron/electron/issues/46538
50+
// disable renderer backgrounding to prevent the app from unloading when in the background
51+
["disable-renderer-backgrounding"],
52+
["disable-background-timer-throttling"],
53+
["disable-disable-backgrounding-occluded-windows"],
54+
["disable-features", disableFeatures.join(",")],
55+
["enable-features", enableFeatures.join(",")],
56+
]
57+
58+
for (const [key, val] of switches) {
59+
app.commandLine.appendSwitch(key, val)
60+
}
61+
}

packages/desktop/src/ipc.js

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,109 @@ export default {
88
"window:close": (ctx) => {
99
ctx.mainWindow.hide()
1010
},
11+
"app:restart": (ctx) => {
12+
ctx.restart()
13+
},
14+
"desktopcapturer:initialize": async (ctx) => {
15+
const desktopCapturerModule = ctx.modules.get("desktopCapturer")
16+
17+
if (!desktopCapturerModule) {
18+
throw new Error("DesktopCapturer module is not available")
19+
}
20+
21+
return await desktopCapturerModule.initialize()
22+
},
23+
"pulseaudio:getSources": async (ctx) => {
24+
const pulseaudioModule = ctx.modules.get("pulseaudio")
25+
26+
if (!pulseaudioModule) {
27+
throw new Error("Pulseaudio module is not available")
28+
}
29+
30+
return await pulseaudioModule.getSources()
31+
},
32+
33+
"pulseaudio:getSourceOutputs": async (ctx) => {
34+
const pulseaudioModule = ctx.modules.get("pulseaudio")
35+
36+
if (!pulseaudioModule) {
37+
throw new Error("Pulseaudio module is not available")
38+
}
39+
40+
return await pulseaudioModule.getSourceOutputs()
41+
},
42+
"pulseaudio:getSourceInputs": async (ctx) => {
43+
const pulseaudioModule = ctx.modules.get("pulseaudio")
44+
45+
if (!pulseaudioModule) {
46+
throw new Error("Pulseaudio module is not available")
47+
}
48+
49+
return await pulseaudioModule.getSourceInputs()
50+
},
51+
52+
"pipewire:getNodes": async (ctx) => {
53+
const pipewireModule = ctx.modules.get("pipewire")
54+
55+
if (!pipewireModule) {
56+
throw new Error("Pipewire module is not available")
57+
}
58+
59+
return await pipewireModule.getNodes()
60+
},
61+
"pipewire:getOutputNodes": async (ctx) => {
62+
const pipewireModule = ctx.modules.get("pipewire")
63+
64+
if (!pipewireModule) {
65+
throw new Error("Pipewire module is not available")
66+
}
67+
68+
return await pipewireModule.getOutputNodes()
69+
},
70+
"pipewire:getInputNodes": async (ctx) => {
71+
const pipewireModule = ctx.modules.get("pipewire")
72+
73+
if (!pipewireModule) {
74+
throw new Error("Pipewire module is not available")
75+
}
76+
77+
return await pipewireModule.getInputNodes()
78+
},
79+
80+
"desktopcapturer:getAudioLoopbackRemapDeviceId": (ctx) => {
81+
const desktopCapturerModule = ctx.modules.get("desktopCapturer")
82+
83+
if (!desktopCapturerModule) {
84+
throw new Error("DesktopCapturer module is not available")
85+
}
86+
87+
return desktopCapturerModule.audioRemap
88+
},
89+
"desktopcapturer:getAudioLoopbackDeviceId": (ctx) => {
90+
const desktopCapturerModule = ctx.modules.get("desktopCapturer")
91+
92+
if (!desktopCapturerModule) {
93+
throw new Error("DesktopCapturer module is not available")
94+
}
95+
96+
return desktopCapturerModule.audioLoopback
97+
},
98+
"desktopcapturer:startSystemAudioCapture": async (ctx) => {
99+
const desktopCapturerModule = ctx.modules.get("desktopCapturer")
100+
101+
if (!desktopCapturerModule) {
102+
throw new Error("DesktopCapturer module is not available")
103+
}
104+
105+
return await desktopCapturerModule.startSystemAudioCapture()
106+
},
107+
"desktopcapturer:stopSystemAudioCapture": async (ctx) => {
108+
const desktopCapturerModule = ctx.modules.get("desktopCapturer")
109+
110+
if (!desktopCapturerModule) {
111+
throw new Error("DesktopCapturer module is not available")
112+
}
113+
114+
return await desktopCapturerModule.stopSystemAudioCapture()
115+
},
11116
}

0 commit comments

Comments
 (0)