<---- template headericclude ----->
HOWTO Customize XFCE
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2006
    Posts
    7,544
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HOWTO Customize XFCE

    Table of Contents

    Introduction
    Make Desktop Icon Labels Transparent
    Disable Icon Tooltips
    Add Windows TrueType Fonts to XFCE
    Customize the Panel Clock
    The Issue of Moving Panel Icons (Or Not)
    Where the Menu Files Are Located
    First Steps to Modify the Menu
    Place Your Launcher in an Existing XFCE Submenu
    Create a New Submenu for Your Launchers
    The "Other" Submenu
    The Root Menu
    Hide a Menu Entry



    Introduction

    This is a small collection of tips and tweaks that I have learned to use with XFCE. I don't intend to maintain this thread as a formal HOWTO, so feel free to add your favorite tip or tweak here. As usual, don't ask a support question here. For that, start a new thread in a support forum. And please stick to the XFCE Desktop Environment. I don't care about any other desktop environment. Also please don't use this thread to vent about XFCE. I hereby stipulate that XFCE is not the perfect desktop environment and certainly is not for everybody. If you don't like XFCE, then that's fine with me. Stop reading now and just go away.



    Make Desktop Icon Labels Transparent

    1. When using the icon view, it is possible to change how the icon label text looks in three ways: the opacity (transparency) of the rounded text background, the color of the rounded text background, and the color of the text itself.

    2. To make the labels transparent to the desktop background image, copy the following lines to your ~/.gtkrc-2.0 file. If that file doesn't exist in your home folder, then create it.
    Code:
    style "xfdesktop-icon-view" { 
        XfdesktopIconView::label-alpha = 0 
        XfdesktopIconView::selected-label-alpha = 170 
        XfdesktopIconVIew::ellipsize-icon-labels = 1 
    
        XfdesktopIconView::shadow-x-offset = 0 
        XfdesktopIconView::shadow-y-offset = 0 
        XfdesktopIconView::shadow-color = "#000000" 
        XfdesktopIconView::selected-shadow-x-offset = 0 
        XfdesktopIconView::selected-shadow-y-offset = 0 
        XfdesktopIconView::selected-shadow-color = "#ffffff" 
    
        XfdesktopIconVIew::cell-spacing = 6 
        XfdesktopIconView::cell-padding = 6 
        XfdesktopIconView::cell-text-width-proportion = 2.5 
    
        base[NORMAL] = "#cccccc" 
        base[SELECTED] = "#cccccc" 
        base[ACTIVE] = "#cccccc" 
    
        fg[NORMAL] = "#ffffff" 
        fg[SELECTED] = "#000000" 
        fg[ACTIVE] = "#000000" 
    } 
    widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"
    3. The line by line explanations...

    Opacity of the background

    The first three entries set the opacity of the rounded text background (allowed values are from 0 (totally transparent) to 255 (totally opaque), and whether or not unselected icons get their labels ellipsized (truncated) to fit on one line. (The 'selected-' version controls the opacity of icons that have been selected with the mouse.)

    Text Shadowing

    The second six entries can be used to enable a text shadow to be painted with the icon labels. The offsets are in pixels. Setting them to 0 (the defaults) will disable the shadows entirely. Again, the 'selected-' versions apply to icons that have been selected with the mouse.

    Icon Spacing

    The third four entries set spacing and sizing for individual icons on the grid. The 'cell-spacing' property specifies the spacing between each 'cell' in the grid of icons. The 'cell-padding' property sets extra padding placed around each icon+text. The units for these two are in pixels. The 'cell-text-width-proportion' property specifies the maximum width of the text label underneath the icon, as a multiplier of the icon width (so for 30px icons, '2.5' would leave a 75px wide area underneath for the text).

    Icon Label Background Color

    The fourth three entries set the color of the rounded text background.

    * NORMAL sets the color for the regular, unselected state.
    * SELECTED sets the color for when the icon is selected, and the desktop has keyboard/mouse focus.
    * ACTIVE sets the color for when the icon is selected, but the desktop does not have keyboard/mouse focus.

    Icon Label Text Color

    The final three entries set the color of the label text. See above for the differences between NORMAL, SELECTED, and ACTIVE.



    Disable Icon Tooltips

    Tooltips (icon mouse flyovers) can be disabled by adding the line below to ~/.gtkrc-2.0. If that file doesn't exist in your home folder, then create it.
    Code:
    gtk-enable-tooltips = 0


    Add Windows TrueType Fonts to XFCE

    1. Microsoft TrueType fonts can be installed and will become available in the Appearance applet of XFCE.
    2. Create the hidden directory ~/.fonts in your home directory.
    3. Copy the *.ttf files from a Windows system to ~/.fonts.



    Customize the Panel Clock

    1. To enter a custom clock option for the time format, right-click the panel clock applet and select "Properties" and then "Custom". For example, enter the following for the time in a twelve hour format with AM and PM...
    Code:
    %l:%M %p
    2. Additional clock option codes from the date man page...
    Code:
    %%   a literal % 
    %a   locale's abbreviated weekday name (e.g., Sun) 
    %A   locale's full weekday name (e.g., Sunday) 
    %b   locale's abbreviated month name (e.g., Jan) 
    %B   locale's full month name (e.g., January) 
    %c   locale's date and time (e.g., Thu Mar  3 23:05:25 2005) 
    %C   century; like %Y, except omit last two digits (e.g., 21) 
    %d   day of month (e.g, 01) 
    %D   date; same as %m/%d/%y 
    %e   day of month, space padded; same as %_d 
    %F   full date; same as %Y-%m-%d 
    %g   last two digits of year of ISO week number (see %G) 
    %G   year of ISO week number (see %V); normally useful only with %V 
    %h   same as %b 
    %H   hour (00..23) 
    %I   hour (01..12) 
    %j   day of year (001..366) 
    %k   hour ( 0..23) 
    %l   hour ( 1..12) 
    %m   month (01..12) 
    %M   minute (00..59) 
    %n   a newline 
    %p   locale's equivalent of either AM or PM; blank if not known 
    %P   like %p, but lower case 
    %r   locale's 12-hour clock time (e.g., 11:11:04 PM) 
    %R   24-hour hour and minute; same as %H:%M 
    %s   seconds since 1970-01-01 00:00:00 UTC 
    %S   second (00..60) 
    %t   a tab 
    %T   time; same as %H:%M:%S 
    %u   day of week (1..7); 1 is Monday 
    %U   week number of year, with Sunday as first day of week (00..53) 
    %V   ISO week number, with Monday as first day of week (01..53) 
    %w   day of week (0..6); 0 is Sunday 
    %W   week number of year, with Monday as first day of week (00..53) 
    %x   locale's date representation (e.g., 12/31/99) 
    %X   locale's time representation (e.g., 23:13:48) 
    %y   last two digits of year (00..99) 
    %Y   year 
    %z   +hhmm numeric timezone (e.g., -0400) 
    %Z   alphabetic time zone abbreviation (e.g., EDT)


    The Issue of Moving Panel Icons (Or Not)

    1. The panel icons in some XFCE versions can behave differently from other versions regarding moving the icons around on the panel. Icons sometimes may refuse to be moved to certain spots in the panel.

    2. Try adding an "Empty space" separator to the panel. Then the icons can be moved next to the empty space. The final order of icons the icons can be controlled by the order that they are moved to that spot. When the icons are correct, the separator can be removed.

    3. If you lose track of empty space separators in the panel, you can find them by closely observing the mouse as you move along the panel. And the file ~/.config/xfce4/panel/panels.xml can help in verifying what panel items are present.



    Where the Menu Files Are Located

    1. The system menu files are located in...
    /etc/xdg/menus
    /usr/share/applications
    /usr/share/desktop-directories
    /usr/share/pixmaps
    2. You create your user's menu files in these home directory folders...
    ~/.config/menus
    ~/.local/share/applications
    ~/.local/share/desktop-directories
    ~/.local/share/icons



    First Steps to Modify the Menu

    1. There is no XFCE menu editor any more AFAIK. Not to worry. The XFCE menus are not difficult to modify IMO. I keep mine simple though. I recommend doing the next two steps before attempting to modify the installed menu even though they all are not strictly required in every modification.

    2. Create in your home directory the four directories specified above in "Where the Menu Files are Located". Some may already exist. You will make your changes and additions in these four folders in your home directory, and the changes will appear in the XFCE menu....
    Code:
    # mkdir -p $HOME/.config/menus
    # mkdir -p $HOME/.local/share/applications
    # mkdir -p $HOME/.local/share/desktop-directories
    # mkdir -p $HOME/.local/share/icons
    3. Copy the system menu file /etc/xdg/menus/xfce-applications.menu to your home directory. Adjust its permissions...
    Code:
    $ cp /etc/xdg/menus/xfce-applications.menu $HOME/.config/menus
    $ chmod 700 $HOME/.config/menus/xfce-applications.menu
    $ chown $USERNAME:$USERNAME $HOME/.config/menus/xfce-applications.menu


    Place Your Launcher in an Existing XFCE Submenu

    1. Do the things described above in "First Steps to Modify the Menu".

    2. Create your launcher by any of the usual ways.

    3. Open the launcher file (.desktop file) for editing and enter a “Category” to place the launcher in the desired existing submenu (e.g., System, Office, etc.) See your ~/.config/menus/xfce-applications.menu file for the names of the various existing categories. Here is an example from my launcher for MS Paint that goes in the existing "Graphics" submenu...
    Code:
    [Desktop Entry] 
    Version=1.0 
    Encoding=UTF-8 
    Name=MS Paint 
    Comment=Create and edit graphics 
    Exec=wine mspaint.exe 
    Icon=/home/boo/images/icons/mspaint.png 
    Type=Application 
    Terminal=false 
    OnlyShowIn=GNOME;XFCE; 
    Categories=Graphics;
    4. Move your launcher that now has a "Categories" entry to ~/.local/share/applications.

    5. Sometimes, logging out and back in is needed to see a change in the menus.



    Create a New Submenu for Your Launchers

    1. Do the things described above in "First Steps to Modify the Menu".

    2. The next steps to create a new submenu are...
    A. Edit your xfce-applications.menu file
    B. Create a .directory file
    C. Deal with the submenu icon
    D. Create your launchers (.desktop files)
    3. An example from my XFCE menu to illustrate those steps is probably the best idea. I created a submenu named "Scripts" for the launchers for my little collection of scripts that I commonly run...
    A. I added the following section to my ~/.config/menus/xfce-applications.menu file to create the new submenu. This new section can be at the end or between existing submenu entries. The location of a new submenu section in xfce-applications.menu will be the same in the actual list of submenus that it creates in the root menu. The <Name> element specifies the name of the submenu, but this is not the name that appears in the root menu (that's explained in step B next). The <Directory> element specifies the name of the .directory file (explained in step B next). The <Category> element specifies the category name of the submenu (explained more in step C below). Always begin a custom category name with "X-".
    Code:
    <Menu> 
         <Name>Scripts</Name> 
         <Directory>scripts.directory</Directory> 
         <Include> 
              <Category>X-Scripts</Category> 
         </Include> 
    </Menu>
    B. Next, I created what I call the ".directory" file which is a simple text file with the following lines and saved it as ~/.local/share/desktop-directories/scripts.directory. This is the file referred to by the <Directory> element in ~/.config/menus/xfce-applications.menu in step A above. The "Name" specified here will appear in the root menu as the name of the submenu. The "Icon" specified here will appear in the root menu beside the name of the submenu (explained more in step C next).
    Code:
    [Desktop Entry] 
    Version=1.0 
    Name=Scripts 
    Icon=utilities
    Type=Directory
    C. Next, I copied the icon that I wanted for the submenu to ~/.local/share/icons. This is the icon referred to by "Icon=" in the .directory file in step B above. The icon file was named utilities.png in my icon collection, but I found that I should omit the path and .png extension for the icon in these .directory files.

    D. Lastly, I created the launchers (.desktop files) in ~/.local/share/applications. These launcher .desktop files can be created manually with a text editor or with the little applet that creates desktop launchers (best idea, probably). For example, you can create a launcher on the desktop with the little applet, edit the launcher as described next, and then move it from the desktop to ~/.local/share/applications. The following example is from one of my script launchers to illustrate the format of the .desktop files. In the example below, "Categories" specifies the category name established in ~/.config/menus/xfce-applications.menu in step A above. That is what makes the launcher appear in that submenu. Any other launchers that specify that submenu's category name also will appear in the submenu. And you can specify more than one category name separated by semi-colons in a launcher's .desktop file to make it appear in multiple submenus. See how that works?...
    Code:
    [Desktop Entry] 
    Version=1.0 
    Encoding=UTF-8 
    Name=Clean up the permissions of my files 
    Comment= 
    Exec=sudo /home/boo/scripts/filefix 
    Icon=/home/boo/files/icons/file_utils.png 
    Type=Application 
    Terminal=true 
    OnlyShowIn=GNOME;XFCE; 
    Categories=X-Scripts; 
    GenericName=
    4. You can create your new submenu entry by following the example above and change the submenu name, .directory filename, category name, launcher name, icon, etc.



    The "Other" Submenu

    1. Launchers specifying a non-existent category or no category at all will go in the "Other" submenu.
    2. The "Other" submenu isn't displayed until it is needed.



    The Root Menu

    1. Launchers specifying "X-Xfce-Toplevel" for "Categories" will go in the root menu.
    2. I've never tried this or wanted to try it.



    Hide a Menu Entry

    1. Copy the specific desktop entry file to the home directory...
    Code:
    cp /usr/share/applications/whatever.desktop $HOME/.local/share/applications
    2. Then open it for editing and add the following line...
    Code:
    NoDisplay=true


    References:
    http://wiki.xfce.org/howto/customize-menu
    XFCE README.txt

  2. #2
    Join Date
    Mar 2009
    Location
    Broomfield, CO
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HOWTO Customize XFCE

    Some nice tips... note that you can simply use alacarte to edit menus with 4.8.

  3. #3
    PabloTwo's Avatar
    PabloTwo is offline "Fedora User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    8,903
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)

    Re: HOWTO Customize XFCE

    Thanks stoat. The "Make Desktop Icon Labels Transparent" entry fixed a weird color issue that cropped up after I changed hardware. I had a similar, but much briefer entry in ~/.gtkrc-2.0 that did the job on the old hardware. After the hardware switch, the text background of the desktop icons turned a sickly green, and I had totally forgotten about that ~/.gtkrc-2.0 entry.

    Your offering totally fixed that issue. But then, I'm in Openbox 95% of the time now, which has no desktop icons. And ya know what? I don't miss them at all.

  4. #4
    Join Date
    Jul 2004
    Location
    Wake Forest, NC
    Age
    70
    Posts
    1,494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HOWTO Customize XFCE

    Quote Originally Posted by nirik
    Some nice tips... note that you can simply use alacarte to edit menus with 4.8.
    Reviving this thread to ask if there is any viable alternative to using alacarte to edit the menus. I don't want all the dependencies that are brought in with alacarte (having just gotten rid of them). Is there any hope of having a menu editor like alacarte for XFCE?
    StephenH

    "We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach

    http://pilgrim-wanderings.blogspot.com

  5. #5
    Join Date
    Mar 2009
    Location
    Broomfield, CO
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HOWTO Customize XFCE

    Not that I know of off hand currently. You could manually edit the .desktop files I suppose...

  6. #6
    Join Date
    Jul 2004
    Location
    Wake Forest, NC
    Age
    70
    Posts
    1,494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HOWTO Customize XFCE

    Quote Originally Posted by nirik
    Not that I know of off hand currently. You could manually edit the .desktop files I suppose...
    That is also what I was hoping to avoid. I guess I will try to follow the instructions and do so though. I just can't see installing the list of dependencies that are "required" for alacarte.

    yum deplist alacarte
    Loaded plugins: presto, refresh-packagekit
    Finding dependencies:
    package: alacarte.noarch 0.13.2-3.fc15
    dependency: gnome-panel
    provider: gnome-panel.x86_64 3.0.0.1-3.fc15
    provider: gnome-panel.x86_64 3.0.0.1-4.fc15
    dependency: /usr/bin/python2.7
    provider: python.i686 2.7.1-7.fc15
    provider: python.x86_64 2.7.1-7.fc15
    dependency: gnome-menus >= 2.27.92
    provider: gnome-menus.x86_64 3.0.1-1.fc15
    provider: gnome-menus.i686 3.0.1-1.fc15
    dependency: python(abi) = 2.7
    provider: python.x86_64 2.7.1-7.fc15
    provider: python.i686 2.7.1-7.fc15
    dependency: pygtk2
    provider: pygtk2.x86_64 2.24.0-1.fc15
    provider: pygtk2.x86_64 2.24.0-3.fc15
    dependency: /bin/sh
    provider: bash.x86_64 4.2.10-2.fc15
    provider: bash.x86_64 4.2.10-4.fc15
    dependency: gnome-python2-gconf
    provider: gnome-python2-gconf.x86_64 2.28.1-4.fc15

    If it were all but the gnome ones, I could understand, but I specifically don't want the gnome ones as they will bring in even more gnome items. It was enough of a pain getting rid of them the first time.

    Maybe one of these days the XFCE devs will see that there is a need for a version of alacarte tailored for XFCE. Until then though, I guess we just make do with what we have.
    StephenH

    "We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach

    http://pilgrim-wanderings.blogspot.com

  7. #7
    Join Date
    Mar 2009
    Location
    Broomfield, CO
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HOWTO Customize XFCE

    https://bugzilla.redhat.com/show_bug.cgi?id=709166

    alacarte just needs to be subpackaged a bit better.

  8. #8
    Join Date
    Jul 2004
    Location
    Wake Forest, NC
    Age
    70
    Posts
    1,494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HOWTO Customize XFCE

    Here's another one that I just came across:

    http://forum.xfce.org/viewtopic.php?pid=23139#p23139

    It allows one to have desktop backgrounds that change periodically such as using wallpapoz in Gnome Shell. I am using the crontab option, not the bash script.
    Last edited by StephenH; 4th October 2011 at 05:39 PM. Reason: clarification
    StephenH

    "We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach

    http://pilgrim-wanderings.blogspot.com

  9. #9
    Join Date
    Jul 2004
    Location
    Wake Forest, NC
    Age
    70
    Posts
    1,494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HOWTO Customize XFCE

    Here's a really handy one for those of us who own netbooks that have no indicator LEDs or other indicator for the caps, num, and scroll lock keys. After trying a number of different options and failing, I installed GKrellM and then downloaded and compiled a plugin called gkleds (GKrellM-leds) which will indicate the state of the caps and numlock keys. It has an indicator for Scroll lock as well but that does not seem to do anything on my netbook.

    It does not seem to have a binary for Fedora 15. I had to locate the required tools and compile it myself. It is working well. I turned off all the other monitors for the time being and just have the key indicators on screen now. I can always turn the others on as needed/desired.

    I downloaded the source from this site: http://heim.ifi.uio.no/~oyvinha/files/files/
    StephenH

    "We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach

    http://pilgrim-wanderings.blogspot.com

Similar Threads

  1. Fedora 10 xfce xfce menu not working well
    By xroox in forum Hardware
    Replies: 2
    Last Post: 3rd June 2020, 01:50 AM
  2. How do I customize after install?
    By RobinQi in forum Installation, Upgrades and Live Media
    Replies: 3
    Last Post: 4th December 2009, 04:46 AM
  3. Replies: 1
    Last Post: 19th March 2009, 04:08 AM
  4. how do I customize the look?
    By wutbox in forum Using Fedora
    Replies: 3
    Last Post: 14th August 2007, 01:10 AM
  5. How-To: Customize Your Install
    By Thoreau in forum Links
    Replies: 0
    Last Post: 10th June 2004, 03:46 AM

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
  •  
[[template footer(Guest)]]