Xfce4
![]() Xfce4 default configuration running on samsung-serranove | |
Name | Xfce4 |
---|---|
Graphics stack | Xfwm4 on X11 |
Toolkit | GTK 3 |
In postmarketOS | |
Package | postmarketos-ui-xfce4 |
Status | Available |
Xfce4 is a GTK-based desktop environment aiming to be fast and lightweight. It works on most devices with a working display, and runs fine without hardware acceleration. Uses latest Xfce version packages from Alpine repository.
Installation
pmbootstrap init
User interface: xfce4
The number of default installed packages is kept low on intension for usage on phones/tablets (limited storage) and development (installation time). Turning it into a full-featured desktop would blow it up a lot. The idea is that users individually install additional software they need. You can add the ones you would like in pmbootstrap init
at step "Extra packages" or later on by sudo apk add ...
. For a list of additional software, see Xfce4#Additional_software.
Better (touch) usability
- General font size can be enlarged in Settings -> Appearance -> Fonts -> Custom DPI setting. Logout or reboot thereafter.
- The font size of the windows title bars can be enlarged in Settings -> Window Manager. Depending on the device, try e.g. size 16.
- On devices with large screen, the windows scaling can be set to 2x in Settings -> Appearance > Settings -> Window Scaling.
- In Settings -> File Manager Settings -> Side Pane, the Shortcut Pane Icon Size can be increased to e.g. 48 px.
- In the lower panel there is a launcher that starts the terminal maximized. This can also be assigned to a hardware button or to other launchers by
xfce4-terminal --maximize
. - If you can't grab something by touchscreen, use the keyboard (tab key to go through the elements, arrow keys to choose).
- The onboard keyboard can be hidden/shown by clicking the onboard icon in the panel. A bigger floating icon can be enabled in the onboard settings.
- To simulate right mouse clicks with the touchscreen, long-click the return key of the onboard keyboard to get some mouse click options at the right side of the keyboard. For other possibilities of right mouse click emulation see Input_methods#Simulate_secondary_click.
- Hiding the cursor is done by autostart command
unclutter-xfixes --start-hidden --hide-on-touch
(just for information).
Panel
- In Settings -> Panel, the panel height can be increased. Setting automatically hide to
Intelligently
will hide it if a window overlaps the panel area. - Icon size of NetworkManager and Onboard can be changed in Settings -> Panel -> Items -> System Tray Plugin -> Edit -> Fixed icon size.
- To save space on the panel, running programs can be represented as icons only: Settings -> Panel -> Items -> Windows Button -> Edit -> uncheck Show button labels.
- Reduce the workspace switcher size by Settings -> Panel -> Items -> Workspace Switcher -> Edit -> Appearance: Buttons -> thereafter click the Workspace Settings below and rename the Workspace names to something shorter, e.g. 1, 2, 3, 4. Adding blank spaces before and after the numbers makes the buttons a bit larger again.
- For shutdown and reboot, the Action Buttons plugin can be added to the panel. In their settings, Appearance can be set to Action Buttons and the list below allows to choose which ones shall be shown.
- As menu plugin, Whisker Menu is set by default. The plugin Application Menu can be used as alternatively, depending on your taste.
- For battery monitoring the "Power Manager Plugin" was added to the panel. This also offers a screen brightness control. To make it look nicer, the label was changed to Percentage, a transparent separater was added between the plugin and the clock and the icon size was changed by the file
~/.config/gtk-3.0/gtk.css
. However, if the screen is small and the panel crowded, plugin "Battery Monitor" can be used instead because it's more space-saving than the "Power Manager Plugin".
Horizontal mode
Depending on the device, changing Xfce4 to landscape orientation can increase usability.
- Rotate the display and touch to horizontal using Display guide.
- In panel setting, change the mode to
Deskbar
and remove other plugins. - Use CoreApps as they work best on horizontal screens.
Performance
On devices with low computing power or without video acceleration, in Settings -> Window Manager Tweaks -> Compositor disable Enable display compositing
to get a faster experience.
On some devices, unfortunately, this causes a black screen on the reboot/shutdown dialog (probably because of the transparency of this screen). The screen is still responsive so you have to click "something" in the center, the device will either reboot, shutdown, logout or lock. Instead you better add the Action Buttons plugin to the panel and use this, see Xfce4#Panel section above.
If you can't reach the settings window to disable compositing for some reason, you can also edit the file ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
, search for the line "use_compositing" and change the value to "false".
Toggle wifi
A toggle wifi button can be created from an empty launcher in the panel with command:
/bin/sh -c 'if [ "$(nmcli r wifi)" = "enabled" ]; then nmcli r wifi off; else nmcli r wifi on; fi'
.
However, it's more comfortable to have a feedback whether you really hit the button or missed it. This can be achieved by e.g.:
sudo apk add zenity
vi ~/toggle-wifi-zenity.sh
#!/bin/sh
if [ "$(nmcli r wifi)" = "enabled" ]; then
if zenity --question --title "" --text "Turn off wifi?" --no-wrap; then
nmcli r wifi off
fi
else
if zenity --question --title "" --text "Turn on wifi?" --no-wrap; then
nmcli r wifi on
fi
fi
chmod +x ~/toggle-wifi-zenity.sh
- Add an empty launcher to the panel and change it to e.g.:
- Name: Toggle wifi
- Comment: Turn on/off wifi
- Command: /home/user/toggle-wifi-zentiy.sh
- Icon: network-wireless
Firefox
- To enable touch behaviour in Firefox, add a new file
sudo vi /etc/profile.d/firefox-touch-scrolling.sh
and writeexport MOZ_USE_XINPUT2=1
. - Additionally, in
about:config
, changedom.w3c.touch_events.enabled
from 2 (default, auto-detect) to 1 (enabled). - To save space, in Firefox -> Menu -> More Tools -> Customize Toolbar the Title Bar option can be unchecked.
- With environment variable
MOZ_USE_XINPUT2=1
active, in Firefox -> Menu -> More Tools -> Customize Toolbar, drag & drob doesn't work. However, with long click on items they can be added or removed. To move them, you need to deactivateMOZ_USE_XINPUT2=1
temporarily. - A special issue: When moving the Firefox window partially out of screen, the window manager automatically positions the window back into the screen. For some reason, touch clicks in the Firefox window are then not recognized anymore. You need to open a terminall and
killall firefox
. Moving the window out of screen can happen accidentally when interacting with the title bar area, so be careful there. - In Firefox -> Menu -> More Tools -> Customize Toolbar, at the bottom you can choose a "Density", which is mainly the size of the icons.
- You can install the package
mobile-config-firefox
to improve touch usability of Firefox in general (more information on the package).
Appearance
- Panel transparency can be set in Settings -> Panel -> Appearance -> Style: Solid Color -> Color ->
+
-> choose a color, at the bottom the transparency level can be set (documentation).- If you want to clean up the set of custom colors, this can be done with gsettings. Get the selected color by
gsettings get org.gtk.Settings.ColorChooser selected-color
. To clean up the custom colors, paste the output as follows, e.g.gsettings set org.gtk.Settings.ColorChooser custom-colors "[(0.0, 0.0, 0.0, 0.69796610169491529)]"
. For the second command, when doing this via ssh, DISPLAY variable needs to be put at the beginning of the command, e.g.DISPLAY=:0
.
- If you want to clean up the set of custom colors, this can be done with gsettings. Get the selected color by
- The panel size can be changed in Settings -> Panel -> Row size (pixels).
- Scale of PulseAudio Plugin and Power Manager Plugin icons are editable in file
~./gtk-3.0/gtk.css
. For default values, see source. Log out or reboot to apply the changes. - Also additional icons can be installed, e.g.
arc-icon-theme
,oxygen-icons
,papirus-icon-theme
,zafiro-icon-theme
. - In the panel, generic monitor plugin
xfce4-genmon-plugin
can be used for all kind of information. For example entering following command to the plugin shows the battery voltage in the panel:sh -c 'echo $(echo "scale=2; $(cat /sys/class/power_supply/rt5033-battery/voltage_ocv) / 1000000" | bc) V'
. This specific example requires packagebc
to be installed and the path to the battery and available voltage file needs to be adapted.
Reset Xfce4 configs
Remove the folder ~/.config/xfce4 by e.g. rm -r ~/.config/xfce4
or move it to a backup location like mv ~/.config/xfce4 ~/.config/xfce4_backup
. After logout and login again, the default configuration from /etc/xdg/xfce4-phone should be adopted. This applies to Xfce4 settings only, not all of the above described changes will be reset.
Issues with graphics
If you experience issues with graphics, you can try to disable compositing. See Xfce4#Performance.
You can also try to set the "vblank_mode" in file ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
to "off" or "glx". To do so, the line needs to look like <property name="vblank_mode" type="string" value="off"/>
or "glx" respectively. Try this in combination with compositing enabled/disabled. The default value is "xpresent", stored at /etc/xdg/xfce4-phone/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml. In the local config at ~/.config, the default line is <property name="vblank_mode" type="empty"/>
, which means that the config of /etc/xdg/xfce4-phone is used.
If this doesn't help, maybe adding some Xorg configs to /etc/X11/xorg.conf.d can improve the situation. See e.g. Debian manpage or Arch Linux wiki.
When still unsolved, probably some work on the kernel drivers is needed.
Setting the timezone
The timezone configuration in the panel clock settings doesn't work for some reason. Setting or changing the timezone can be done by e.g. sudo setup-timezone -z Europe/Amsterdam
. Available timezones can be looked up at ls /usr/share/zoneinfo
.
Lock screen
To ease the locking, it can be assigned to e.g. the power button. Go to Settings -> Keyboard -> Application Shortcuts, look for the command xflock4, double-click the current key combination to bring up a window for re-assignment, hit the power button to assign. Additionally, you need to edit sudo vi /etc/elogind/logind.conf
, disable the line "HandlePowerKey=ignore", log out or reboot to apply the change.
An example draft script to disable inputs while locked can be found at Screen_locker:Disable_inputs#Xfce4.
The virtual keyboard layout can be changed in the screensaver settings, tab "Lock Screen", on screen keyboard command. For bigger screens, layout "Phone" can be replaced by layout "Compact". For more options of the onboard command see e.g. debian manpage.
As the onboard keyboard needs some time to show up, matchbox-keyboard can be installed alternatively and used by command matchbox-keyboard --xid
. However, it's not as configurable as the onboard keyboard.
LightDM
Autologin is configured by default. If you want to use LightDM as a login screen, see Display_manager#LightDM how to set this up.
Disk management
With the set of installed software, additional drives are not shown in the file manager and at the desktop. Install gvfs
and udisks2
to make them available (for more information see also pmaports#1377).
As a graphical interface for formatting drives or image writing, e.g. package gnome-disk-utility
can be installed (this installs udisks2
as well). After installation, it's at Accessories -> Disks. On small screens, right-click the top bar of the window, choose "Resize" and click approximately where the lower right corner of the window should be.
PDF viewer
Following applications might be installed and used for viewing PDF files: Firefox, MuPDF (see next paragraph), Evince (installs gnome-desktop
, these are just the core libraries), possibly Atril (but this brings along file manager caja
and mate-desktop
). See also PDF#PDF_viewers.
MuPDF
This is a lightweight PDF viewer. Install package mupdf-x11
. After installation, files can be opened from terminal by mupdf filename.pdf
.
Zooming in and out is done by keyboard keys +
and -
. To call the virtual keyboard, hit the onboard icon in the panel. For more keybindings see e.g. debian manpage.
Set MuPDF as the default PDF viewer by Settings -> Default Applications -> tab "Others" -> filter for "pdf" -> select "application/pdf" -> button "Open with..." -> at the bottom "Use a custom command" -> button "Browse..." -> choose /usr/bin/mupdf -> hit enter to select.
Phone applications
Packages calls
, chatty
and gnome-contacts
, which are used in Phosh, work also on Xfce4.
The package modemmanager
needs to be installed (actually gets installed automatically when installing the above mentioned packages). Start its service by sudo rc-service modemmanager start
and add it permanently by sudo rc-update add modemmanager default
. When rebooting, a dialog to enter the PIN shows up after boot (if you need to call the keyboard, click the onboard icon in the panel). The connections are managed by NetworkManager: Create a new Mobile Broadband connection and connect to it by clicking the NetworkManager icon in the panel and select the new connection. You might want to enable "connect automatically" in the settings of the connection, tab "General".
Bluetooth
For bluetooth management package blueman
is installed.
Visibility and name of the adapter can be changed by hitting the tray icon -> Adapters (or Settings -> Bluetooth Adapters). If visibility is set to hidden, it can be made temporarily visible by hitting the tray icon and choosing "Make Discoverable".
When entering the adapter or device menu for the first time, there is a question "Shall bluetooth get enabled automatically". The desicion here can later be changed by gsettings set org.blueman.plugins.powermanager auto-power-on false
or true
. When using the command via ssh, it needs an additional prepending DISPLAY=:0
.
Connections can be handled by clicking the tray icon -> Devices (or Settings -> Bluetooth Manager). Connected/disconnected notifications can be disabled in tray icon -> plugins (or in the Bluetooth Manager -> View -> Plugins) and uncheck "ConnectionNotifier".
If the device you're looking for isn't detected by blueman, you can also try by command line bluetoothctl scan on
and exit with Ctrl+C after a while.
For handling audio connections, check if the package pulseaudio-bluez
is installed by apk list pulseaudio-bluez
. Actually it should get installed automatically when installing blueman
. After connecting, when hitting the speaker icon in the panel, below the volume there should be a choice for the audio route. More Settings are available in Menu -> Multimedia -> PulseAudio Volume Control.
If the tray icon doesn't show up in the panel and the adapter isn't reachable, try if something like the following helps:
lsmod | grep bluetooth
-> note the name of the device-specific module at the right hand side, starting with "bt...".sudo modprobe -r btqcomsmd
-> use the name of the device-specific modulesudo modprobe btqcomsmd
For more troubleshooting, see Bluetooth.
For sending files via bluetooth, package bluez-obexd
needs to be installed. However, file transfer seems not to work (?).
Additional software
gvfs
to make the trash can available.gvfs
andudisks2
for mounting drives and drive management.- Browser:
firefox
orfirefox-esr
. For touch usability of firefox, see Xfce4#Firefox. If you need something more lightweight, you can trymidori
. - For opening PDF files, see Xfce4#PDF_viewer.
- Text editor e.g.
mousepad
. - Image viewer e.g.
ristretto
. - Taking screenshots with
xfce4-screenshooter
. - Graphical interface for formatting drives or writing images e.g.
gnome-disk-utility
.
GitLab
Default configs of Xfce4 desktop environment are managed in the subproject xfce4-phone.
They go into the package postmarketos-ui-xfce4.
Gallery
-
Nexus 5x running Xfce4
-
Example configuration with CoreKeyboard running on Nexus 5x
-
Example configuration with matchbox-keyboard running on Galaxy SII
-
Samsung Galaxy S4 Mini Value Edition running Xfce4
-
Samsung Galaxy S4 Mini Value Edition with onboard keyboard