|
|
Home » Developing U++ » UppHub » Linux "start" equivalent (Need to launch an executable?)
Linux "start" equivalent [message #44062] |
Sun, 21 December 2014 10:55  |
rainbowsally
Messages: 29 Registered: December 2014
|
Promising Member |
|
|
I was having problems with functions4u in linux. And I still am, but it seems like this should be pretty simple to fix.
Linux has a 'start.exe' equivalent that will sort out the desktop environment and user-preferences for each user and the mime-linkage to applications for different file types.
It's xdg-open <file>
It discovers the user's DE and if necessary the mime-type and looks up the desktop file and extracts the "Exec=" value.
Functions4U doesn't work in linux, unfortunately, though launching the spreadsheet is quite simple.
You don't need the name of the exact binary executable that ends up being run. Might be OpenOffice -calc. Might be LibreOffice --calc. Might be a wine application. Might even be a upp output file in your home folder.
Just FYI, in case any of you linux guys didn't know that or had forgotten about it.
|
|
|
|
|
|
Re: Linux "start" equivalent [message #44108 is a reply to message #44097] |
Thu, 25 December 2014 14:08   |
rainbowsally
Messages: 29 Registered: December 2014
|
Promising Member |
|
|
Hi koldo.
koldo wrote on Wed, 24 December 2014 13:45Hello rainbowsally
You can make me a favor : please tell me the way to identify your desktop system and the best way to launch a program in your system. I mean:
- The way to identify your system
For example: environment variables (GNOME_DESKTOP_SESSION_ID in gnome, KDE_FULL_SESSION in KDE) or some text in xprop output.
- The best way to launch a program in your system
For example:
system("kfmclient exec \"" + String(file) + "\" &");
system("xdg-open \"" + String(file) + "\"");
The best way is just as you wrote above. At least for KDE. The environment variables generally have some clue as to the desktop being used.
But you may not realize this but both of the commands above do the same thing. That is kfmclient and xdg-open will both launch the same file but the xdg-open is "generic". Probably works on your Ubuntu, no?
If you like you can take a look at xdg-open. It's a script so you can pretty much tell the extents it goes to in order to figure out everything.
If Ubuntu has xdg-open, so does Mint and so does open[sic]suse.
I may also have the sources for kfmclient for kde 4.6, if you're curious about that one.
PS. xprop is for reading the "atoms" (flags and misc stuff) and icon bitmaps and things like that found in running applications. Very cool, but not much help here.
Also, if this remains important to you, let me know. I THINK we can scan the environment variables for strings containing "DE" at the end of a key OR a value (in a key-value pair) to find, or at the very least to get strong clues, about a user's current desktop environment.
I'm willing to do you a favor. It just might not be necessary. Let me know.
[Updated on: Thu, 25 December 2014 14:18] Report message to a moderator
|
|
|
|
Re: Linux "start" equivalent [message #44123 is a reply to message #44115] |
Fri, 26 December 2014 13:37   |
rainbowsally
Messages: 29 Registered: December 2014
|
Promising Member |
|
|
Hi koldo.
[Edited a third time.]
koldo wrote on Thu, 25 December 2014 19:14
Coming to LaunchFile(), it uses kfmclient in case of KDE and xdg-open in other cases so, is the problem that KDE is not detected by LaunchFile() in Mint?
I recently realized that I was not doing MT right. I thought the "build" I had to enable that in was when I compiled the ide.
Edit #1.
To make sure UPP doesn't get blamed if a user launches a UPP application from the commandline, it's probably a good idea to use "kfmclient exec <filename> 2>/dev/null" to silence the commandline noise.
Edit #2.
Controls4U:
Wow! Okay. 
Now... Using Linux/Mint15/KDE though I think I'm using GTK instead of QT, if that makes any sense to you.
I'm pretty confused. I'm not sure if this is one of the apps that wouldn't run before or not, but it's pretty cool. [Edit #3: Yes, it's the one.]
However...
1. The experimental file browser thinks text files are directories and says that the directory "does not exist or is not available". The problem is that the treeview in the left panel should not show files at all. The files show in the right panel.
2. Meter and Knob.
Wow! 
3. JB Controls. Beautiful. I like the progress bar (contrast between the text and the background).
4. Static Clock. I'd like to see the highlight fade to transparent a little more when the 'image' background is used, but very very nice!
[Edit #3: or maybe no highlight at all.]
5. Static Image and Edit file.. The file browser isn't working. That is, when I click on the right arrow, it returns immediately saying "file not found".
[Edit #3: The folder icon on the left is the active control. Not sure what the arrow on the right is for, but I was hitting the arrow.]
...
Functions 4U samples. Aha! That's what the 'functions' were. Not program functions.
Having probs with the file/download or whatever buttons on that page too. This one also has big buttons you can hit to get path and apply patch. These are not working (yet) on my system. I don't use Firefox as the default browser, but I doubt that's the problem. (??)
[Edit #3: probably the same issue. Haven't checked. Looking for MT issues that might be causing somewhat jerky movement. I noticed a Sleep(1) in the MT code for the GUI but it doesn't appear to be used.]
Wow. Just wow. 
Thank you koldo.
[Updated on: Fri, 26 December 2014 16:06] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 01:44:11 CEST 2025
Total time taken to generate the page: 0.03718 seconds
|
|
|