Tag Info

Hot answers tagged

26

There isn't a command that I've ever seen that will act as "open with..." but you can use the command xdg-open <file> to open a given <file> in the application that's associated with that particular type of file. Examples Opening a text file: $ xdg-open tstfile.txt $ Resulting in the file tstfile.txt being opened in gedit: ...


16

Look at the content of the xdg-open file, and you will notice that it is a simple shell script. Its main task is identifying the desktop environment in use, which will then be used to delegate the task to a specific tool: KDE delegates to kde-open or kfmclient Gnome delegates to gvfs-open or gnome-open Mate delegates to gvfs-open or mate-open XFCE ...


14

Because those applications that place configuration files in $HOME are ignoring the XDG Base Directory Specification, notably: There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME... If $XDG_CONFIG_HOME is either not set or empty, a ...


12

You can use perl-file-mimeinfo in the extra repository to manage mimetypes. Example to open all .pdf files in apvlv: /usr/bin/vendor_perl/mimeopen -d $file.pdf and then, at the prompt, enter the application: apvlv.


10

Have a look at the file $HOME/.local/share/applications/defaults.list There is a section [Default Applications] to specify the programs for particular mime types. You can add for example: application/x-debian-package=gdebi.desktop The .desktop files can be found in /usr/share/applications/ or you can create your own files under ...


9

It indicates that chromium may be passed a list of URLs on its command line. See the Exec key of the Desktop Entry Specification for a description of the available codes and what they mean.


8

The xdg-mime command is used to query or set file associations. jinx:735 Z$ xdg-mime query default application/pdf evince.desktop


8

A complement to jasonwryan's great answer, addressing some of your issues: Your $XDG_CONFIG_HOME is not set to ~/. It simply isn't set. So applications that follow the XDG Speciifcation use the default ~/.config The dirs inside /.config are not hidden because they don't have to. The whole point of using a ~/.config dir is to un-clutter the user's $HOME. ...


7

I think you've jumped the gun a bit — while many people may agree Wayland has a better design for the modern era (though some still disagree even on that), the implementation is not yet finished, and it doesn't yet do everything needed to overtake X, nor are the applications and toolkits ready for it. This fall Wayland is expected to declare its API stable ...


7

Why not to use utilities from xdg itself? To make Thunar the default file-browser, i.e. the default application for opening folders. $ xdg-mime default Thunar.desktop inode/directory to use xpdf as the default PDF viewer: $ xdg-mime default xpdf.desktop application/pdf This should create an entry in your local MIME database: ...


6

Mine /etc/mime.types starts with: # This file maps Internet media types to unique file extension(s). It is # distributed in Arch Linux as the mime-types package, which is based on # Gentoo's app-misc/mime-types package. # # The table below contains both registered and (common) unregistered types. # A type that has no unique extension can be ignored -- they ...


6

The mimetype in question is: x-scheme-handler/ed2k I just tried it. I installed amule and created a file userapp-amule.desktop in ~/.local/share/applications: [Desktop Entry] Name=aMule Name[en_US]=userapp-amule Exec=amule %u Icon=amule Terminal=false Type=Application Categories=Network;P2P; Comment=A client for the eD2k network ...


6

Using the tool wmctrl you can get all the above information, specifically the -d switch. Example $ wmctrl -d 0 * DG: 5760x900 VP: 0,0 WA: 0,25 1440x826 Workspace 1 1 - DG: 5760x900 VP: 0,0 WA: 0,25 1440x826 2 - DG: 5760x900 VP: 0,0 WA: 0,25 1440x826 N/A 3 - DG: 5760x900 VP: 0,0 WA: 0,25 1440x826 N/A Details One line is output for each ...


5

Usually this information is handled in 2 places: Application .desktop files advertise what program can open MIME database which specifies what application should be used to open file with specific MIME The MIME database can be customized by editing .local/share/applications/mimeapps.list and .local/share/applications/mimeinfo.cache. The tool which allows ...


5

To answer my own question: Ignacio's answer takes care of the large icon on the system menu, and the taskbar launcher if you add one. Changing the icon on the taskbar button/panel button took more digging. Uninstalling the 'native' Firefox from LMDE (sudo apt-get remove firefox) and installing the tar.gz from http://getfirefox.com still left me with the ...


5

Sort of, but it will change your default application as a result. I'm not sure what other operating systems this works on, but the instructions below work for Ubuntu 12.04 - Desktop X86-64. I didn't have any pdf files handy so I tested with a .zip archive. General Steps Step #1 In a terminal type: $ mimeopen -d /home/username/example.zip screenshot #1 ...


5

If you mostly work on the command line, you could look at a curses-based file manager, like ranger or vifm. Both allow you to define default actions for filetypes. In vifm, for example, in ~/.vifm/vifmrc you can define associations like so: " Images filetype *.jpg,*.jpeg,*.gif,*.tif,*.png,*.bmp sxiv " Media filetype ...


4

This report indicates it's sudo apt-get install notification-daemon.


4

On Debian you could use the command, as root update-mime-database /usr/share/mime having the shared-mime-info package installed.


4

The Linux kernel generates a code each time a key is pressed on a keyboard. That code is compared to a table of keycodes defining a figure that is then displayed. This process is complicated by Xorg, which starts its own table of keycodes. Each keycode can belong to a keysym. A keysym is like a function, started by typing a key. Xmodmap allows you to edit ...


3

If using xdg-open to open applications, then use xdg-mime to set the default application for a given mime type (typically, installing xdg-utils gives you the xdg-mime and related programs). For example, to see the "filetype" (mime-type, if you will) of given file: $ xdg-mime query filetype tmp.txt text/plain $ xdg-mime query filetype foo.pdf ...


3

Note: My information may be out of date. I know there already are a lot of Wayland libs in Ubuntu. Wayland is still relatively new and it's a long way from well tested and complete. Several distributions are migrating towards Wayland and we will most likely see Wayland based distributions next year. X has been used for decades and there are a lot of old ...


3

Use the xdg-mime command. xdg-mime default application mimetype Ask the desktop environment to make application the default application for opening files of type mimetype. An application can be made the default for several file types by specifying multiple mimetype s. The above is taken from man xdg-mime, slightly modified to copy the ...


3

The type detection information isn't actually embedded in the file program, the file program just reads the magic file and then searches the signatures in that file to see what matches. The magic file exists both as a compiled version, magic.mgc, and as the original source that is human readable and is just called magic. On my Fedora based systems these can ...


3

You are looking for the desktop-file-validate tool provided by the desktop-files-utils package in your distribution. It check for syntax, using reserved words/characters, in summary, that it complies with the Desktop Entry specification. Here's a example of a bad .desktop file: ➜ ~ desktop-file-validate asdf.desktop asdf.desktop: error: value "cd ...


3

You actually want to disable the Desktop directory and prevent the DE to automatically recreate it. Short answer: Edit ~/.config/user-dirs.dirs and change XDG_DESKTOP_DIR value to $HOME: XDG_DESKTOP_DIR="$HOME" Long answer: How to disable/relocate the User Directories (Desktop, Pictures, Documents etc) ? On a freedesktop compliant DE this is done via ...


2

glibc doesn't know anything about MIME types; the API functions live at the level of desktop environment APIs, and the freedesktop.org recognize that harmonizing them is an impossible task so they only specify the shell-level interface. You either use that via popen() or code for a particular desktop environment.


2

I don't believe there's a C API for querying mime-types in the same way that xdg-mime works. xdg-mime is just a shell script that queries your desktop environment (Gnome, KDE, or other), and runs the appropriate command to get the MIME type from that DE's internal configuration. You could replicate the behaviour of the shell script, or just call the shell ...


2

if you just want to associate them directly, and not make them default, you can add them to /usr/share/applications/mimeinfo.cache (system-wide), or ~/.local/share/applications/mimeinfo.cache (per-user). edit: using xdg-mime, as geekosaur suggests, might perhaps be more robust. In this case, you would want xdg-mime install [--mode mode] ...


2

Well I don't know if the sourcecode for the file command is human readable. But if you would like to find out why your mp4 is recognised as a iso I would start to read the sourcecode. http://packages.debian.org/experimental/file http://ftp.de.debian.org/debian/pool/main/f/file/file_5.04.orig.tar.gz



Only top voted, non community-wiki answers of a minimum length are eligible