Xdg-mime: Difference between revisions
Line 52: | Line 52: | ||
== Valikud == | == Valikud == | ||
* --mode saab valida kas installeerida ühele kasutajale või kõigile süsteemi kasutajatele. | |||
--mode mode | |||
mode can be user or system. In user mode the file is | |||
(un)installed for the current user only. In system mode the file | |||
is (un)installed for all users on the system. Usually only root | |||
is allowed to install in system mode. | |||
The default is to use system mode when called by root and to use | |||
user mode when called by a non-root user. | |||
--novendor | |||
Normally, xdg-mime checks to ensure that the mimetypes-file to | |||
be installed has a proper vendor prefix. This option can be used | |||
to disable that check. | |||
A vendor prefix consists of alpha characters ([a-zA-Z]) and is | |||
terminated with a dash ("-"). Companies and organizations are | |||
encouraged to use a word or phrase, preferably the organizations | |||
name, for which they hold a trademark as their vendor prefix. | |||
The purpose of the vendor prefix is to prevent name conflicts. | |||
--help Show command synopsis. | |||
--manual | |||
Show this manualpage. | |||
--version | |||
Show the xdg-utils version information. | |||
= Kokkuvõtteks = | = Kokkuvõtteks = |
Revision as of 19:50, 30 December 2013
Autor
Rain Kärner AK21 rain.karner@itcollege.ee
Sissejuhatus
Xdg-mime on käsurea tööriist, mis võimaldab pärida failide tüübi kohta ja lisada kirjeldusi uutele faili tüüpidele.
Paigaldamine
Xdg-mime on osa paketist xdg-util ja kasutamiseks tuleb paigaldada pakett käsuga:
apt-get install xdg-utils
Käsud
1. query
On mõeldud kasutama ainult töölaua versioonides ja pole soovitav kasutada root kasutajana. Query käsuga saab pärida kahte asja:
- filetype - tagastab faili tüübi
xdg-mime query filetype photo.jpg
Tulemus: Tagastab MIME tüübi, mis on image/jpeg
- defualt - saab teada vaikimisi seatud programmi nime, mida töölaud kasutab
xdg-mime query default image/jpg
Tulemus: Tagastab registreeritud programmi nime, mis on seadistatud avama jpg faili .desktop failinime laiendis.
2. default
Selle käsuga saab määrata ja muuta vaikimisi määratud programmi faile. Annab võimaluse lisada mitu erinevat faili tüüpi. Samuti pole soovitatav kasutada root kasutajana.
xdg-mime default xpdf.desktop application/pdf
Tulemus: Avab pdf faililaiendit vaikimisi programmiga Xpdf.
3. install
4. uninstall
Valikud
- --mode saab valida kas installeerida ühele kasutajale või kõigile süsteemi kasutajatele.
--mode mode mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode.
The default is to use system mode when called by root and to use user mode when called by a non-root user.
--novendor Normally, xdg-mime checks to ensure that the mimetypes-file to be installed has a proper vendor prefix. This option can be used to disable that check.
A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts.
--help Show command synopsis.
--manual Show this manualpage.
--version Show the xdg-utils version information.