TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What should I use to write native desktop apps for Ubuntu?

37 pointsby pvsukale3almost 7 years ago
I am computer science student. And I want to write a native desktop app for Ubuntu which will be displayed in the system tray. I tried building a sample app using ElectronJS but it compiles to very big file size for a hello world system tray app. I have looked into GTK and Qt but I am confused which one I should use. I want to know which one will be easier to pick up and get going.

14 comments

voodootruckeralmost 7 years ago
The safest, simplest option would be C, CLion and GTK. Qt is pretty heavy in it&#x27;s own ways (though not as much as electron).<p>I might try out relm + rust, to see what the state of the art is: <a href="http:&#x2F;&#x2F;relm.ml&#x2F;relm-intro" rel="nofollow">http:&#x2F;&#x2F;relm.ml&#x2F;relm-intro</a><p>I&#x27;ve used <a href="https:&#x2F;&#x2F;www.mono-project.com&#x2F;docs&#x2F;gui&#x2F;gtksharp&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.mono-project.com&#x2F;docs&#x2F;gui&#x2F;gtksharp&#x2F;</a> in the past, and it was easy. Looks like there is a notification area example: <a href="http:&#x2F;&#x2F;www.mono-project.com&#x2F;docs&#x2F;gui&#x2F;gtksharp&#x2F;widgets&#x2F;notification-icon&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.mono-project.com&#x2F;docs&#x2F;gui&#x2F;gtksharp&#x2F;widgets&#x2F;notifi...</a><p>Looks like it&#x27;s possible in go: <a href="https:&#x2F;&#x2F;github.com&#x2F;mattn&#x2F;go-gtk" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mattn&#x2F;go-gtk</a><p>And python: <a href="https:&#x2F;&#x2F;python-gtk-3-tutorial.readthedocs.io&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;python-gtk-3-tutorial.readthedocs.io&#x2F;en&#x2F;latest&#x2F;</a><p>It doesn&#x27;t look very supported, but even node has GTK bindings: <a href="https:&#x2F;&#x2F;github.com&#x2F;WebReflection&#x2F;node-gtk" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WebReflection&#x2F;node-gtk</a><p>Honestly, thanks for bringing this up. Looking at these is interesting an nostalgic. It seems like everyone nowadays just does webapps, and its interesting to see &quot;the state of the desktop in 2018&quot;.
brudgersalmost 7 years ago
People are down on Electron. But to me, it looks more like the future than GTK or QT for many things. In the end, Electron&#x27;s tradeoff of resource use for ease of development is likely to win because computer capability will always trend above the line needed to run current web browser technology and Ubuntu ships with a browser. OK, Electron is not native. Neither is Java and every argument against Electron was made against Java twenty years ago and performance of Java apps on ordinary computers was often much much worse than Electron on its worst day.[1]<p>The story of computer programming is the story of programmers avoiding the need to write native code. Assemblers, compilers, Cobol, C, C++, Java, Go all exist because hardware is the worst abstraction most of the time. Particularly because it is sticky. Twenty-five years after first programming on TRS-80&#x27;s and Apple II&#x27;s, I freaked out about allocating a 10,000 element integer array on a machine with 4GB of RAM and dual quad-core Xeons.<p>That&#x27;s not to say that writing code at a low level might not be a good learning exercise. But it&#x27;s not a reason to claim moral&#x2F;ethical superiority. Engineering is about making meaningful tradeoffs based on project criteria. Resource allocation ought to be evaluated based on the importance of the problem the software solves...and consuming &quot;too much&quot; resources is often a reflection of the problem&#x27;s importance. and problem importance can be a useful way of evaluating software quality.<p>Don&#x27;t fight the last war.<p>Good luck.<p>[1]: And there was Java in the browser!
评论 #17177588 未加载
评论 #17176119 未加载
评论 #17175413 未加载
tenryuualmost 7 years ago
I&#x27;m writing a systray application in golang currently. Binaries turn around 3mb. There&#x27;s an external library for cross platform tray support somewhere on github, I can&#x27;t remember exactly what it&#x27;s called though<p>Edit: it was the first result on Google; <a href="https:&#x2F;&#x2F;github.com&#x2F;getlantern&#x2F;systray" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;getlantern&#x2F;systray</a>
评论 #17167876 未加载
squarefootalmost 7 years ago
Take a look at Lazarus. It runs natively and outputs native binaries from x86 PCs to ARM *PI like boards.<p><a href="https:&#x2F;&#x2F;www.lazarus-ide.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.lazarus-ide.org&#x2F;</a> <a href="http:&#x2F;&#x2F;wiki.freepascal.org&#x2F;Lazarus_Application_Gallery" rel="nofollow">http:&#x2F;&#x2F;wiki.freepascal.org&#x2F;Lazarus_Application_Gallery</a>
xor_nullalmost 7 years ago
As far as i know ubuntu uses Gnome which means you should use GTK to let your app look nativ. I dont know how it will look if you use Qt.
评论 #17168169 未加载
earenndilalmost 7 years ago
They will both probably be about the same, tbh. People seem to like Qt a bit more, but high-quality bindings really only exist for c++ or python. GTK, on the other hand, has bindings for most langauges. You could also use tcl with tk, java (or clojure or kotlin or scala or...) with javafx or swing, d with dlangui...<p>Ultimately, what&#x27;s important is to start making something. Any language, any toolkit, doesn&#x27;t <i>really</i> matter all that much. If you don&#x27;t like it, try another language, another toolkit.
iamcreasyalmost 7 years ago
If I had to do it, I would use a language that I am comfortable with and the most used GUI library&#x2F;framework in that language. I know Java well, so I&#x27;d either chose Java&#x2F;Swing or Java&#x2F;GTK[1].<p>[1] Java binding is officially supported: <a href="https:&#x2F;&#x2F;www.gtk.org&#x2F;language-bindings.php" rel="nofollow">https:&#x2F;&#x2F;www.gtk.org&#x2F;language-bindings.php</a>
beojanalmost 7 years ago
What languages do you know? With Qt, Python is an option but you&#x27;re better off using C++. Bindings to other languages exist, of varying quality.
whoaminowalmost 7 years ago
Gnome has won the war, it&#x27;s the default for the major distro&#x27;s so Gtk.<p>If it&#x27;s a quick thing then maybe just make it a shell extension.
jason_slackalmost 7 years ago
I&#x27;m working on an app now and I using QT. I have used QT off and on over the years from 3.x days even. I still use QT because I feel if I wanted my app to run on other platforms like macOS or Windows I might have an easier time at least with the GUI piece.<p>You can use GTK on other platforms too, I just never have.
kevinsimperalmost 7 years ago
I tried writing a GUI app in wxpython and it was pretty straightforward, however you need to figure out how to split up work task from the main rendering process if you go that way!
Hydraulix989almost 7 years ago
libui showed up recently on HN, I also recommend wxWidgets.
nartzalmost 7 years ago
How about javafx?
评论 #17176127 未加载
openIcealmost 7 years ago
Why not simply use Java or C#? <i>No one</i> writes desktop software in JS
评论 #17168148 未加载
评论 #17167760 未加载
评论 #17167971 未加载
评论 #17169419 未加载