Pages: [1]
Print
Author Topic: HOWTO Add MIME and Icons to your linux desktop  (Read 3439 times)
diogo.urb
Newbie
*
Posts: 42


View Profile
« on: May 21, 2010, 09:53:10 PM »

Hi everyone,

So I saw that cycas doesn´t come with mime type configured neither it comes with icons. So I create icons for the files .cyc and for the backup files .cyc.bak and here I´ll provide you a howto create mime types for linux desktop, so that .cyc and .cyc.bak get icons and also with a double click it gets opened on CYCAS39.

All the following should be done as root, so either login as root or do it using sudo

1) First we need to add mime types for .cyc and .cyc.bak:

.... Create file /usr/share/mime/packages/cycas.xml with the following content, use sudo nano , sudo vim , sudo gedit , sudo kwrite or whatever it is your $EDITOR


http://www.freedesktop.org/standards/shared-mime-info";>
   
   
      CycasCAD Design
      
   

   
   
      CycasCAD Backup Design
      
   



.... Now run

$ sudo update-mime-database /usr/share/mime

.... Second we need to modify the .desktop of the Original CYCAS to incorporate the MIME-Types. The modified content of the file /usr/share/applications/CYCAS39.desktop should be

[Desktop Entry]
Value=1.0
Name=CYCAS39
Comment=CAD package
Categories=Application;Graphics;VectorGraphics;
Encoding=UTF-8
Type=Application
Version=3.9
TryExec=cycas39
Exec=cycas39 %F
MimeType=application/cycas;application/cycas-backup
Icon=cycas39.xpm
StartupNotify=true
Terminal=false

.... Third and last thing we should add icons to the mime type. For this you need to download the iconset I created from http://files.myopera.com/diogourb/Others...iconset.tar.bz2 . After downloading, extract it and on the files directory do the following commands to install the backup mimetype icons:

$ sudo xdg-icon-resource install --context mimetypes --size 254 --mode system 254x254-application-x-cyc-bak.png application-cycas-backup

$ sudo xdg-icon-resource install --context mimetypes --size 128 --mode system 128x128-application-x-cyc-bak.png application-cycas-backup

$ sudo xdg-icon-resource install --context mimetypes --size 64 --mode system 64x64-application-x-cyc-bak.png application-cycas-backup

$ sudo xdg-icon-resource install --context mimetypes --size 48 --mode system 48x48-application-x-cyc-bak.png application-cycas-backup

$ sudo xdg-icon-resource install --context mimetypes --size 32 --mode system 32x32-application-x-cyc-bak.png application-cycas-backup

PS: I´ll post the continuation since I don´t have more space left to keep writing .. CONTINUE READING
Logged
diogo.urb
Newbie
*
Posts: 42


View Profile
« Reply #1 on: May 21, 2010, 09:55:56 PM »

CONTINUING the previous post

.... To install the mimetype icons for the .cyc files do the following commands:

$ sudo xdg-icon-resource install --context mimetypes --size 254 --mode system 254x254-application-x-cyc.png application-cycas

$ sudo xdg-icon-resource install --context mimetypes --size 128 --mode system 128x128-application-x-cyc.png application-cycas

$ sudo xdg-icon-resource install --context mimetypes --size 64 --mode system 64x64-application-x-cyc.png application-cycas

$ sudo xdg-icon-resource install --context mimetypes --size 48 --mode system 48x48-application-x-cyc.png application-cycas

$ sudo xdg-icon-resource install --context mimetypes --size 32 --mode system 32x32-application-x-cyc.png application-cycas

The end... I´ll be making a tar package that will have a install script and post here later the url to get it and how to use it... for now, these are the commands needed to add the mime types globally
Logged
diogo.urb
Newbie
*
Posts: 42


View Profile
« Reply #2 on: May 21, 2010, 10:28:37 PM »

So as posted...

Here is the url for the script and files to be installed

Download it, extract it and execute the script install_cycas_mimetypes.sh from a terminal

http://files.myopera.com/diogourb/Others...e_Cycas.tar.bz2

This whole procedure is global, so all users will have the mime setted and it will affect gnome, kde, xfce, fluxbox or whatever your desktop is.
Logged
ozruta
Newbie
*
Posts: 9


View Profile
« Reply #3 on: May 24, 2010, 11:15:29 AM »

Great job! Very well done. I always liked to have this mime problem solved. Thanks!
Logged
luca
Full Member
***
Posts: 111



View Profile
« Reply #4 on: May 26, 2010, 02:36:11 PM »

Great, that´s the core of the matter, and the deep way.
Anyway I think that linux should be a little more frendly, expecially for unexperienced users, or they will never use it.
As an hope message I suggest that the goal can be achived also from GUI, in kde just right click on a .cyc file and play around with proprieties, it´s easy, belive me.
ciao
luca
Logged
ozruta
Newbie
*
Posts: 9


View Profile
« Reply #5 on: May 26, 2010, 09:19:24 PM »


Quote

As an hope message I suggest that the goal can be achived also from GUI, in kde just right click on a .cyc file and play around with proprieties, it´s easy, belive me.
ciao
luca



I do that in gnome in Ubuntu. Opening the all .cyc files with Cycas worked fine, but file icon was attachced to just one file, which I edit. Not to all .cyc file. And I didn´t managed how to solve it.
Logged
diogo.urb
Newbie
*
Posts: 42


View Profile
« Reply #6 on: May 26, 2010, 09:56:57 PM »

Hi ozruta,

When you do such a thing, the gnome creates the mime type on $HOME/.local/share/mime and $HOME/.local/share/applications, the difference between gnome and kde is that kde after adding the files update the database, gnome doesn´t

So to update the database do the following on a terminal as your user

$ update-mime-database ~/.local/share/mime
$ update-desktop-database ~/.local/share/applications

This should update the database right away, then on nautilus press F5 to refresh the screen
Logged
ozruta
Newbie
*
Posts: 9


View Profile
« Reply #7 on: May 27, 2010, 07:00:44 PM »


Quote
Hi ozruta,

When you do such a thing, the gnome creates the mime type on $HOME/.local/share/mime and $HOME/.local/share/applications, the difference between gnome and kde is that kde after adding the files update the database, gnome doesn´t

So to update the database do the following on a terminal as your user

$ update-mime-database ~/.local/share/mime
$ update-desktop-database ~/.local/share/applications

This should update the database right away, then on nautilus press F5 to refresh the screen


Hi diogo,

Thanks for the tip!
Logged
Pages: [1]
Print
Jump to: