Added script to run .desktop files from the command line

master
lanxu 2015-07-05 17:51:04 +03:00
parent 9dbea6d960
commit d2909453a8
1 changed files with 12 additions and 0 deletions

12
run-desktop.py Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python
#
# http://askubuntu.com/questions/5172/running-a-desktop-file-in-the-terminal#5174
from gi.repository import Gio
import sys
def main(myname, desktop, *uris):
launcher = Gio.DesktopAppInfo.new_from_filename(desktop)
launcher.launch_uris(uris, None)
if __name__ == "__main__":
main(*sys.argv)