I am trying to find a better solution for scripting - While working on a file in a gui application, how to quickly open the parent directory of a file in the file browser? - Unix & Linux Stack Exchange
As you can see in that post: I have to append id pid and path in a file.
For Example,
81788964 76172 file:///home/ismail/Desktop/LibreOffice%20Writer%202.odt
92274695 77296 /media/ismail/SSDWorking/book-collection/_Books/kids/How to Be a Superhero Called Self-Control Super Powers to Help Younger Children to Regulate their Emotions and Senses (Lauren Brukner).epub
I can get id and pid using. But path of the file and the application name is something i could not get.
I ran dbus-monitor --session > gnome-extension-log.txt
to check whether I could get the path, and the file is attached here.
There I found lines like:
signal time=1684110883.068173 sender=:1.494 -> destination=(null destination) serial=22 path=/org/gtk/gio/DesktopAppInfo; interface=org.gtk.gio.DesktopAppInfo; member=Launched
array of bytes "/usr/share/applications/org.gnome.Evince.desktop" + \0
string ""
int64 77268
array [
string "file:///media/ismail/SSDWorking/book-collection/_Books/kids/Riddles%20For%20Kids%20-%20Over%20300%20Riddles%20and%20Jokes%20for%20Children%20(M.%20Prefontaine)%20.pdf"
]
signal time=1684110909.105890 sender=:1.494 -> destination=(null destination) serial=26 path=/org/gtk/gio/DesktopAppInfo; interface=org.gtk.gio.DesktopAppInfo; member=Launched
array of bytes "/home/ismail/.local/share/applications/mpv.desktop" + \0
string ""
int64 77424
array [
string "file:///media/ismail/8TBRaid0/_Agile/Agile%20Foundations/Understanding%20Agile.mp4"
]
signal time=1684110889.243135 sender=:1.494 -> destination=(null destination) serial=23 path=/org/gtk/gio/DesktopAppInfo; interface=org.gtk.gio.DesktopAppInfo; member=Launched
array of bytes "/home/ismail/.local/share/applications/com.github.johnfactotum.Foliate.desktop" + \0
string ""
int64 77294
array [
string "file:///media/ismail/SSDWorking/book-collection/_Books/kids/How%20to%20Be%20a%20Superhero%20Called%20Self-Control%20Super%20Powers%20to%20Help%20Younger%20Children%20to%20Regulate%20their%20Emotions%20and%20Senses%20(Lauren%20Brukner).epub"
]
So, the file path (for example, string "file:///media/ismail/SSDWorking/book-collection/_Books/kids/How%20to%20Be%20a%20Superhero%20Called%20Self-Control%20Super%20Powers%20to%20Help%20Younger%20Children%20to%20Regulate%20their%20Emotions%20and%20Senses%20(Lauren%20Brukner).epub"
) and application name (For example array of bytes "/usr/share/applications/org.gnome.Evince.desktop"
) can be found.
Now I am looking at
https://gjs-docs.gnome.org/gio20~2.0/gio.desktopappinfo
https://gjs-docs.gnome.org/gio20~2.0-desktopappinfo/
Here is the source code of the extension i am trying to edit .
What lines shall I add?