SUMMARY -- Generic handling of WORD, EXCEL, FILE MANGER ...
-- This is summary of thread:
-- Subject: Bug#363486: dpkg: [update-alternatives] New categories for: WORD, EXCEL ...
Please comment. --Jari
THE INTENTION
There are many programs that can act on a file if it contains
certain extension. The use of program names like 'konqueror', 'xfe'
is not optimal. It would be better if common actions could be
expressed through terms of "File Manager", "Spreadsheet" etc.
This would help e.g. to provide better defaults for graphical
programs that include features like: "Options => Preferences =>
Programs" having line:
Edit __________________ (fill program name)
Filling in 'xedit' is not good default, when user must change this
same "setting" is other installed GUI programs as well.
PROPOSED SOLUTIONS
(1) It was discussed if /etc/alternatives could be used by providing
configuration possiblitity through
update-alternatives --config <item>
Where items proposed for graphical programs could include:
x-word-processor
x-spreadsheet
x-file-manager
x-archiver
x-media-player or "x-video-player"
x-media-editor or "x-media-mastering"
x-music-player
x-music-editor think "audacity" etc.
This list is not comprehensive, only a start.
(2) Another proposed solution was to use existing MIME types
framework in /etc/mime.types, /etc/mailcap.order and /etc/mailcap.
It tackles the proposal like this:
application/msword; oowriter '%s'; edit=oowriter '%s'; ...
application/msexcel; oocalc '%s'; edit=oocalc '%s';...
CONCLUSIONS
Method (1) has drawbacks. Only adminstrator can update the
alternatives links, so individual users would not have control
over selected programs.
Method (2) supports user configurations through personal
mime type files in $HOME/.mailcap and thus better suitable.
REQUIRED WORK
(1) In order to carry on this proposal, there is need to write
a wrapper program that would use `run-mailcap'. The program
would use syntax:
x-mime-handler --mime TYPE [--action ACTION]
Where ACTION could be those defined in /etc/mime.types
[FIXME: If I understood correctly]
run (implicit if not given), edit, compose, print
An example call
x-mime-handler --mime application/msword --action run
Error handling would be based on return status
(2) There would also be need for standard features to call common
"actions". There is no need for end user to know the names of mime
types.
x-mime-handler --run FEATURE [ARGS]
The features would be those proposed at the beginning. Examples:
x-mime-handler --run x-file-manager /home/foo
x-mime-handler --run x-spreadsheet this.xls
BENEFITS
There are many graphical programs that contain setting that are
shipped with packages.
- These would all now have sensible defaults. E.g to run "editor".
There are many non-desktop window managers (not KDE, Gnome, XFCE),
that have simple menu structures. The menus call simple "programs".
- All those window managers could now have menu entries like
"File manager" and use the program `x-mime-handler'.
PROBLEMS
The mime types are based on WWW protocol, which does not
necessarily map to local actions. Editing videos or mastering DVDs
are not expressed through MIME types (FIXE: If I undertand
right).
However, the possibility to use
x-mime-handler --run FEATURE
poses no such resstrictions and can run any defined FEATURES that
cannot be expressed through mime types. QUESTION: What about
user preferences in these cases when MIME types are not used?
QUESTION: this might be possible through MIME types by defining
custom actions.
Reply to: