0

There is no menu option for the default powerpoint program in Details > Default Applications in Debian Linux, in Fig. 1. A terminal command and/or GUI tool is welcome for the task.

enter image description here

Testing Stephen's oneliner

Commands and their outputs

$ xdg-mime query filetype test.ppt
application/wps-office.ppt

$ xdg-mime query default $(xdg-mime query filetype test.ppt)
wps-office-wpp.desktop

Testing setting up by the outptus the default ppt viewer

xdg-mime default wps-office-wpp.desktop \
application/wps-office.ppt  

Output: no effect in opening .ppt files; other lines are not needed because VND and others are not in my system

OS: Debian 9.1 Linux
Powerpoint: WPS Presentation, currently LibreOffice presentation as default

2

There is no such thing as a “default PowerPoint”; you need to define the default handler for the various MIME types associated with presentations. To do so, determine which .desktop file represents the program you wish to use, then (as your own user, not root) run

xdg-mime default your-program.desktop \
    application/vnd.oasis.opendocument.presentation \
    application/vnd.oasis.opendocument.presentation-template \
    application/vnd.sun.xml.impress \
    application/vnd.sun.xml.impress.template \
    application/mspowerpoint \
    application/vnd.ms-powerpoint \
    application/vnd.openxmlformats-officedocument.presentationml.presentation \
    application/vnd.ms-powerpoint.presentation.macroenabled.12 \
    application/vnd.openxmlformats-officedocument.presentationml.template \
    application/vnd.ms-powerpoint.template.macroenabled.12 \
    application/vnd.openxmlformats-officedocument.presentationml.slide \
    application/vnd.openxmlformats-officedocument.presentationml.slideshow \
    application/vnd.ms-powerpoint.slideshow.macroEnabled.12 \
    application/vnd.oasis.opendocument.presentation-flat-xml \
    application/x-iwork-keynote-sffkey

(filtering the list as appropriate). This will use your-program to open OpenDocument presentations, OpenOffice/LibreOffice presentations, PowerPoint presentations, and Keynote presentations.

You might need to add other MIME types; to determine which ones to use, run xdg-mime query filetype your-file, replacing your-file with the name of a file you want to configure. This will give you the MIME type to add to the list above.

If it’s correctly written, your chosen application’s .desktop file should have a MIME type entry listing the types it supports — you can use that instead of the above list.

Alternatively, since you’re using GNOME, you can right-click on your file in the file manager, select “Properties”, then the “Open With” tab, and choose the default application there. You’ll need to repeat that for all the different file types you want to open with WPS Presentation.

  • 1
    You don’t need to specify a path, the file needs to be installed properly (typically in /usr/share/applications or ~/.local/share/applications) — xdg-mime will find it if it is. The command given in my answer is a one-liner, split across multiple lines for legibility (see the backslash at the end of each line but the last). – Stephen Kitt Sep 26 '17 at 11:29
  • @Léo you shouldn’t need to restart. What does xdg-mime query filetype yourfile say? What does xdg-mime query default $(xdg-mime query filetype yourfile) say? – Stephen Kitt Sep 26 '17 at 16:10
  • Alternatively, see my update to configure this using the GNOME GUI. – Stephen Kitt Sep 26 '17 at 16:12
  • I expected you to replace yourfile with the name of the file you’re opening. – Stephen Kitt Sep 26 '17 at 16:19
  • 1
    See my update; you’d need to add application/wps-office.ppt to the list of MIME types given to xdg-mime default. – Stephen Kitt Sep 26 '17 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.