@@ -4,43 +4,85 @@ import path from "node:path";
44
55import { MakerDMG } from "@electron-forge/maker-dmg" ;
66import { MakerSquirrel } from "@electron-forge/maker-squirrel" ;
7+ import { MakerFlatpak } from "@electron-forge/maker-flatpak" ;
78
8- const getAppIcon = ( ) => {
9- const iconExtension =
10- process . platform === "win32"
11- ? "ico"
12- : process . platform === "darwin"
13- ? "icns"
14- : "png" ;
15-
16- return path . resolve (
17- import . meta. dirname ,
18- `./resources/appicons/${ iconExtension } /icon.${ iconExtension } ` ,
19- ) ;
20- } ;
9+ const iconExtension =
10+ process . platform === "win32"
11+ ? "ico"
12+ : process . platform === "darwin"
13+ ? "icns"
14+ : "png" ;
15+ const iconRelative = `resources/appicons/${ iconExtension } /icon.${ iconExtension } ` ;
16+ const icon = path . join ( import . meta. dirname , iconRelative ) ;
2117
2218/** @type {import("@electron-forge/shared-types").ForgeConfig } */
2319const config = {
2420 packagerConfig : {
25- icon : getAppIcon ( ) ,
21+ icon,
2622 ignore : [
2723 / ^ \/ ( s r c ) | ( t o o l s ) | ( .g i t h u b ) | ( .v s c o d e ) / ,
28- / \/ ( .e s l i n t r c . j s o n ) | ( . g i t i g n o r e ) | ( .g i t a t t r i b u t e s ) | ( e l e c t r o n .v i t e .c o n f i g .t s ) | ( f o r g e .c o n f i g .c j s ) | ( t s c o n f i g . j s o n ) | ( b i n d l .c o n f i g .j s ) | ( b i n d l . c o n f i g . j s ) | ( R E A D M E .m d ) $ / ,
24+ / \/ ( .g i t i g n o r e ) | ( .g i t a t t r i b u t e s ) | ( e l e c t r o n .v i t e .c o n f i g .t s ) | ( e s l i n t .c o n f i g .j s ) | ( f o r g e . c o n f i g . j s ) | ( p r e t t i e r .c o n f i g .j s ) | ( r e n o v a t e . j s o n ) | ( t s c o n f i g . j s o n ) | ( R E A D M E .m d ) $ / ,
2925 ] ,
3026 // Prevents the app from showing up in the dock on macOS
3127 extendInfo : {
3228 LSUIElement : true ,
3329 } ,
30+ // https://github.com/electron/forge/issues/2805#issuecomment-3193871995
31+ ...( process . platform === "linux"
32+ ? { executableName : "clipboard-sync" }
33+ : { } ) ,
3434 } ,
3535 rebuildConfig : { } ,
3636 makers : [
3737 new MakerSquirrel ( {
3838 name : "clipboard_sync" ,
39- setupIcon : getAppIcon ( ) ,
40- iconUrl : getAppIcon ( ) ,
39+ setupIcon : icon ,
40+ iconUrl : `https://raw.githubusercontent.com/felipecrs/clipboard-sync/refs/heads/master/ ${ iconRelative } ` ,
4141 } ) ,
4242 new MakerDMG ( {
43- icon : getAppIcon ( ) ,
43+ icon,
44+ } ) ,
45+ new MakerFlatpak ( {
46+ options : {
47+ id : "io.github.felipecrs.ClipboardSync" ,
48+ // @ts -expect-error - this is the correct way
49+ icon : {
50+ "512x512" : icon ,
51+ } ,
52+ categories : [ "Utility" ] ,
53+ sdk : "org.freedesktop.Sdk" ,
54+ runtime : "org.freedesktop.Platform" ,
55+ runtimeVersion : "24.08" ,
56+ base : "org.electronjs.Electron2.BaseApp" ,
57+ baseVersion : "24.08" ,
58+ finishArgs : [
59+ // Needed to monitor clipboard
60+ "--socket=system-bus" ,
61+ // Default permissions
62+ "--socket=x11" ,
63+ "--share=ipc" ,
64+ "--device=dri" ,
65+ "--socket=pulseaudio" ,
66+ "--filesystem=home" ,
67+ "--env=TMPDIR=/var/tmp" ,
68+ "--share=network" ,
69+ "--talk-name=org.freedesktop.Notifications" ,
70+ ] ,
71+ // https://github.com/electron/forge/issues/2805
72+ modules : [
73+ {
74+ name : "zypak" ,
75+ sources : [
76+ {
77+ type : "git" ,
78+ url : "https://github.com/refi64/zypak" ,
79+ // https://github.com/refi64/zypak/releases
80+ tag : "v2024.01.17" ,
81+ } ,
82+ ] ,
83+ } ,
84+ ] ,
85+ } ,
4486 } ) ,
4587 ] ,
4688} ;
0 commit comments