Questions tagged [freedesktop.org]
51 questions
29
votes
1 answer
How do I access an environment variable in a .desktop file's exec line?
My program requires an environment variable as part of one of its parameters:
myprogram --folder=$HOME/.special
However, if I put this into a .desktop file's exec line, it doesn't work:
Exec=myprogram --folder=$HOME/.special
The $HOME seems to…

Scott Ritchie
- 1,786
- 1
- 13
- 12
8
votes
2 answers
Simple, cross-platform to get well-known desktop paths in Java?
I'm looking for a simple, cross-platform way, on the JVM, to get the appropriate directories for storing application settings and cache data. E.g., on Linux under the XDG specs:
config in ~/.config/appname
cache in ~/.cache/appname
Windows stuff…

Michael Ekstrand
- 28,379
- 9
- 61
- 93
7
votes
0 answers
What does the X-MultipleArgs in the Desktop Entry file mean?
All of the sample Desktop files have X-MultipleArgs=False --- but what does this mean? The X- means it's an extension so it's not defined in the FreeDesktop specification. But I can't seem to find a place where it is defined. Google searches…

Theodore Ts'o
- 556
- 2
- 8
7
votes
2 answers
Get list of applications for opening a specific file
How can I get a list of applications that are capable to open a specific filetype / MIME-type? I'm searching for a desktop-environment independent solution on Linux.
I found the possibilty to get the MIME type for a file.:
~> xdg-mime query filetype…

BuZZ-dEE
- 6,075
- 12
- 66
- 96
7
votes
1 answer
D-Bus Desktop Notification using dbus-rs
I would like to send desktop notifications through D-BUS using https://crates.io/crates/dbus.
My current approach is:
let c = Connection::get_private(BusType::Session).unwrap();
//let m = Message::new_method_call("org.freedesktop.DBus", "/",…

hoodie
- 193
- 5
6
votes
1 answer
PowerManagement.Inhibit works with dbus-python but not dbus-send
I am working on a project where I need to inhibit power management (e.g. suspend) programatically. I am able to do so perfectly from Python:
import dbus
pm = dbus.SessionBus().get_object("org.freedesktop.PowerManagement",…

piedar
- 2,599
- 1
- 25
- 37
5
votes
1 answer
How do I get Geoclue Geolocation in Python? - What is desktop id parameter?
I'm trying to get the location (lat/lon) using GeoClue for Linux, and the Python interface (gir1.2-geoclue-2.0 package). The documentation for c nearly matches the api functions here, but I'm not sure what "desktop id" I should send... any valid…

NoBugs
- 9,310
- 13
- 80
- 146
5
votes
2 answers
Should A Program Create XDG Folders?
Let's say I'm writing a program, and I want it to follow the XDG Base Directory Specification for where it puts its files (app foo uses $XDG_CONFIG_HOME/foo as the directory for configuration files if XDG_CONFIG_HOME is set and non-blank, or…

mtraceur
- 3,254
- 24
- 33
5
votes
2 answers
Query XSettings Manager for Icon Theme
I'm writing an Application in Vala (a c compatible language) for which I need the icon theme that is currently set.
I want to avoid having GTK+ or Qt as an dependency.
I know that GTK+ 3 has a settings.ini and GTK+ 2 has a .gtkrc-2.0 file, but…

Ansgar
- 371
- 3
- 15
4
votes
3 answers
Open file with default application from Vala?
What's the best way to open a file in the default application from Vala?
A bit like how xdg-open works.

Peter Uithoven
- 705
- 1
- 6
- 17
4
votes
2 answers
Using XDG directory specification on Java application
I'm trying to follow XDG directory specification on my Java application. I have already used it for application data:
protected String getDefaultDataDir() {
String rootPath = System.getenv("XDG_DATA_HOME");
if(rootPath == null) {
…

Flamma
- 258
- 4
- 15
4
votes
3 answers
Country and language code detecting
I need to detect user's language and country code in Qt. That codes must be matching standards at http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html.
I've tried QLocale, but it returned full country and language name in…

Ivan Akulov
- 4,323
- 5
- 37
- 64
3
votes
1 answer
How to use zbus to list block devices?
I want to list all the available block devices in the system using a dbus implementation called zbus.
The UDisks2 documentation mentions a method call on org.freedesktop.UDisks2.Manager interface called GetBlockDevices which accepts IN a{sv}…

noconst
- 639
- 4
- 15
3
votes
2 answers
Low Level DBus C API main loop
When trying to use a callback function for a DBus reply I get stuck on creating a good/well working main loop.
What I want to do is simple, make a DBus call and specify a function which should be called when the reply comes. This is because I do not…

Daniel Falk
- 522
- 4
- 16
3
votes
0 answers
Icon path lookup in Qt
Qt supports the icon theme lookup by returning a QIcon. But for my QML view I need the icon path instead of a QIcon. Is there a way to get either the path from the looked up icon or to do a lookup which returns the icon path? I.e. I want to put an…

ManuelSchneid3r
- 15,850
- 12
- 65
- 103