Mime Types and file associations

Helixoft_VSdocman_8.4.6583_for_VS2010-2017 Helixoft_VSdocman_8.4.6583_for_VS2010-2017 VSdocman - Visual Studio documentation generator and .NET code commenter VSdocman is an ultimate, fast and easy to use .NET documenting tool for every Visual Studio C# and VB developer. 立即下载
Related to: Fedora Core 3 (Heidelberg) with Gnome 2.8
Problem: After fresh install, "File types and programs" (gnome-file-types-properties) is not available any more. The given solution by gnome - right-click -> open with other application -> ... - is not acceptable. Goal is to define a default application and double-click the file!

Since GNOME 2.8, MIME types are stored in the new FreeDesktop shared-mime-info database. However, gnome-control-center has not been updated to allow one to easily add MIME types to this database. Therefore, if applications such as Nautilus complain that there is no MIME type associated with a particular file, using the Associate Application interface will not work.

New MIME types can be added in one of two places. They can either be added system-wide for all users, or added locally on a per-user basis. System-wide MIME types must be added to either ${LOCALBASE}/share/mime or ${X11BASE}/share/mime, where as local MIME types must be added to ~/.local/share/mime.
This text is taken from website http://www.freebsd.org/gnome/docs/faq2.html#q22

This essay will describe the system-wide procedure, because the local one caused errors! Also the shown procedure of local define caused trouble in FC3.
At the end of this essay, you'll find some helpers to fix such created file associations...


MIME type handling in Gnome 2.8
Related Files:
This section will give you a small introduction which files need to be modified in order to change the system for your needs. Each of the shown files needs to be changed with root access.

-> /usr/share/applications/defaults.list
This file contains the applications which cause a double-click success. All Mime types will point to a desktop file.

-> /usr/share/applications/[application_name].desktop
This is the file where "defaults.list" will point to. One of the most important things inside this file is the entry "MimeType=".

-> /usr/share/applications/mimeinfo.cache
Contains information in similar form shown for file "defaults.list" in same directory. This file contains ALL associations given to a mime type. There is no need for a specified order of desktop files (see XMMS example lateron)

-> /usr/share/mime (Directory)
This directory contains several information. The sub-directories - excluding packages - contain information about given mime types. You'll see that many mime types already exist.
The packages directory contains the DATABASE calles freedesktop.org.xml!

-> /usr/share/mime/globs
This file contains the file extensions, associated to the mime-types.


Example: MPlayer should start WMV by Double-Click
I've uninstalled Xine and Totem, cause i only use MPlayer. After uninstalling them, i've seen the desaster: previously, Totem was the default player. And now there was ... nothing!
After two days of internet research, this essay was created ... so you havn't waste time as i have to do ;)

Creating the desktop file
If it is not already existing, create the file "/usr/share/applications/mplayer.desktop" like this:

[Desktop Entry]
Name=Movie Player
Comment=Play multimedia files and media
Icon=mplayer.xpm
Exec=gmplayer %f
Terminal=false
MimeType=video/mpeg;video/x-msvideo;video/quicktime;video/x-ms-asf;video/x-ms-wmv
Type=Application
Categories=Application;AudioVideo;
Encoding=UTF-8

The mime types for asf and wmv already exist and are stored in the mime type database (/usr/share/mime/packages/freedesktop.org.xml)

Modify defaults.list
This file will init our DEFAULT application. It ONLY contains ONE desktop file for EACH mime type:

video/x-ms-asf=mplayer.desktop
video/x-ms-wmv=mplayer.desktop


Modify mimeinfo.cache
To take effect as default application and init the double-click feature, we need to modify the mimeinfo.cache also:

video/x-ms-asf=mplayer.desktop
video/x-ms-wmv=mplayer.desktop

This file can use MORE then ONE desktop file. If you want to be able to handle - for example - WMV files with different players, a line like this is also acceptable:

video/x-ms-wmv=mplayer.desktop;realplay.desktop

This will change the right-click-menu and insert Helix-Player, while mplayer is still default (with double-click)

After modification, log out from gnome and log in again...


Example: XMMS should start MP3 by Double-Click
I've seen this question inside this forum, so it might be a little helper to toggle existing file associations to a needed row...
By default, the Helix player will open if we double-click a MP3-file. In defaults.list file we'll see:

...
audio/x-mp3=realplay.desktop
audio/x-mp3-playlist=realplay.desktop
...

... and in mimeinfo.cache we'll see entries like this:

...
audio/x-mp3=rythmbox.desktop;rythmbox.desktop;redhat-audio-player.desktop;realplay.desktop
...
audio/mp3=realplay.desktop
...

Now, what the heck is the correct player? It's "redhat-audio-player.desktop" (if you open this file, you'll see the line "Exec=xmms -e %F" :D

If we want XMMS to start MP3 files with a double-click, we need to change the defaults.list file:

...
audio/x-mp3=redhat-audio-player.desktop
audio/x-mp3-playlist=redhat-audio-player.desktop
...

... and this MP3 association in mimeinfo.cache:

...
audio/mp3=redhat-audio-player.desktop
...

Logout from Gnome and log in again ... the changes are ready to use ;)


Bug-Fixes and trouble shooter
As told in the beginning, local changes may cause trouble to install default applications. Here is an introduction on how to fix them. There is no need for root access, all files are stored in /home/[username]/.local. In case of that, the problems has to be fixed by each user itself, because root will not see directory ~/.local directory for other user ...

If you create an association by using "open with" or "open with other application", files are created in directory ~/.local/share/applications. DELETE THEM for applications modified for system-wide usage.

If you manualy create mime types inside the ~/.local folder (as shown in the quoted website in the beginning), please store them system-wide. I've tried this procedure (local) and was not able to double-click a file after rebooting, regardless of using the application "update-mime-database" or not.

If you get in trouble by using "update-mime-database" application by creating NEW mime-types and errors occur: -> there is a bug in the shown website!
WRONG: <xml version="1.0" encoding="UTF-8"?>
CORRECT:<?xml version="1.0" encoding="UTF-8"?>
relay_subgraph_partition_one_slide.pptx 立即下载

相关推荐

triton-inference-server-ge-backend

新版本特性 v2.3.0 支持对全局、session、graph 的options进行添加,从而进一步调优模型,相关案例请参考 性能调优方法论。 支持采用分档模式将符合条件模型转化为静态图,提高吞吐性能。 补充如何采用分档模式+锁核+调整精度,进一步提高性能。 在AscendHub下载镜像时需确认好版本,若使用旧版本镜像,需要手工下载源码编译生成新的backend后才能支持新特性。 版本特性 v2.2.0 支持从onnx文件读取模型输入输出信息, config中若无指定input,output,将会自动从文件中读取; 调整动态图在多实例下使用多Session方式,提高并发吞吐(显存占用会增高); 支持动态batch场景小batch动态合并特性,配合多Session,提高吞吐; 补充调优方法论以及cnclip模型的最佳实践; 支持多模型特性,可支持同时拉起多个模型,提高显存利用率; 支持非0轴动态shape场景; 支持TensorFlow的pb文件。

如何新建mime类型(gnome2.8)

转载自: http://www.linuxfans.org/bbs/viewthread.php?tid=98047&amp;highlight=   首先,大家都知道 GNOME 2.8 现在启用了新的 Mime 系统,用的是 freedesktop.org 的 Shared MIME Database 标准,可以参看 http://www.freedesktop.org/wiki ...

Linux Job 297

2007-2025年36家商业银行绿色信贷余额数据(2025年无缺失)

1、指标覆盖区间为2007年至2025年 2、数据取自各银行年度报告及社会责任报告 3、核心指标为绿色信贷余额 4、涉及银行包括:苏农银行、中国银行、紫金银行、杭州银行、华夏银行、邮储银行、青岛银行、兴业银行、苏州银行、农业银行、宁波银行、上海银行、江阴银行、招商银行、长沙银行、北京银行、无锡银行、民生银行、浙商银行、常熟银行、成都银行、工商银行、郑州银行、光大银行、南京银行、建设银行、浦发银行、贵阳银行、渝农商行、西安银行、交通银行、江苏银行、中信银行、张家港行、平安银行、青农商行

管理文件输入输出

管理输入输出在linux系统中,正确输出的编号为1,错误输出编号为2在系统中用普通用户执行 “student” find /etc -name passwd 因为student用户权限问题会有以下输出 find: ‘/etc/pki/CA/private’: Permission denied ##没有进入权力,报错 find: ‘/etc/pki/rsyslog’: Permi

MJ_linux的博客 610

2019-2026年 中国分行业进出口数据 xlsx

数据整理中国各细分行业海关进出口数据,包括中国对各个国家进口、出口数据,中国各个行业进出口数据,各国贸易数据是了解每个国家市场的最基础和重要信息。数据非面板数据,时间、行业分类有缺失。 标 日期 采购商国家/地区 供应商国家/地区 采购商 供应商 采购商地址 供应商地址 通知人 通知人地址 制造商 原产国 目的国 起运港 目的港 HS编码 产品描述 唛头 数量 数量单位 重量 金额($) 单号 集装箱号 品牌

后端开发 Docker4.99.0 AppleSilicon 苹果芯片 Mac 安装包

本资源为 Docker Desktop 4.99.0 苹果芯片(Apple Silicon)专用安装包,原生适配 M 系列 Mac,可快速搭建本地容器开发环境,支持镜像拉取、容器编排、项目打包部署。适合后端开发、运维、全栈开发者,用于本地微服务、测试环境、项目容器化开发。

EdgeRemover 实战指南:在 Windows 10/11 上正确卸载与重装 Microsoft Edge 的 PowerShell 工具解析

Microsoft Edge(Chromium 版)深度集成于 Windows 10/11,直接删除安装目录或用第三方工具强卸,往往会留下注册表残留、EdgeUpdate 组件与系统级文件关联问题。EdgeRemover 正是为解决这一痛点而生:它调用 Edge 自身的卸载器完成卸载,内置多重回退方法,并支持重装 Edge / WebView2 与清理更新阻止策略。本文将以其 [README.md

gitblog_01121的博客 376

milvus-v2.6.25镜像文件

milvus-v2.6.25镜像文件

HELIX Design system v4.r3.M0-ISO 1CD

MICROCADAM产品: HELIX Design system v4.r3.M0-ISO 1CD FCC Software产品:Sheet.Lightning.v5.0.9(专业钣金设计及加工软件) 联系QQ:1458538100 邮件(Email):1458538100@q...

chengmamo5200的博客 1109

医学信息影像AI临床采纳的责任边界研究:基于场景选点与流程嵌入的分步实施路径

内容概要:本文以“影像人工智能(CAD)的临床采纳与责任边界”为核心议题,指出当前影像AI的发展瓶颈已从技术准确性转向“谁负责、怎么用”的机制与治理问题。通过文献研究与政策文本分析,文章系统梳理了CAD的应用场景与效果、临床采纳障碍及责任边界划分三大问题,揭示出“假阳性导致医生信任下降、责任归属不清、采购与使用脱节”三重瓶颈相互强化的闭环结构,并提出“场景选点—试用验证—责任规则先行—流程嵌入”的分步递进式建设路径,强调需通过机制闭环实现技术真正落地。; 适合人群:从事医疗信息化管理、医学人工智能研究、医院运营管理及相关政策制定的专业人员,以及医学信息学、卫生管理专业的高年级本科生与研究生。; 使用场景及目标:①用于医疗机构评估影像AI引入的可行性与实施路径,避免资源错配;②为政策制定者提供优化考核机制与责任界定的理论依据;③帮助AI厂商理解临床真实需求,提升产品与流程的契合度;④作为学术研究框架,支持对技术采纳与治理机制的深入探讨。; 阅读建议:本文构建了“现状—机制—治理”三层分析框架,建议读者结合自身角色聚焦不同章节:管理者重点关注第五章路径设计,研究者关注第三章文献述评与第六章研究展望,实施者关注第四章瓶颈分析与实施保障。阅读时应特别注意概念的操作化定义与证据等级区分,避免将理论推导误作实证结论,并在应用时结合本地实际进行裁剪与验证。

推动企业技术需求与高校科研成果对接,需要哪些关键支撑要素?.docx

推动企业技术需求与高校科研成果对接,需要哪些关键支撑要素?

windows安装ruby rails报错

Fetching mimemagic 0.3.10 Installing mimemagic 0.3.10 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: C:/Ruby26/lib/ruby/gems/2.6.0/gems/mimemagic-0.3.10/ext/mimemagic C:/Ruby26/bin/ruby.exe -r.

661

A股分钟行情数据,涵盖股票、ETF、可转债及指数 每条记录包含交易日期、具体时间、证券代码、证券简称、开盘价、最高价、最低价、收盘价、成交量、成交额 数据为日内分钟频率,逐分钟记录价格变动与成交信息

A股分钟行情数据,涵盖股票、ETF、可转债及指数。每条记录包含交易日期、具体时间、证券代码、证券简称、开盘价、最高价、最低价、收盘价、成交量、成交额。数据为日内分钟频率,逐分钟记录价格变动与成交信息,按交易日分割存储,历史分钟K线保留完整。 数据源:CMES金融数据库

国央企创新负责人在推动内部技术转化时,如何确保服务流程的合规与可控?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

一个免费的激光打标软件的配套硬件说明

激光打标软件配套硬件说明

高校技术转移办公室人员如何利用知识图谱技术提升科技成果评价的科学性与高效性?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

上一篇: What is Java Reflection
下一篇: Java的垃圾回收(Garbage Collection)机制
studious_cat
博客等级 码龄17年 14粉丝 13原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

studious_cat

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值