Merge lp:~seb128/livecd-rootfs/snap-xdg-defaults into lp:livecd-rootfs

Proposed by Sebastien Bacher on 2016-08-03
Status: Merged
Approved by: Sebastien Bacher on 2016-08-03
Approved revision: 1417
Merged at revision: 1427
Proposed branch: lp:~seb128/livecd-rootfs/snap-xdg-defaults
Merge into: lp:livecd-rootfs
Diff against target: 32 lines (+25/-0)
1 file modified
live-build/ubuntu-core/hooks/500-create-xdg-wrapper.binary (+25/-0)
To merge this branch: bzr merge lp:~seb128/livecd-rootfs/snap-xdg-defaults
Reviewer Review Type Date Requested Status
Michael Vogt 2016-08-03 Approve on 2016-08-03
Ubuntu Core Development Team 2016-08-03 Pending
Review via email: mp+301917@code.launchpad.net

Commit Message

Create a desktop entry and some mimetype associations for xdg-open in
ubuntu-core. That way interacting with web, email and documentations urls
in a snap should do the right thing.

Description of the Change

Create a desktop entry and some mimetype associations for xdg-open in
ubuntu-core. That way interacting with web, email and documentations urls
in a snap should do the right thing.

To post a comment you must log in.
Michael Vogt (mvo) wrote :

Looks good! Thanks a bunch

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'live-build/ubuntu-core/hooks/500-create-xdg-wrapper.binary'
2--- live-build/ubuntu-core/hooks/500-create-xdg-wrapper.binary 2016-06-11 20:03:39 +0000
3+++ live-build/ubuntu-core/hooks/500-create-xdg-wrapper.binary 2016-08-03 15:13:36 +0000
4@@ -14,3 +14,28 @@
5 EOF
6 chmod 755 $PREFIX/usr/local/bin/xdg-open
7
8+# corresponding .desktop entry, needed for mimetype registration
9+mkdir -p $PREFIX/usr/local/share/applications
10+cat >$PREFIX/usr/local/share/applications/xdg-open.desktop <<EOF
11+[Desktop Entry]
12+Version=1.0
13+Name=Url Handler Script
14+Exec=/usr/local/bin/xdg-open %u
15+MimeType=x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/mailto;x-scheme-handler/help;
16+Type=Application
17+EOF
18+
19+# define xdg-open as the default handler for common types
20+cat >$PREFIX/usr/local/share/applications/mimeapps.list <<EOF
21+[Added Associations]
22+x-scheme-handler/http=xdg-open.desktop
23+x-scheme-handler/https=xdg-open.desktop
24+x-scheme-handler/mailto=xdg-open.desktop
25+x-scheme-handler/help=xdg-open.desktop
26+
27+[Default Applications]
28+x-scheme-handler/http=xdg-open.desktop
29+x-scheme-handler/https=xdg-open.desktop
30+x-scheme-handler/mailto=xdg-open.desktop
31+x-scheme-handler/help=xdg-open.desktop
32+EOF

Subscribers

People subscribed via source and target branches