Howto: Customise the default desktop

Discussion in 'Linux' started by optimal, Apr 19, 2009.

  1. optimal

    optimal

    Joined:
    Apr 18, 2009
    Messages:
    8
    Likes Received:
    0
    I'm not an advanced Linux user by any stretch of the imagination, and this might be common knowledge, but I certainly think that it's one of the first things a new Linux user would like to know...

    How to customise the default desktop!

    Understanding the architecture

    I don't want to go into the details (cause I don't fully care to know them), there is one "master" file that describes the desktop, and links to other files which launch the applications, and contain details about which icon to use, the titles and so forth. Anyhow, these are the main files and locations that are of interest to us (don't worry, I'll explain how to modify them all in sec):

    • /home/user/.config/xfce4/desktop/group-app.xml
      the main descriptor file, that links to these:[/*:m:2kmd4llf]
    • /usr/share/desktop-directories/
      contains the directory descriptions, that is the titles for the 4 sections "Connect", "Work", "Fun" & "Files"[/*:m:2kmd4llf]
    • /usr/share/applications/
      contains each of the "shortcuts" to your applications, directories and files[/*:m:2kmd4llf]
    Becoming "root"

    I'll probably get told off by a more experienced Linux user for the method, but meh, you need root privileges (like admin privileges on Windows) in order to modify any of the files. We do that by opening a new window with root access, do that like so:

    • ALT+F2
      then type[/*:m:2kmd4llf]
    • sudo thunar[/*:m:2kmd4llf]
    [​IMG]

    which will open a window with root privileges, you'll know it's worked cause it will look like this:

    [​IMG]

    You now have the power to wreak utter havoc on your Linux box, so it's important that you only do the things that I describe here...

    Modifying the 4 main sections - just the titles

    With your root window open, navigate to this folder:

    Code:
    /usr/share/desktop-directories
    You will see a file representing every "section" of the desktop - including Settings, Help and sub-sections like Fun > Games, I recommend you leave them be, and just concentrate on the 4 main parts, the files are called:

    • Connect[/*:m:2kmd4llf]
    • Work[/*:m:2kmd4llf]
    • Fun[/*:m:2kmd4llf]
    • Files[/*:m:2kmd4llf]
    they actually have the file extension .directory, but that's irrelevant. Right-click Connect and click Open with "Mousepad" to modify the Connect section, you should see this:

    [​IMG]

    Edit the Name, or if you're not using English as your language, the Name[LANG] that represents the language you are using. Now the Connect section has a new title! But you won't see it in action till you reboot, so you can go on to do the other 3 sections (if you want)... Good work so far!

    Modifying the contents and style of the desktop

    Again, with your root folder, navigate to:

    Code:
    /home/user/.config/xfce4/desktop
    and right click the group-app.xml file and once again hit Open with "Mousepad" (if you have a code-editor installed, use that instead, it'll be easier to read). You'll see, quite honestly a monstrous XML file that describes the "tree" that is the desktop, the sections, their sub-sections, their contents and design... Scary. At first anyhow! But it's logically arranged so no worries...

    [​IMG]

    I actually spent 10 minutes tidying it up cause I know that I'll be modding it quite a bit, but that's up to you. Anyhooo, you'll see that the XML file mostly consists of <group> and <app> elements, they're the bits we're interested in modifying so take a moment to familiarise yourself with the document as a whole.

    Can I Linux boff explain this? - Now, I'm not entirely sure why but the file repeats itself, for me, the first 4 <group> elements represent the 4 sections of the desktop, link to the .desktop files (that we modified above), the BG images, and one <app> that is_arrow... THEN, the 4 <group> elements after that contain EXACTLY THE SAME info, but continue describe the <app>s that exist on the desktop.

    After ignoring the first (seemingly defunct) <group> elements you can link to new application launchers by adding, removing or modifying the <app> elements for each <group>, you can see the <app> elements look like so:

    Code:
    <app sequence="N">/usr/share/applications/LAUNCHERNAME.desktop</app>
    The sequence="N" attribute describes which order the shortcuts appear, so 1, 2 and 3 will be the ones that appear directly on the desktop, 4, 5, 6 and so-on are the one's you see after clicking the arrow!

    The contents of the element point to a .desktop file, which is a launcher and contains the application name, command, icon, title and so forth. You will see that they all (or nearly all) exist in a folder called:

    Code:
    /usr/share/applications/
    If you navigate to that folder, you can use existing application launchers or, create your own custom ones, that can point to anything you like! That's next...

    Creating application launchers...

    I am yet to write this, but for now, you can get a rough idea from YoLinux.com...
     
    optimal, Apr 19, 2009
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.