LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-28-2010, 09:51 AM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Default applications


How are default applications chosen if you're not running a desktop environment, and how do you change them?
 
Old 08-28-2010, 09:57 AM   #2
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,887
Blog Entries: 28

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Probably depends on the distro.

Debian uses the freedesktop mime specs. You can also change things using update-alternatives. Browsers are a pain because most set themselves as the default when they get installed.
 
Old 08-28-2010, 10:25 AM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
What is "xdg-open" and does it have something to do with this?
 
Old 08-28-2010, 11:05 AM   #4
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Quote:
Originally Posted by MTK358 View Post
What is "xdg-open" and does it have something to do with this?
man xdg-open gives this:
Quote:
xdg-open(1) - Linux man page
Name

xdg-open - opens a file or URL in the user's preferred application
Synopsis

xdg-open {file URL}

xdg-open {--help --manual --version}

Description

xdg-open opens a file or URL in the user's preferred application. If a URL is provided the URL will be opened in the user's preferred web browser. If a file is provided the file will be opened in the preferred application for files of that type. xdg-open supports file, ftp, http and https URLs.

xdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as root.
So it does have something to do with your default (preferred) application. It's used on the command line.
Cheers,
jdk

Last edited by jdkaye; 08-28-2010 at 11:07 AM.
 
Old 08-28-2010, 11:06 AM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
What is "xdg-open"
xdg-open
So it opens an URL with the user's "default browser".
If you are not running a DE, then AFAIK you have to specify the required application every time.
 
Old 08-28-2010, 11:18 AM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by tredegar View Post
If you are not running a DE, then AFAIK you have to specify the required application every time.
I discovered man xdg-mime.
 
Old 08-28-2010, 11:24 AM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I discovered man xdg-mime.
Neat
 
Old 08-28-2010, 11:38 AM   #8
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,887
Blog Entries: 28

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
xdg-utils: /usr/bin/xdg-open
xdg-utils: /usr/share/man/man1/xdg-open.1.gz
xdg-utils - desktop integration utilities from freedesktop.org
Quote:
Description: desktop integration utilities from freedesktop.org
xdg-utils contains utilities for integrating applications with the
desktop environment, regardless of which desktop environment is used.
They are part of freedesktop.org's Portland project.
.
The following utilities are included:
.
* xdg-desktop-menu - Install desktop menu items
* xdg-desktop-icon - Install icons on the user's desktop
* xdg-icon-resource - Install icon resources
* xdg-mime - Gather MIME information about a file
* xdg-open - Open a URL in the user's preferred application that
handles the respective URL or file type
* xdg-email - Open the user's preferred email client, potentially with
subject and other info filled in
* xdg-screensaver - Enable, disable, or suspend the screensaver
* xdg-settings - get various settings (default web browser) from
the desktop environment
Homepage: http://portland.freedesktop.org/
From the man page:
Quote:
Examples

Get the desktop file name of the current default web browser

xdg-settings get default-web-browser


Check whether the default web browser is firefox.desktop, which can be false
even if "get default-web-browser" says that is the current value (if only some
of the underlying settings actually reflect that value)

xdg-settings check default-web-browser firefox.desktop


Set the default web browser to google-chrome.desktop

xdg-settings set default-web-browser google-chrome.desktop

Last edited by craigevil; 08-28-2010 at 11:41 AM.
 
Old 08-28-2010, 12:20 PM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
xdg-whatever is all very smart, but the OP asked "How are default applications chosen if you're not running a desktop environment?"

It looks to me as though this stuff needs a DE even if it doesn't really matter which one is being used.

I expect I'm missing something, but why does MTK358, the OP, want these "default applications" if there's no DE? Can anybody explain?
 
Old 08-28-2010, 12:28 PM   #10
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
For example, when an app opens a web browser it opens Firefox. I want it to open in Chromium. I'm using Openbox with no DE.
 
Old 08-28-2010, 01:01 PM   #11
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,887
Blog Entries: 28

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Chromium - ArchWiki
http://wiki.archlinux.org/index.php/...efault_browser
 
Old 08-28-2010, 01:47 PM   #12
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by craigevil View Post
That was nice. I would still like to know how exactly to see and modyfy the association for every MIME type, etc. but I'll try to search for that later.

It was also a good chance to try out the "Add Reputation" feature!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying /usr/share/applications/default.list (Or: setting default applications) arizonagroovejet Linux - Desktop 0 06-02-2010 04:19 AM
Setting Default Applications in FC JonBL Linux - Software 9 07-09-2007 09:16 PM
Default Applications inspiron_Droid Linux - Desktop 2 01-23-2007 03:58 PM
Changing default applications pharmd Ubuntu 2 12-09-2006 11:31 AM
using default applications from java? german Programming 2 06-21-2005 11:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration