freedesktop.org

Using XDG directory specification on Java application

↘锁芯ラ 提交于 2019-12-13 00:09:48
问题 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) { rootPath = System.getProperty("user.home")+S+".local"+S+"share"; } return rootPath+S+Pinocchio.PLATFORMNAME; } ( S is a constant containing System.getProperty("file.separator") ) I want now to store documents on the user documents' folder. But I don't have an

freedesktop XEmbed systray client code in C, Xlib

不问归期 提交于 2019-12-06 11:00:28
问题 I've been trying to implement a systray icon using straight C and Xlib, going along with the freedesktop specification [0]. I can't seem to get my Window to embed into my desktop manager's systray[1], while other apps seem to be able to do it. I am not sure how to go forward debugging this, but I've provided minimal sample code below. I haven't been able to find any sample code using straight Xlib and C, and all the suggestions I've seen have been with regard to some framework like Gtk/Qt

How do I access an environment variable in a .desktop file's exec line?

别等时光非礼了梦想. 提交于 2019-11-28 18:54:44
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 resolve to nothing. By default environment variables do not seem to be resolved by all implementations, however you can instead exec sh, which will resolve the passed environment variable. Note that the desktop spec also requires you to escape the = and $ character with a backslash. So you want: Exec=sh -c "myprogram --folder\=\$HOME/.special" For the

How do I access an environment variable in a .desktop file's exec line?

扶醉桌前 提交于 2019-11-27 11:54:32
问题 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 resolve to nothing. 回答1: By default environment variables do not seem to be resolved by all implementations, however you can instead exec sh, which will resolve the passed environment variable. Note that the desktop spec also requires you to escape the