XDG = Cross-Desktop Group
specs:
Autostart
Desktop base directories (basedir)
Desktop entries (.desktop)
Desktop menus (menu)
File manager D-Bus interface
File URIs
Free media player specifications
Media Player Remote Interfacing Specification (MPRIS)
Shared MIME database (shared-mime-info)
Startup notifications
Trash
XML Bookmark Exchange Language (XBEL)
x11 specs
DnD
UTF8_STRING
Window manager specification
X clipboard explanation
------------------------------------------------------------------------------------------------------------------
1. autostart-spec
$XDG_CONFIG_DIRS/autostart
no XDG_CONFIG_HOME use ~/.config/autostart/
no $XDG_CONFIG_DIRS use /etc/xdg/autostart/
mount media
() autostart files: precendence: .autorun, autorun, autorun.sh
() autoopen :precedence: .autoopen, autoopen
------------------------------------------------------------------------------------------------------------------
2. basedir-spec
$XDG_DATA_HOME
$HOME
/.local/share
$XDG_CONFIG_HOME
$HOME
/.config
$XDG_STATE_HOME
$HOME
/.local/state, $XDG_DATA_HOME,
user binaries
$HOME
/.local/bin
$XDG_DATA_DIRS
$XDG_DATA_HOME,
/usr/local/share/:/usr/share/
$XDG_CONFIG_DIRS
/etc/xdg$XDG_CONFIG_HOME,
$XDG_CACHE_HOME
$HOME
/.cache
access
mode MUST be 0700. $XDG_RUNTIME_DIR
All paths set in these environment variables must be
absolute
------------------------------------------------------------------------------------------------------------------
3.desktop-entry-spec
Desktop entry files has .desktop or
.directory and name must be
valid
D-Bus
well-known name reverse dns style(special only - and _ allowed)
org.example.FooViewer.desktop
/usr/share/applications/foo/bar.desktop
has
the desktop file ID foo-bar.desktop
.
(replace / with - relative to
$XDG_DATA_DIRS)
only
$XDG_DATA_DIRS/applications has ID other dirs no id
Format
#
and blank lines defines comment
[groupname] = group header with name groupname
Desktop Entry group header must be present its used as
"magic key" for mime detection
There should be nothing preceding this group in .desktopfile
except comment
entries are defined as Key=Value
Multiple keys in the same group may not have the same name.
multiple values should be separated by a semicolon,semicolon as value must be escaped by \
Name[LOCALE]=Value
LOCALE= lang
_COUNTRY
.ENCODING
@MODIFIER (lang is cmompulsary )
LC_MESSAGES = LOCALE is selected
keys
Type,
Name,GenericName,
NoDisplay,
Comment,
Icon,
Hidden,
OnlyShowIn
,NotShowIn,
DBusActivatable
TryExec,
Exec,
Path,
Terminal,
Actions,
MimeType,
Categories,
Implements,
Keywords,
StartupNotify,
StartupWMClass,
URL,
PrefersNonDefaultGPU,
SingleMainWindow
FIle code
%f = single file name
%F= multiple file names
%u =single url
%U= multi url
only one of above can be used at once
%[d,D,n,N,v,m] =depreciated
%i= expand icon key as --icon and value
%c= translated name of app
%k = location of .desktop
<interface name='org.freedesktop.Application'>
<method name='Activate'>
<arg type='a{sv}' name='platform_data' direction='in'/>
</method>
<method name='Open'>
<arg type='as' name='uris' direction='in'/>
<arg type='a{sv}' name='platform_data' direction='in'/>
</method>
<method name='ActivateAction'>
<arg type='s' name='action_name' direction='in'/>
<arg type='av' name='parameter' direction='in'/>
<arg type='a{sv}' name='platform_data' direction='in'/>
</method>
</interface>
Methods ::
Activate = used when there is no files to open
Open = app is started with files
ActivateAction= when
DesktopActions
are activated
Arguments of Methods::
desktop-startup-id
= same asDESKTOP_STARTUP_ID
environment variable (Startup Notification Protocol Specification) .
activation-token
=XDG_ACTIVATION_TOKEN
, as per as specified by the XDG Activation protocol
declared by implements key
MimeType key shows supported mimetype
actions are used to define quicklist or jumplist
each action is identified with string(action identifier)
Each identifier is associated
with an action group
The action group is a group named Desktop Action %s, where %s is action identifier.
action group for an action identifier not mentioned in the Actions key is invalid
name(compulsary),icon,exec
example
[Desktop Entry] Version=1.0 Type=Application Name=Foo Viewer Comment=The best viewer for Foo objects available! TryExec=fooview Exec=fooview %F Icon=fooview MimeType=image/x-foo; Actions=Gallery;Create; [Desktop Action Gallery] Exec=fooview --gallery Name=Browse Gallery [Desktop Action Create] Exec=fooview --create-new Name=Create a new Foo! Icon=fooview-new
--------------------------------------------------------------------------
menu-spec
$XDG_CONFIG_DIRS
/menus/${XDG_MENU_PREFIX}
applications.menu
$XDG_CONFIG_DIRS
/menus/${XDG_MENU_PREFIX}
applications.menu
$XDG_CONFIG_DIRS
/menus/${XDG_MENU_PREFIX}
applications.menu
$XDG_CONFIG_DIRS
/menus/${XDG_MENU_PREFIX}
applications.menu- desktop entries :
Categories
,OnlyShowIn
andNotShowIn
.
Categories=Qt;Graphics;RasterGraphics;Viewer;
Categories=GNOME;Utility;
formats
<Menu> <AppDir><DefaultAppDirs><DirectoryDir><Name><Directory>
<OnlyUnallocated><NotOnlyUnallocated><Deleted> <NotDeleted><Include><Exclude><Filename><Category><All><And><Or><Not><Separator>
example
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"> <Menu> <Name>Applications</Name> <Directory>Applications.directory</Directory> <-- Search the default locations --> <DefaultAppDirs/> <DefaultDirectoryDirs/> <-- Merge third-party submenus --> <MergeDir>applications-merged</MergeDir> <-- Merge legacy hierarchy --> <LegacyDir>/usr/share/applnk</LegacyDir> <-- Define default layout --> <DefaultLayout> <Merge type="menus"/> <Merge type="files"/> <Separator/> <Menuname>More</Menuname> </DefaultLayout> <-- some random moves, maybe to clean up legacy dirs, maybe from menu editing --> <Move> <Old>Foo</Old> <New>Bar</New> <Old>Foo2</Old> <New>Bar2</New> </Move> <-- A preferences submenu, kept in a separate file so it can also be used standalone --> <Menu> <Name>Preferences</Name> <Directory>Preferences.directory</Directory> <MergeFile>preferences.menu</MergeFile> </Menu> <-- An Office submenu, specified inline --> <Menu> <Name>Office</Name> <Directory>Office.directory</Directory> <Include> <Category>Office</Category> </Include> <Exclude> <Filename>foo.desktop</Filename> </Exclude> </Menu> </Menu>
location::
/usr/share,/etc/xdg, /usr/local/share ,$HOME/.local/share
File Manager DBus Interface
<interface name='org.freedesktop.FileManager1'>
<method name='ShowFolders'>
<arg type='as' name='URIs' direction='in'/>
<arg type='s' name='StartupId' direction='in'/>
</method>
<method name='ShowItems'>
<arg type='as' name='URIs' direction='in'/>
<arg type='s' name='StartupId' direction='in'/>
</method>
<method name='ShowItemProperties'>
<arg type='as' name='URIs' direction='in'/>
<arg type='s' name='StartupId' direction='in'/>
</method>
</interface>
org.freedesktop.FileManager1,
/org/freedesktop/FileManager1
Comments
Post a Comment