Modify file associations in Versions later than Ubuntu 12.04

Source: Internet
Author: User
Tags png text adobe reader 9

This is a complaint ~~~ Of course, solutions are also provided ~ Coming soon.
 
In this article, we will introduce how to install quartus II 13.1 In Ubuntu. After the installation is complete, the function is normal, but there is a "small problem" that is how to install quartus II in the File Manager (here is the nautilus manager) open the qpf file by quartus II, instead of opening it in text by default. Before Ubuntu 12.04, right-click the file and choose "open with other programs ", if the program cannot be found in the list (Quartus II here), the last trick is browsing. However, after 12.04, this function is castrated .... after a long time, I still don't know how to manage files with the qpf suffix to us II.

-------------------------------------- Split line --------------------------------------

Build an FPGA/CPLD development environment in Ubuntu 10.04: Quartus II 9.1

Download, install, and configure Ubuntu 14.04

Ubuntu 14.04 system:

Ubuntu 14.04 text tutorial on hard drive installation in Windows 7

Install PDF Reader Adobe Reader 9.5.5 in Ubuntu

Install Quartus II 14.04 on Ubuntu 13.1

-------------------------------------- Split line --------------------------------------
 
In this case, I naturally thought of using the file type management function of Ubuntu-tweak, where the corresponding qpf suffix cannot be found at all, you cannot add a new one ~~~
 
After constantly searching on the search engine, he finally found it and used the xdg-mime command (which is included in the system ).

Xdg-mime-command line tool for querying information about file type
Handling and adding descriptions for new file types
 
When we use the man command to view the help of xdg-mime, we finally mention how to "register" a new type to the system:
 
Xdg-mime install shinythings-shiny.xml
Among them, "shinythings-" is the vendor name, while "shiny" is usually the suffix, and the content of this xml is usually:


<? Xml version = "1.0"?>
<Mime-info xmlns = 'HTTP: // www.freeyuntop.org/standards/shared-mime-info'>
<Mime-type = "text/x-shiny">
<Comment> Shiny new file type </comment>
<Glob pattern = "*. shiny"/>
<Glob pattern = "*. shi"/>
</Mime-type>
</Mime-info>
 
Although I do not quite understand the xml syntax, the above Code is still very easy to modify. One of the code below the comment will know that it is a description or comment on this type, here we change it to "Quartus II Project file type"
 
<Mime-type = "text/x-shiny"> this type should be classified, because qpf is actually a text, so it still belongs to the text class (I know there are application classes), so we create a new text subclass for qpf (which I understand), called text/x-quartus,
 
Then the following two <glob pattern> obviously define the suffix, and we know that multiple suffixes can be specified, so the xml content of the qpf file is:


<? Xml version = "1.0"?>
<Mime-info xmlns = 'HTTP: // www.freeyuntop.org/standards/shared-mime-info'>
<Mime-type = "text/x-quartus">
<Comment> Quartus II Project file type </comment>
<Glob pattern = "*. qpf"/>
<Glob pattern = "*. qar"/>
</Mime-type>
</Mime-info>
 
 
The xml name is named: quartus-qml.xml
 
Then execute:
 
Xdg-mime install quartus-qpf.xml
 
In this way, we have registered a New Type. After you open ubuntu-tweak, you will find the qpf type.
 
The next thing to do is to set the default open program for this new mime type (x-quartus:
 
Xdg-mime default/usr/share/applications/quartus. desktop text/x-quartus
Note that in linux, the mime type is suitable for binding xxx. desktop together rather than directly binding with executable files.
 
Okay. Check the effect after restarting.
 
OK, we have enabled the File Manager to open the qpf file directly with quartuⅱ (qar can also be opened), but the qpf file icon is still a text icon, this may be a perfect person, so the next thing to talk about is how to modify it.
 
A mime-type icon.
 
Still use the xdg-mime command, which is mentioned at the end of man's Manual
 
Xdg-icon-resource install -- context text/x-quartus -- size 64/opt/altera/13.1/quartus/adm/quartusii.png text-x-quartus

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.