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