Gentoo's default MIME icon specifications for *.doc and *.pdf are so dull. These types of files' general icons are "x-office-document"(see /usr/share/mime/packages/freedesktop.org.xml). So their icons look the same and it's hard to tell them from the icons. After reading  and  (really tough work). I customize the 'PDF' mimetype icon in $XDG_CONFIG_HOME by by adding a file named 'user-type.xml' in $XDG_CONFIG_HOME/mime/packages/ (~/.local/share/mime/packages/). The content of the user-type.xml is as follows:
It means that I add the 'icon' property to mime-type 'application/pdf' in my own environment. Other properties about mime-type 'application/pdf' are defined in /usr/share/mime/packages/freedesktop.org.xml. Then I run 'update-mime' to generate the new XDG database files: generic-icons, globs2, icons, magic and so on. I get
in the file 'icons'. And I think the modification on XDG database is right, but nothing happens to the PDF mime-type icon. I log off and restart Gnome, hoping this would work. As I log in, I see the Gnome splash, with brower(nautilus) and panels repeatingly initialized. I can't enter the desktop. I switch to the console, seeing the log says:
localhost nautilus segfault at 0 ip xxxx
After that, I delete user-define.xml, and rerun update-mime. Gnome become fine.
I do this in $XDG_CONFIG_HOME because I want to make the LEAST modification to the CORE SYSTEM (/usr/share/xxx). The problem seem to be that I CAN NOT CHANGE A MIME-TYPE'S ICON BY ANY WAY !!!
Later on, I modify the file '/usr/share/mime/packages/freedesktop.org.xml' directly, changing the PDF mime-type's general icon to 'x-office-spreadsheet'. Restart the box. It doesn't work.
Little about changing mimetypes' icons can be found. This is really driving me crazy.
 X Desktop Group, Shared MIME-info Database. http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html
 X Desktop Group, Icon Theme Specification. http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
 MIME problem with icon spec. http://lists.freedesktop.org/archives/xdg/2009-April/010366.html
Steps to Reproduce:
1. Add a file named 'user-define.xml' to $XDG_CONFIG_HOME/mime/packages/ (~/.local/share/mime/packages, by default). The content is
2. Restart Gnome
Stopping at the gnome splash. Users can't enter the desktop.
Enter the desktop. All the PDF files' icons should be changed to 'x-office-spreadsheet.png'.
Gentoo Linux x86 kernel-2.6.30-gentoo-r2-i686
Portage 126.96.36.199 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r2 i686)
System uname: Linux-2.6.30-gentoo-r2-i686-Intel-R-_Core-TM-2_Duo_CPU_E7400_@_2.80GHz-with-glibc2.0
Timestamp of tree: Mon, 13 Jul 2009 03:20:01 +0000
ccache version 2.4 [enabled]
sys-devel/autoconf: 2.13, 2.63
sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
CFLAGS="-O2 -march=i686 -pipe"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://188.8.131.52/gentoo ftp://ftp.sjtu.edu.cn/gentoo http://184.108.40.206 http://mirror.averse.net/pub/gentoo http://mirro.gentoo.gr.jp"
LINGUAS="zh_CN zh zh_TW en_US en"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="# (I 2D 3D ABL Audio CPU Compress Cosole Desktop Environment Features Graphic Hardware Library Locale Management Media Other POSIX Player Power SSL System System: Thread Window X \ a acl acpi alsa are bash-completion berkdb branding bzip2 cdr cjk cleartype cli cracklib crypt dbus don't dri dvd emacs en_US esd essential fat file fontconfig fortran gdbm gif gnome gnutls gpm gtk hal have iconv ipv6 isdnlog jfs jpeg jpeg2k latex longer midi mmx mmx2 mplayer mudflap ncurses nls no nptl nptlonly ntfs opengl openmp oss pam pcre pdf perl png pppd printer) python readline reflection session smp spell spl sse sse2 sse3 ssl ssse3 support svga sysfs system tcpd threads tiff truetype udev unicode usb x86 xfs xft xorg xscreensaver zh_CN zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LINGUAS="zh_CN zh zh_TW en_US en"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Sorry, Steps to Reproduce should be :
1. Add a file named 'user-define.xml' to $XDG_CONFIG_HOME/mime/packages/
(~/.local/share/mime/packages, by default). The content is
2. RUN update-mime
3. Restart Gnome by logging out and logging in.
this works just fine here (although it's gnome 2.26 but I don't think it makes much of a difference). What I did:
1. add you modifications to ~/.local/share/mime/packages/user-extension-fdi.xml since there was this xml lying around.
2. run update-mime-database /home/eva/.local/share/mime/ (which is not the same thing as running just update-mime-database)
3. nautilus -q ; nautilus
4. enjoy my text files showing of with a spreadsheet icon
What version of shared-mime-info do you have installed (if what I described is _exactly_ what you did) ?
Thanks for the comments. I run on the Gnome 2.24. Following your steps will reproduce EXACTLY the same bug I mentioned in the report.
1. add you modifications to ~/.local/share/mime/packages/user-extension-fdi.xml, something like:
2. run update-mime-database ~/.local/share/mime/
3. nautilus -q ; nautilus
Guess what I get in the terminal ?
** Message: Initializing gksu extension...
Then naultilus fails to start, and all the icons on the desktop disappear...
(In reply to comment #2)
> this works just fine here (although it's gnome 2.26 but I don't think it makes
> much of a difference). What I did:
> 1. add you modifications to ~/.local/share/mime/packages/user-extension-fdi.xml
> since there was this xml lying around.
> 2. run update-mime-database /home/eva/.local/share/mime/ (which is not the same
> thing as running just update-mime-database)
> 3. nautilus -q ; nautilus
> 4. enjoy my text files showing of with a spreadsheet icon
> What version of shared-mime-info do you have installed (if what I described is
> _exactly_ what you did) ?
Not sure this is going to be much more informative but, could you provide a backtrace of the nautilus crash ? See  for details on how to produce a useful backtrace. Also what is your shared-mime-info version ?
the shared-mime-info I use is 0.60
$ eix shared-mime-info
Available versions: 0.60
Installed versions: 0.60(06:49:17 AM 07/09/2009)
er, according to , producing useful backtrace require to rebuild the world with the new CFLAGS. Maybe I will have to rebuild the world for optimization of performance after the problem is setteled. An alternitave solution, or a more cost-effective solution is to udpdate Gnome to 2.26.
But, I fail to build gnome-desktop-2.26 when updating. Maybe I will report another bug report.
Anyway, thanks for your help!
(In reply to comment #4)
> Not sure this is going to be much more informative but, could you provide a
> backtrace of the nautilus crash ? See  for details on how to produce a
> useful backtrace. Also what is your shared-mime-info version ?
>  http://www.gentoo.org/proj/en/qa/backtraces.xml
> But, I fail to build gnome-desktop-2.26 when updating. Maybe I will report
> another bug report.
that should be handled by the migration guide, if not, feel free to open another bug report for that.
In the meantime, closing needinfo, do not hesitate to reopen this bug once you have the requested information.