pythonlinuxpython-2.7gtkgio

How get Exec field from desktop file


how extract Exec field from .desktop file. Gio can help me?

#!/usr/bin/python2

import os
from gi.repository import Gio

launcher = Gio.DesktopAppInfo.new_from_filename('/usr/share/applications/chromium.desktop')
# how get Exec field from desktop file
# cat /usr/share/applications/chromium.desktop | grep ^Exec

#retval = launcher.launch_uris()

i totally newbie..


Solution

  • print launcher.get_commandline()