0613a58961
Instead of directly using Exec= line, parse the file (at the launch time) with Gio library. The main reason for this change is to handle Terminal= option, but generally this approach should be more bulletproof, especially when some fancy options are present in desktop files.
12 lines
238 B
Python
Executable File
12 lines
238 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
from gi.repository import Gio
|
|
import sys
|
|
|
|
def main(myname, desktop, *files):
|
|
launcher = Gio.DesktopAppInfo.new_from_filename(desktop)
|
|
launcher.launch(files, None)
|
|
|
|
if __name__ == "__main__":
|
|
main(*sys.argv)
|