Results 1 to 2 of 2

Thread: create global GNOME app folder categories

  1. #1
    Join Date
    Mar 2009
    Location
    Chemnitz, Germany
    Posts
    7

    Default create global GNOME app folder categories

    Hi,

    Summary: I want to create Groups in GNOME app launcher (app folder categories) but dont know where to put the config for all users.


    openSUSE 13.2 x86_64; GNOME 3.14.1

    I have some desktop files with "Categories=GNOME;X-MYGROUP;" in /usr/share/applications/ a /usr/share/desktop-directories/mygroup.directory and /etc/xdg/menus/applications-merged/mygroup.menu. All installed desktop files are listed with the app launcher correctly.


    Now, I want to build a Group (in GNOME words Categories since 3.10). For a user I can

    Code:
    # gsettings set org.gnome.desktop.app-folders folder-children "['Utilities', 'Sundry', 'YaST', 'MyGroup']"
    # gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/MyGroup/ name "My Group"
    # gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/MyGroup/ categories "['X-MYGROUP']"
    and all works as expected. Now, I want to configure this for all users (incl new users).

    I create a glib-2.0 schema

    /usr/share/glib-2.0/schemas/org.gnome.desktop.app-folders.folders.MyGroup.gschema.xml:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <schemalist gettext-domain="gsettings-desktop-schemas">
      <schema path="/org/gnome/desktop/app-folders/folders/MyGroup/" id="org.gnome.desktop.app-folders.folders.MyGroup">
        <key type="s" name="name">
          <default>'My Group'</default>
          <summary>Folder name</summary>
          <description>The name of the application folder.</description>
        </key>
        <key type="as" name="categories">
          <default>['X-MYGROUP']</default>
          <summary>Categories</summary>
          <description>A list of categories for which apps will be placed into this folder by default, in addition to the apps that are listed in the apps key.</description>
        </key>
      </schema>
    </schemalist>
    and

    /usr/share/glib-2.0/schemas/My-branding.gschema.override:
    Code:
    [org.gnome.desktop.app-folders]
    folder-children = ['Utilities', 'Sundry', 'YaST', 'MyGroup']
    
    [org.gnome.desktop.app-folders.folders.MyGroup]
    categories = ['X-MYGROUP']
    name = 'My Group'
    running

    Code:
    glib-compile-schemas /usr/share/glib-2.0/schemas
    and for safety, a reboot, without success.

    dconf-editor shows the config I made on the right place but gsettings only patially:

    Code:
    # gsettings get org.gnome.desktop.app-folders folder-children
    ['Utilities', 'Sundry', 'YaST', 'MyGroup']
    # gsettings get org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/MyGroup/ categories
    @as []
    # gsettings get org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/MyGroup/ name
    ''
    I also tried to configure it via dconf profiles in /etc/dconf/profile but without success too.

    I have searching how the YaST entries find its way but can't locate them.

    Can anyone help here?

    Thanks in advance
    Last edited by mgoppold; 25-Jan-2015 at 10:20. Reason: spelling mistake

  2. #2
    Join Date
    Mar 2009
    Location
    Chemnitz, Germany
    Posts
    7

    Default Re: create global GNOME app folder categories

    OK, here is a solution:

    dconf profiles are the correct place to configure this:

    Code:
    # [ -d /etc/dconf/profile ] && mkdir -p /etc/dconf/profile
    # [ -d /etc/dconf/db/site.d ] && mkdir -p /etc/dconf/db/site.d
    # cat >> /etc/dconf/profile/user <EOF
    system-db:site
    EOF
    # cat >> /etc/dconf/db/site.d/00_site_settings_my_group <EOF
    [org/gnome/desktop/app-folders]
    folder-children = ['Utilities', 'Sundry', 'YaST', 'MYGROUP']
    
    [org/gnome/desktop/app-folders/folders/MYGROUP]
    categories = ['X-MYGROUP']
    name = 'My Group'
    EOF
    
    # dconf update
    With this proceeding it's easy to build other application groups like older gnome versions did it:

    Code:
    # cat >> /etc/dconf/db/site.d/10_site_settings_office <EOF
    [org/gnome/desktop/app-folders]
    folder-children = ['Utilities', 'Sundry', 'YaST', 'MYGROUP', 'Office']
    
    [org/gnome/desktop/app-folders/folders/Office]
    categories = ['Office']
    name = 'Office'
    EOF
    
    # dconf update
    and surprisedly all libreoffice Office applications (and some other) are in such a group. To discover wich Categorie you should use:

    Code:
    # grep Categories /usr/lib64/libreoffice/share/xdg/writer.desktop
    Categories=Office;WordProcessor;X-Red-Hat-Base;X-MandrivaLinux-Office-Wordprocessors;
    All files in /etc/dconf/db/site.d/ are processed in lexical order and therefore it is important to ensure that the last file contains all your app folers.

    If you played with dconf-editor or gsettings you have a local user-config and you don't see the global modifications. You can reset the entry by:

    Code:
    gsettings reset org.gnome.desktop.app-folders folder-children

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •