Xfce4 Desktop Environment Customization

NicoHood edited this page Nov 1, 2016 · 12 revisions

Xfce4 Desktop Environment Customization

Overview

This guide shows how you can customize your Xfce setup to look super fancy while it still runs on slower PC, such as the Raspberry Pi. Those settings are the one I prefer and use over the time. You can always use something different. Be careful when you use commands that require root privilegs.

xfce

Software

I've mainly used the following packages for my modifications:

Packages

The software from the official sources mainly contains packages from xfce4, xfce4-goodies, optional dependencies and the other required software listed above. Not all packages of the xfce4 groups were used here.

# X-Org
# Also install special acceleration drivers for your graphics card:
# https://wiki.archlinux.org/index.php/xorg
PKG_DESKTOP+="xorg-server mesa mesa-libgl xf86-input-libinput xf86-video-fbdev "
PKG_DESKTOP+="xf86-video-vesa gstreamer-vaapi libva-mesa-driver "
PKG_DESKTOP+="libva-vdpau-driver libx264 "

# Intel
PKG_DESKTOP+="libva-intel-driver libvdpau-va-gl "

# Nvidia
PKG_DESKTOP+="xf86-video-nouveau mesa-vdpau "

# ATI
PKG_DESKTOP+="xf86-video-ati mesa-vdpau  "

# AMD
PKG_DESKTOP+="xf86-video-amdgpu mesa-vdpau "

# Raspberry Pi
PKG_DESKTOP+="xf86-video-fbturbo-git "

# Virtual Box
PKG_DESKTOP+="linux-headers linux-lts-headers "
PKG_DESKTOP+="virtualbox-guest-utils virtualbox-guest-dkms "


# Lightdm
PKG_DESKTOP+="lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings "
PKG_DESKTOP+="accountsservice light-locker "

# Xfce4
PKG_DESKTOP+="exo garcon gtk-xfce-engine xfce4-panel xfwm4 xfce4-terminal "
PKG_DESKTOP+="xfce4-power-manager xfce4-session xfce4-settings xfconf "
PKG_DESKTOP+="xfdesktop compton "

# File manager
PKG_DESKTOP+="thunar thunar-volman thunar-archive-plugin tumbler file-roller "
PKG_DESKTOP+="catfish mlocate gvfs udisks udisks2 thunar-media-tags-plugin "
PKG_DESKTOP+="ffmpegthumbnailer freetype2 libgsf libopenraw poppler-glib "

# Sound
PKG_DESKTOP+="xfce4-mixer gstreamer0.10-good-plugins pulseaudio paprefs "
PKG_DESKTOP+="pavucontrol alsa-utils pulseaudio-zeroconf "

# (Fallback) Themes
PKG_DESKTOP+="arc-gtk-theme arc-icon-theme gnome-themes-standard gtk-engine-murrine elementary-icon-theme "

# Network
PKG_DESKTOP+="networkmanager network-manager-applet dnsmasq avahi nss-mdns "

# Plank dock
PKG_DESKTOP+="plank "

# Whiskermenu
PKG_DESKTOP+="xfce4-whiskermenu-plugin alacarte "

# Xfce4 panel plugins
PKG_DESKTOP+="nm-connection-editor xfce4-xkb-plugin xfce4-cpugraph-plugin "
PKG_DESKTOP+="xfce4-genmon-plugin xfce4-sensors-plugin xfce4-notes-plugin "

# Install other DE related tools/plugins (also see xfce4-goodies)
PKG_DESKTOP+="dconf-editor xdg-user-dirs xfce4-notifyd "

# Install the listed software
sudo pacman -S --needed ${PKG_DESKTOP}

Configuration

Not all options can be set via command line or GUI. Sometimes you have to mix. On a clean install some commands might fail because no config file exists yet. Thanks why I've mainly focused on setting the settings via GUI only. The commands are just optional for legacy purposes, not all will work.

You might need to restart the session or PC that the changes take affect.

Raspberry Pi

Config.txt

On the Raspberry Pi you first want to configure your monitor before you start using the DE. This can be done via editing /boot/config.txt. Important settings are summarized below:

# General display setting
disable_overscan=1
hdmi_force_hotplug=1
disable_splash=1

# A higher color depth only increases the gpu mem by 4mb, also for kodi
# But the desktop backgrounds and web pages will look way better
# sudo /opt/vc/bin/vcdbg reloc
framebuffer_depth=32
framebuffer_ignore_alpha=1

# For more information visit:
# https://www.raspberrypi.org/documentation/configuration/config-txt.md

Tools

To make use of tools as tvservice you can add /opt/vc/bin to your $PATH.

# Global, all users
echo 'export PATH=${PATH}:/opt/vc/bin' | sudo tee -a /etc/bash.bashrc

# Current user only
echo 'export PATH=${PATH}:/opt/vc/bin' >> ~/.bashrc

Lightdm

# Try DE first to see if it works
sudo systemctl start lightdm.service

# Enable DE if it works and you want to start it at boot
sudo systemctl enable lightdm.service

Panel

  • Use the default panel layout when starting xfce for the first time
  • Go to Settings->Panel
  • Delete the bottom panel with -
  • Only for setups with more than two monitors:
  • Select the top panel
  • Go to Display
  • Set Output to auto
  • Unlock the panel, move it to the desired monitor and lock again

Whiskermenu

  • Go to Settings->Panel->Items
  • Add whiskermenu and remove the normal Application menu
  • Configure whisker menu (Select whiskermenu and click the edit button)
  • Set Appearance->PanelButton->Display to Icon and title
  • Set Behavior->Menu with Switch categories by hovering and Position categories next to panel button
  • Set Commands->Lock Screen to light-locker-command -l
  • Set Commands->Switch Users to dm-tool switch-to-greeter
  • Set Commands->Edit Applications to alacarte
  • Disable Commands->Edit Profile

Panel Plugins

  • Edit the Action Buttons entry in Settings->Panel->Items

  • Set Appearance to Action Buttons and only check Log Out...

  • Add Keyboard Layouts in Settings->Panel->Items and set it to text, small, globally

  • Add Power Manager Plugin in Settings->Panel->Items

  • Add CPU Graph in Settings->Panel->Items

  • Configure CPU Graph (Select CPU Graph and click the edit button)

  • Pick the color of the task bar (#2B2E37) as Background

  • Pick the close button color (#CC575D) as Color 1

  • In Advanced set Width to 64

  • Set Associated command to gnome-system-monitor

  • Only check the show border box and uncheck all other options

  • Add Notes

  • Configure Notes (Select Notes and click the edit button)

  • Set Tabs position to Top

  • Set Background to GTK+

  • Set Font to Monospace 10

Wallpaper

  • Download the wallpaper
  • Copy the wallpaper to /usr/local/share/backgrounds/xfce/
  • Go to Settings->Desktop
  • Go to Background
  • Enable the wallpaper for every display
  • Go to Icons
  • Set Icon type as None
  • Also disable all desktop menus in Settings->Desktop->Menus
sudo install -Dm 644 glacier.jpg /usr/local/share/backgrounds/xfce/glacier.jpg
xfconf-query -c xfce4-desktop -p /desktop-icons/style -s 0
xfconf-query -c xfce4-desktop -s "/usr/local/share/backgrounds/xfce/glacier.jpg" \
-p /backdrop/screen0/monitor0/workspace0/last-image

Theme

Install the Arc gtk and icon theme. Arc theme and icons have to be installed from AUR or from git. See the official build instructions for the most up to date installation instructions. You can use elementary as icon theme fallback.

  • Go to Settings->Window Manager
  • Go to Style
  • Enable the theme (Arc-Darker)
  • Go to Settings->Appearance
  • Go to Style
  • Enable the theme (Arc-Darker)
  • Go to Icons
  • Enable the theme (Arc)
  • Go to Settings->LightDM GTK+ Greeter settings
  • Select Arc-Dark as Theme
  • Select Arc as Icons
  • Select the glacier.jpg from /usr/local/share/backgrounds/xfce/ as Image
  • Go to Settings->Mouse and Touchpad
  • Go to Theme
  • Select elementary as cursor
  • Set a user avatar
xfconf-query -c xfwm4 -p /general/theme -s "Arc-Darker"
xfconf-query -c xsettings -p /Net/ThemeName -s "Arc-Darker"
xfconf-query -c xsettings -p /Net/IconThemeName -s "Arc"
sudoedit /etc/lightdm/lightdm-gtk-greeter.conf

Plank

  • Call plank --preferences to set the Transparent theme
  • Go to Settings->Session and Startup
  • Go to Application Autostart
  • Add and entry Plank with the command plank
  • Start plank
dconf write /net/launchpad/plank/docks/dock1/theme "'Transparent'"
mkdir -p ~/.config/autostart/
ln -s /usr/share/applications/plank.desktop ~/.config/autostart/plank.desktop

Keyboard shortcuts

To configure some keys you first need to press the key, than the modifier. For example first press Print and then Alt to trigger the setting. Some other keys may only be available on keyboard with media keys.

  • Go to Settings->Keyboard
  • Go to Layout
  • Make sure to Use system defaults and set the X11 keyboard config properly
  • Go to Application Shortcuts
  • Make sure your keyboard shortcut table looks like this:
Command Shortcut
exo-open --launch FileManager XF86Explorer
exo-open --launch FileManager Super+E
exo-open --launch MailReader XF86Mail
exo-open --launch TerminalEmulator Super+T
exo-open --launch WebBrowser XF86HomePage
exo-open --launch WebBrowser XF86WWW
gnome-calculator XF86Calculator
light-locker-command -l Ctrl+Alt+L
xfce4-display-settings --minimal Super+P
xfce4-display-settings --minimal XF86Display
xfce4-popup-whiskermenu Super+Space
xfce4-screenshooter --fullscreen Print
xfce4-screenshooter --region Ctrl+Print
xfce4-screenshooter --window Alt+Print
xfdesktop --menu Ctrl+Escape
xset dpms force off XF86Sleep
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/Print \
-s "xfce4-screenshooter --fullscreen"
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/Super_L \
-s "xfce4-popup-whiskermenu"
xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Alt>F1" -r
xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Alt>F2" -r
xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Alt>F3" -r

Network

# Enable DNS caching
sudo sed -i 's/^dns=.*/dns=dnsmasq/' /etc/NetworkManager/NetworkManager.conf

# Replace dhcpcd with NetworkManager
sudo systemctl disable dhcpcd
sudo systemctl stop dhcpcd
sudo systemctl start NetworkManager
sudo systemctl enable NetworkManager

# Enable and start avahi name resolution
sudo systemctl start avahi-daemon.service
sudo systemctl enable avahi-daemon.service
sudo sed -i 's/^hosts: files*/hosts: files mdns_minimal [NOTFOUND=return]/' /etc/nsswitch.conf

Xfce Tweaks

  • Go to Settings->Window Manager Tweaks

  • Go to Cycling

  • Enable Cycle through windows on all workspaces

  • Disable Draw frame around selected windows while cycling

  • Go to Accessibility

  • Disable Use mouse wheel on tile bar to roll up the window

  • Go to Workspaces

  • Disable Use the mouse wheel on the desktop to switch workspaces

  • Go to Compositor

  • Disable Show shadows under dock windows to remove the sticky horizontal line

  • Enable Synchronize drawing to the vertical blank

  • Or disable compositing and use compton instead:

  • Go to Settings->Session and Startup

  • Go to Application Autostart

  • Add entry: Compton, Compositor for X11, compton

  • Start compton

  • Go to Settings->Window Manager->Style->Button layout

  • Set the window button layout to close,minimize,maximize:title

  • Go to Settings->Session and Startup

  • Go to General

  • Disable Automatically save session on logout

  • Go to Session

  • Hit Clear saved session

  • Go to Settings->Workspaces

  • Set Number of workspaces to 1

xfconf-query -c xfwm4 -p /general/cycle_workspaces -s true
xfconf-query -c xfwm4 -p /general/cycle_draw_frame -s false
xfconf-query -c xfwm4 -p /general/mousewheel_rollup -s false
xfconf-query -c xfwm4 -p /general/scroll_workspaces -s false
xfconf-query -c xfwm4 -p /general/show_dock_shadow -s false
xfconf-query -c xfwm4 -p /general/button_layout -s 'CHM|'

xfconf-query -c xfce4-session -p /general/AutoSave -s false
rm -f ~/.cache/sessions/xfce4-session-*

xfconf-query -c xfwm4 -p /general/workspace_count -s 1

Programs

Thunar Filemanager

  • Open Thunar

  • Go to Edit->Preferences->Side Pane

  • Set all Icon Size to Very Small

  • Go to Behavior

  • Enable Middle Click->Open folder in new tab

  • Go to Edit->Configure custom actions...

  • Add a search entry Search: Search this folder for files using Catfish

  • Install catfish mlocate

Name Command File patterns Appears if selection contains
Search catfish --path=%f * Directories
echo "Configuring file manager..."
xfconf-query -c thunar -p /shortcuts-icon-size -s "THUNAR_ICON_SIZE_SMALLEST"
xfconf-query -c thunar -p /tree-icon-size -s "THUNAR_ICON_SIZE_SMALLEST"
xfconf-query -c thunar -p /misc-middle-click-in-tab -s true

Terminal

  • Open a Terminal and go to Edit->Preferences
  • Go to General
  • Disable Scroll single line using Shift-Up/-Down keys
  • Disable Scroll on output
  • Go to Appearance
  • Set Font to Monospace 11
  • Set the Background to Transparent background with Transparency 0.95
  • Go to Colors
  • Set Background color to the Arc window color (#2F343F)
  • Set Cursor color to the Arc text color (#AAAAAA)
  • Set Tab activity color to The Arc close button color (#FF5555)
  • You can also drop the colors from the Palette

Add history search of the command line to the terminal. Type a previous command start and then use shift + up to search the history filtered with the command start. Can also be set local for the user in ~/.inputrc.

# Global, all users
echo '"\e[1;2A": history-search-backward' | sudo tee -a /etc/inputrc
echo '"\e[1;2B": history-search-forward' | sudo tee -a /etc/inputrc

# Current user only
echo '"\e[1;2A": history-search-backward' >> ~/.inputrc
echo '"\e[1;2B": history-search-forward' >> ~/.inputrc

Intel driver

There is no need in installing the intel driver, as the kernel already supports the intel chipset even better.

Libre Office

# Fix GTK themes
sudo sed -i '/export SAL_USE_VCLPLUGIN=gtk$/s/^#//g' \
/etc/profile.d/libreoffice-fresh.sh
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.