diff --git a/hosts/work/hjem-rum/niri.nix b/hosts/work/hjem-rum/niri.nix index eaea379..0a932dd 100644 --- a/hosts/work/hjem-rum/niri.nix +++ b/hosts/work/hjem-rum/niri.nix @@ -1,5 +1,7 @@ { pkgs, ... }: { + # mode "2560x1440@144.002" + niri = { enable = true; spawn-at-startup = [ diff --git a/packages/fluxer/default.nix b/packages/fluxer/default.nix index 9d5b140..4f982db 100644 --- a/packages/fluxer/default.nix +++ b/packages/fluxer/default.nix @@ -46,15 +46,12 @@ stdenv.mkDerivation rec { fetchFromGitHub { owner = "fluxerapp"; repo = "fluxer"; - rev = "canary"; - sha256 = "sha256-7en5pENPCP9g4Bm+WXEKcIVb1kf28H1KlPmeHkX9LNM="; + rev = "refactor"; + sha256 = "sha256-scjvBAZ2c3dBOD/GRjcWpEjScD/XpNEeIjs1Rdmy9yE="; } - }/fluxer_app"; + }/fluxer_desktop"; - # - # Disclaimer, the screencast patch file is generated by me, but the actual code logic has been made assisted by Gemini LLM - # - patches = [ ../../patches/screencast.patch ]; + patches = [ ../../patches/fluxer.patch ]; nativeBuildInputs = [ autoPatchelfHook @@ -69,7 +66,7 @@ stdenv.mkDerivation rec { pnpmDeps = fetchPnpmDeps { inherit pname version src; fetcherVersion = 3; - hash = "sha256-zJTjNfNWMhQtEwY1lik2H9xMf4lJ6GLg6PShva7IDjs="; + hash = "sha256-Rh84JplYrd9k4fslofQli4fRNKmFhosftUfYXKBKU4g="; }; pnpmInstallFlags = [ @@ -103,20 +100,23 @@ stdenv.mkDerivation rec { ]; installPhase = '' - export BUILD_CHANNEL="canary" - pnpm run electron:compile + pnpm run set-channel stable + pnpm build pnpm exec electron-builder --config electron-builder.config.cjs --linux \ --dir \ -c.electronDist=${electron_40}/libexec/electron \ -c.electronVersion=${electron_40.version} \ - -c.npmRebuild=false + -c.npmRebuild=false \ mkdir -p $out/share/fluxer mkdir -p $out/bin cp -r ./dist-electron/linux-unpacked/resources/* $out/share/fluxer + ls -la ./dist-electron/linux-unpacked/fluxer_desktop + ls -la ./dist-electron/linux-unpacked/resources + makeWrapper ${electron_40}/bin/electron $out/bin/fluxer \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \ --add-flags "$out/share/fluxer/app.asar" @@ -135,6 +135,6 @@ stdenv.mkDerivation rec { ''} $out/share/applications/fluxer.desktop --subst-var out mkdir -p $out/share/icons/hicolor/512x512/ - cp $out/share/fluxer/512x512.png $out/share/icons/hicolor/512x512/fluxer.png + cp build_resources/icons-stable/512x512.png $out/share/icons/hicolor/512x512/fluxer.png ''; } diff --git a/patches/fluxer.patch b/patches/fluxer.patch new file mode 100644 index 0000000..5b4e93a --- /dev/null +++ b/patches/fluxer.patch @@ -0,0 +1,32 @@ +diff --git a/electron-builder.config.cjs b/electron-builder.config.cjs +index f8f8328..d15787b 100644 +--- a/electron-builder.config.cjs ++++ b/electron-builder.config.cjs +@@ -145,12 +145,7 @@ module.exports = { + arch: ['x64', 'arm64'], + }, + ], +- desktop: { +- Name: productName, +- Comment: 'Instant messaging and VoIP application', +- Categories: 'Network;InstantMessaging;', +- StartupWMClass: isCanary ? 'fluxer-canary' : 'fluxer', +- }, ++ desktop: null, + }, + + deb: { +diff --git a/scripts/build.mjs b/scripts/build.mjs +index 4ee9ac8..1c959e4 100644 +--- a/scripts/build.mjs ++++ b/scripts/build.mjs +@@ -82,9 +82,6 @@ async function buildMain() { + define: { + 'process.env.NODE_ENV': JSON.stringify(isProduction ? 'production' : 'development'), + }, +- banner: { +- js: `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`, +- }, + }); + + console.log('Main process build complete.'); diff --git a/patches/screencast.patch b/patches/screencast.patch deleted file mode 100644 index d4cb860..0000000 --- a/patches/screencast.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/src-electron/main/window.ts b/src-electron/main/window.ts -index 284db57..9b0bc5f 100644 ---- a/src-electron/main/window.ts -+++ b/src-electron/main/window.ts -@@ -102,6 +102,28 @@ let displayMediaRequestCounter = 0; - - function setupDisplayMediaHandler(session: Electron.Session, webContents: Electron.WebContents): void { - session.setDisplayMediaRequestHandler((request, callback) => { -+ const isWayland = process.platform === 'linux' && -+ (process.env.WAYLAND_DISPLAY || process.env.XDG_SESSION_TYPE === 'wayland'); -+ -+ if (isWayland) { -+ try { -+ desktopCapturer.getSources({ types: ['screen', 'window'] }).then((sources) => { -+ const selected_source = sources[0]; -+ if (selected_source) { -+ log.info('[DisplayMedia] Wayland native portal source selected'); -+ callback({ video: selected_source } as unknown as Electron.Streams); -+ } else { -+ log.info('[DisplayMedia] Wayland native portal cancelled by user'); -+ callback(null as unknown as Electron.Streams); -+ } -+ }) -+ } catch (e){ -+ log.error('[DisplayMedia] Wayland source capture failed:', e); -+ callback(null as unknown as Electron.Streams); -+ } -+ return; -+ } -+ - const requestId = `display-media-${++displayMediaRequestCounter}`; - const requestCallback = (streams: Electron.Streams | null) => callback(streams as Electron.Streams); - pendingDisplayMediaRequests.set(requestId, {callback: requestCallback}); -@@ -608,3 +630,4 @@ export function hideWindow(): void { - export function setQuitting(quitting: boolean): void { - isQuitting = quitting; - } -+