<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/porting-an-electron-app-to-linux-lessons-from-a-screenshot-app-gfioq2oul" -->

---
title: Porting an Electron App to Linux: Lessons from a...
description: A developer recounts practical lessons learned porting an Electron-based screenshot app to Linux, covering build and packaging quirks (needing libnotify and...
canonical: https://daily.dev/posts/porting-an-electron-app-to-linux-lessons-from-a-screenshot-app-gfioq2oul
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Porting an Electron App to Linux: Lessons from a Screenshot App | daily.dev
og:description: A developer recounts practical lessons learned porting an Electron-based screenshot app to Linux, covering build and packaging quirks (needing libnotify and...
og:url: https://daily.dev/posts/porting-an-electron-app-to-linux-lessons-from-a-screenshot-app-gfioq2oul
og:image: https://api.daily.dev/og/posts/GfIOQ2OUl.png
og:image:alt: Porting an Electron App to Linux: Lessons from a Screenshot App
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Porting an Electron App to Linux: Lessons from a Screenshot App

**[Mandeep Singh](https://daily.dev/sources/dpcf0lovrgpavd1mol8mw)** · [@mandeepsng](https://daily.dev/mandeepsng) · 2 min read · 1 upvotes · 0 comments

## Summary

A developer recounts practical lessons learned porting an Electron-based screenshot app to Linux, covering build and packaging quirks (needing libnotify and libappindicator for notifications and tray icons), file path assumptions that break (app.getPath('pictures') not always resolving, requiring a fallback to ~/Pictures), window manager and desktop integration issues requiring a proper .desktop entry, and the importance of testing the packaged app in a real Linux VM rather than relying solely on CI.

## Content

Today, I spent a good chunk of time porting my screenshot app to Linux.

It’s an Electron app, and while the core logic is cross-platform, the packaging and system integration threw a few curveballs. Here’s what I learned.

The first surprise was the **build and packaging process**. On macOS and Windows, Electron’s tooling handles most of the heavy lifting. On Linux, I had to be more explicit about system dependencies such as `libnotify` and `libappindicator` for notifications and system tray integration.

The app worked perfectly in development mode, but the packaged version silently failed to show notifications until I installed the required libraries.

Another gotcha was **file paths**.

My app saves screenshots to a user-defined directory, and I initially assumed `app.getPath('pictures')` would work everywhere. On Linux, I ran into cases where the expected Pictures directory wasn’t available.

I ended up falling back to `~/Pictures` when the path was missing. It was a simple fix, but definitely something that’s easy to overlook.

Then came **window manager quirks**.

My app uses a global shortcut to trigger screenshots. On Linux, desktop integration can behave differently depending on the environment and window manager. I had to configure a proper `.desktop` entry and test the application across different Linux setups.

Finally, the biggest lesson was:

**Test early and test on a real Linux environment.**

I spun up a VM with a clean Linux installation and tested the packaged app there. That immediately exposed missing dependencies and path issues before I shipped anything.

It’s tempting to rely entirely on CI, but when you’re building desktop software, nothing beats testing the actual packaged application in the environment your users will run it in.

Porting an Electron app to Linux isn’t difficult, but it’s definitely not a one-liner either.

If you’re building an Electron app, **budget some time for platform-specific testing.**

Your Linux users will thank you. 😄

#Electron #Linux #JavaScript #DesktopApps #SoftwareDevelopment

## Similar posts on daily.dev

- [Tech Talk: How Electron went Wayland-native, and what it means for your apps](https://daily.dev/posts/tech-talk-how-electron-went-wayland-native-and-what-it-means-for-your-apps-pfckiqzun) · Electron · 19 upvotes · 0 comments
- [Trying Linux Desktop Yet Again with More Success](https://daily.dev/posts/trying-linux-desktop-yet-again-with-more-success-jchwuccrr) · RUBYLAND · 0 upvotes · 0 comments
- [How to Build a Desktop App with Rails 8 and Electron](https://daily.dev/posts/how-to-build-a-desktop-app-with-rails-8-and-electron-9ty6hcwei) · Ruby Flow · 0 upvotes · 0 comments
- [5 hard lessons I learned in my first week on Linux, and I'm better off for them](https://daily.dev/posts/5-hard-lessons-i-learned-in-my-first-week-on-linux-and-i-m-better-off-for-them-unsns5bj3) · XDA Developers · 6 upvotes · 2 comments
- [Electron's Investment Into Good Wayland Support](https://daily.dev/posts/electron-s-investment-into-good-wayland-support-smmgl42lm) · Phoronix · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#linux](https://daily.dev/tags/linux), [#electron](https://daily.dev/tags/electron)

[View this post on daily.dev](https://daily.dev/posts/porting-an-electron-app-to-linux-lessons-from-a-screenshot-app-gfioq2oul)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/porting-an-electron-app-to-linux-lessons-from-a-screenshot-app-gfioq2oul","headline":"Porting an Electron App to Linux: Lessons from a Screenshot App","text":"A developer recounts practical lessons learned porting an Electron-based screenshot app to Linux, covering build and packaging quirks (needing libnotify and libappindicator for notifications and tray icons), file path assumptions that break (app.getPath('pictures') not always resolving, requiring a fallback to ~/Pictures), window manager and desktop integration issues requiring a proper .desktop entry, and the importance of testing the packaged app in a real Linux VM rather than relying solely on CI.","url":"https://daily.dev/posts/porting-an-electron-app-to-linux-lessons-from-a-screenshot-app-gfioq2oul","datePublished":"2026-09-16T12:10:58.681Z","dateModified":"2026-09-16T12:11:17.002Z","author":{"@type":"Person","name":"Mandeep Singh","url":"https://daily.dev/mandeepsng","image":"https://lh3.googleusercontent.com/a/AATXAJwPUxgL1c6yOmo5F_ydL4gi1wTlkRJt4uqNbHY0=s100","description":"I am Mandeep Singh, a full-stack developer. I created this Blog to bestow my coding experience and l","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":130}},"image":"https://media.daily.dev/image/upload/s--E6YiKUtt--/f_auto/v1789560660/posts/GfIOQ2OUl?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/dpcf0lovrgpavd1mol8mw","name":"Mandeep Singh"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Mandeep Singh","item":"https://daily.dev/sources/dpcf0lovrgpavd1mol8mw"},{"@type":"ListItem","position":3,"name":"Porting an Electron App to Linux: Lessons from a Screenshot App"}]}
```

