如何从.desktop文件提取Exec字段。吉奥可以帮我吗?
#!/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()
我完全是新手。
答案 0 :(得分:1)
print launcher.get_commandline()