Skip to main content

freedesktop standard

 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        $XDG_CONFIG_HOME, /etc/xdg

$XDG_CACHE_HOME       $HOME/.cache

$XDG_RUNTIME_DIR       access mode MUST be 0700.

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

Desktop File ID

/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 \
 

Localized values for keys

 

 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
 

D-Bus Activation

 

  <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 as DESKTOP_STARTUP_ID environment variable (Startup Notification Protocol Specification)  .
activation-tokenXDG_ACTIVATION_TOKEN, as per  as specified by the XDG Activation protocol
  

Interfaces

 declared by implements key
 

Registering MIME Types

  MimeType key shows supported mimetype

 

Additional applications actions

 actions are used to define quicklist or jumplist

Action identifier

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

Action keys

 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 and NotShowIn
            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

Popular posts from this blog

sxhkd volume andbrightness config for dwm on void

xbps-install  sxhkd ------------ mkdir .config/sxhkd cd .config/sxhkd nano/vim sxhkdrc -------------------------------- XF86AudioRaiseVolume         amixer -c 1 -- sset Master 2db+ XF86AudioLowerVolume         amixer -c 1 -- sset Master 2db- XF86AudioMute         amixer -c 1 -- sset Master toggle alt + shift + Escape         pkill -USR1 -x sxhkd XF86MonBrightnessUp          xbacklight -inc 20 XF86MonBrightnessDown          xbacklight -dec 20 ------------------------------------------------------------- amixer -c card_no -- sset Interface volume run alsamixer to find card no and interface names xbps-install -S git git clone https://git.suckless.org/dwm xbps-install -S base-devel libX11-devel libXft-devel libXinerama-devel  vim config.mk # FREETYPEINC = ${X11INC}/freetype2 #comment for non-bsd make clean install   cp config.def.h config.h vim config.h xbps-install -S font-symbola #for emoji on statusbar support     void audio config xbps-i

fix idm integration on chrome

Chrome Browser Integration I do not see IDM extension in Chrome extensions list. How can I install it?  How to configure IDM extension for Chrome? Please note that all IDM extensions that can be found in Google Store are fake and should not be used. You need to install IDM extension manually from IDM installation folder. Read in step 2 how to do it . 1. Please update IDM to the latest version by using  "IDM Help->Check for updates..."  menu item 2.  I don't see  "IDM Integration module"  extension in the list of extensions in  Chrome . How can I install it? Press on  Chrome  menu ( arrow 1  on the image), select  "Settings"  menu item ( arrow 2  on the image) and then select  "Extensions"  tab ( arrow 3  on the image). After this open IDM installation folder ( "C:\Program Files (x86)\Internet Download Manager"  by default,  arrow 4  on the image) and drag and drop  "IDMGCExt.crx"  ( arrow 5  on the image) file int

Hidden Wiki

Welcome to The Hidden Wiki New hidden wiki url 2015 http://zqktlwi4fecvo6ri.onion Add it to bookmarks and spread it!!! Editor's picks Bored? Pick a random page from the article index and replace one of these slots with it. The Matrix - Very nice to read. How to Exit the Matrix - Learn how to Protect yourself and your rights, online and off. Verifying PGP signatures - A short and simple how-to guide. In Praise Of Hawala - Anonymous informal value transfer system. Volunteer Here are five different things that you can help us out with. Plunder other hidden service lists for links and place them here! File the SnapBBSIndex links wherever they go. Set external links to HTTPS where available, good certificate, and same content. Care to start recording onionland's history? Check out Onionland's Museum Perform Dead Services Duties. Introduction Points Ahmia.fi - Clearnet search engine for Tor Hidden Services (allows you