Skip to content

Commit d03ba8b

Browse files
committed
Configure the default document viewer app
1 parent c2ad0ff commit d03ba8b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/configure-default-apps.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ if does_bin_exist 'gnome-disk-image-mounter'; then
3838
DISK_IMAGE_MOUNTER_LAUNCHER='gnome-disk-image-mounter.desktop'
3939
fi
4040

41+
# Document Viewer
42+
DOCUMENT_VIEWER_LAUNCHER=''
43+
if does_bin_exist 'org.gnome.Papers'; then
44+
DOCUMENT_VIEWER_LAUNCHER='org.gnome.Papers.desktop'
45+
elif does_bin_exist 'org.gnome.Evince'; then
46+
DOCUMENT_VIEWER_LAUNCHER='org.gnome.Evince.desktop'
47+
elif does_bin_exist 'evince'; then
48+
DOCUMENT_VIEWER_LAUNCHER='evince.desktop'
49+
fi
50+
4151
# Email Client
4252
EMAIL_CLIENT_LAUNCHER=''
4353
if does_bin_exist 'com.github.vladimiry.ElectronMail'; then
@@ -172,6 +182,10 @@ fi
172182

173183
# Update the associations
174184

185+
for DOCUMENT_TYPE in 'pdf'; do
186+
update_mimetype_association "application/${DOCUMENT_TYPE}" "${DOCUMENT_VIEWER_LAUNCHER}"
187+
done
188+
175189
for IMAGE_TYPE in "bmp" "jpeg" "png" "webp"; do
176190
update_mimetype_association "image/${IMAGE_TYPE}" "${IMAGE_VIEWER_LAUNCHER}"
177191
done

0 commit comments

Comments
 (0)