Can you get the launcher name at runtime?

Post your Gambas programming questions here.
Post Reply
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Can you get the launcher name at runtime?

Post by BruceSteers »

If my gambas application is run form a .desktop launcher file can i get the path/name of the launcher file?

Anyone ever done this?
tia
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Can you get the launcher name at runtime?

Post by BruceSteers »

So i found Env["GIO_LAUNCHED_DESKTOP_FILE"]
This it seems gets set when i launch from a .desktop file on my actual Desktop and the system menu but not from a launcher in the MATE panel :(

Could do with a way to get the launcher name if run from the mate-panel or any other launcher that doesn't set it in the env.

was wondering if there would be a way to backtrace the PIDs or something , maybe with Application.ParentHandle or something like that??
If at first you don't succeed , try doing something differently.
BruceS
User avatar
thatbruce
Posts: 161
Joined: Saturday 4th September 2021 11:29pm

Re: Can you get the launcher name at runtime?

Post by thatbruce »

I had a bit of a look through what you can find in /proc that might help. Nada.
Maybe pstree or something, but I doubt it as the kernel couldn't give a "whatever" really about the desktop. IOW what happens in the desktop or better the WM is whatever and however each one feels like performing, in the "circus performer" sense, this month.
You may have to set something in the .desktop file that is visible to your application somehow. (Notice how I didn't use that atrocious "app" word there.)
Maybe there's something in the X utilities???

just thoughts
b
Have you ever noticed that software is never advertised using the adjective "spreadable".
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Can you get the launcher name at runtime?

Post by BruceSteers »

thatbruce wrote: Friday 11th November 2022 8:38am I had a bit of a look through what you can find in /proc that might help. Nada.
Maybe pstree or something, but I doubt it as the kernel couldn't give a "whatever" really about the desktop. IOW what happens in the desktop or better the WM is whatever and however each one feels like performing, in the "circus performer" sense, this month.
You may have to set something in the .desktop file that is visible to your application somehow. (Notice how I didn't use that atrocious "app" word there.)
Maybe there's something in the X utilities???

just thoughts
b
Yeah now I've thought about it more i doubt there's a way.
I realized MATE panel probably works just like my Desktop(ish) where it reads the .desktop file and launches the Exec command.
There was no way to know the .desktop file Desktop(ish) launched from it's internal Shell command but now i use something like this...

Shell MyDesktopFile.Exec With ["GIO_LAUNCHED_DESKTOP_FILE=" & MyDesktopFile.Path]

I'm reckoning the ONLY way to get the info from the MATE panel would be to get on their dev list and ask them to do the same.

Cheers anyway
If at first you don't succeed , try doing something differently.
BruceS
Post Reply