Improve handling of .desktop files
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.
This commit is contained in:
parent
d208e9baa5
commit
0613a58961
1
Makefile
1
Makefile
@ -172,6 +172,7 @@ install-common:
|
|||||||
install -d $(DESTDIR)/usr/share/file-manager/actions
|
install -d $(DESTDIR)/usr/share/file-manager/actions
|
||||||
install -m 0644 qubes-rpc/*-gnome.desktop $(DESTDIR)/usr/share/file-manager/actions
|
install -m 0644 qubes-rpc/*-gnome.desktop $(DESTDIR)/usr/share/file-manager/actions
|
||||||
|
|
||||||
|
install -D -m 0755 misc/qubes-desktop-run $(DESTDIR)/usr/bin/qubes-desktop-run
|
||||||
install -D misc/nautilus-actions.conf $(DESTDIR)/etc/xdg/nautilus-actions/nautilus-actions.conf
|
install -D misc/nautilus-actions.conf $(DESTDIR)/etc/xdg/nautilus-actions/nautilus-actions.conf
|
||||||
|
|
||||||
install -d $(DESTDIR)/mnt/removable
|
install -d $(DESTDIR)/mnt/removable
|
||||||
|
11
misc/qubes-desktop-run
Executable file
11
misc/qubes-desktop-run
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/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)
|
@ -1 +1,2 @@
|
|||||||
find /usr/share/applications/ /usr/local/share/applications/ -name '*.desktop' | xargs awk '/^\[/ { if (tolower($0) != "\[desktop entry\]") nextfile } /=/ {print FILENAME ":" $0 }' 2> /dev/null
|
find /usr/share/applications/ /usr/local/share/applications/ -name '*.desktop' | \
|
||||||
|
xargs awk '/^\[/ { if (tolower($0) != "\[desktop entry\]") nextfile } /^Exec=/ { print FILENAME ":Exec=qubes-desktop-run " FILENAME; next } /=/ {print FILENAME ":" $0 }' 2> /dev/null
|
||||||
|
@ -344,6 +344,7 @@ rm -f %{name}-%{version}
|
|||||||
/usr/bin/qvm-run
|
/usr/bin/qvm-run
|
||||||
/usr/bin/qvm-mru-entry
|
/usr/bin/qvm-mru-entry
|
||||||
/usr/bin/xenstore-watch-qubes
|
/usr/bin/xenstore-watch-qubes
|
||||||
|
/usr/bin/qubes-desktop-run
|
||||||
%dir /usr/lib/qubes
|
%dir /usr/lib/qubes
|
||||||
/usr/lib/qubes/vusb-ctl.py*
|
/usr/lib/qubes/vusb-ctl.py*
|
||||||
/usr/lib/qubes/dispvm-prerun.sh
|
/usr/lib/qubes/dispvm-prerun.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user