Jump to content

Xfce4: Difference between revisions

From postmarketOS Wiki
Jakko (talk | contribs)
Adding browsers to "Additonal software" section.
Jakko (talk | contribs)
Add reference on firefox touch usability in "Additional software" section.
Line 112: Line 112:
== Additional software ==
== Additional software ==
* <code>gvfs</code> and <code>thunar-volman</code> for mounting drives and drive management.
* <code>gvfs</code> and <code>thunar-volman</code> for mounting drives and drive management.
* Browser: <code>firefox</code> or <code>firefox-esr</code>. If you need something more lightweight, you can try <code>midori</code>.
* Browser: <code>firefox</code> or <code>firefox-esr</code>. For touch usability of firefox, see [[Xfce4#Firefox]]. If you need something more lightweight, you can try <code>midori</code>.
* For opening PDF files, see [[PDF#PDF_viewers]].
* For opening PDF files, see [[PDF#PDF_viewers]].
* Text editor e.g. <code>mousepad</code>.
* Text editor e.g. <code>mousepad</code>.

Revision as of 08:41, 18 September 2021

Xfce4
Xfce4 default configuration running on QEMU
Xfce4 default configuration
running on QEMU
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
  • Extra packages:
    • Add matchbox-keyboard[1], corekeyboard [2] or onboard [3] to get an on-screen keyboard. For availability of onboard see Input_methods#Onboard. (Implemented on edge by MR !2464.)

Note: As the on-screen keyboard is not displayed on demand automatically, it's best to add it to autostart. (Implemented on edge.)

Better (touch) usability

  • To hide the cursor, edit /etc/lightdm/lightdm.conf: uncomment xserver-command=X and add -nocursor.
  • Change the scaling settings to 2x in Applications/Settings/Appearance/Settings/Window Scaling setting.
  • In Window Manager settings, choose font size of about 16.
  • Disable Compositor from Window Manager Tweaks in settings to get faster experience.
  • In FileManager settings, shortcut pane icon size to 48 px and enable Single Click in Behavior section.
  • To start the terminal maximized, add command xfce4-terminal --maximize to an empty laucher or assign the command to a hardware button.
  • If you can't grap something by touchscreen, use the keyboard (tab key to go through the elements, arrow keys to choose).
  • If you want to simulate right mouse clicks, see Input_methods#Simulate_secondary_click, but actually this is not needed.

Panel

  • In Panel settings, increasing panel height and setting panels to hide Intelligently will make them easier to interact with, without losing effective screen real estate.
  • 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 space 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.
  • To save space in the panel, the time format of the clock can be changed by Settings -> Panel -> Items -> Clock -> Edit -> Format. Also custom format are possible, see documentation.
  • 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.

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.

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-zentiy.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 write export MOZ_USE_XINPUT2=1.
  • Additionally, in about:config, change dom.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 deactivate MOZ_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 choos a "Density", which is mainly the size of the tabs.
  • 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.
  • The panel size can be changed in Settings -> Panel -> Row size (pixels).
  • Additional themes can be installed, e.g. package greybird-themes.
  • Also additional icons can be installed, e.g. arc-icon-theme, oxygen-icons, papirus-icon-theme, zafiro-icon-theme.

Shut down & Restart buttons

In stable releses up to v21.06, the Shut down & Restart buttons in the Log out menu are not available. Package polkit-elogind needs to be installed (wiki). On edge and later stable releses, this package is installed by default.

Lock screen

How to enable a keyboard for the lockscreen is described at Screen_locker#xfce4-screensaver.

To ease the locking, it can be assigned to e.g. the power button. Go to Settings -> Keyboard -> Application Shortcuts, select command xflock4 and hit the power button.

An example draft script to disable inputs while locked can be found at Screen_locker:Disable_inputs#Xfce4.

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.

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.

Phone applications

Packages calls, chatty and gnome-contacts, which are used in Phosh, work also on Xfce4.

  • Caution: Currently (13.09.2021) in edge channel the installation of calls breaks xfce4 after reboot.

The package modemmanager needs to be installed. Start its service by sudo rc-service modemmanager start and add it permanently by sudo rc-update add modemmanager default. The connections are managed by NetworkManager, a dialog to enter the PIN shows up after boot.

Additional software

  • gvfs and thunar-volman for mounting drives and drive management.
  • Browser: firefox or firefox-esr. For touch usability of firefox, see Xfce4#Firefox. If you need something more lightweight, you can try midori.
  • For opening PDF files, see PDF#PDF_viewers.
  • Text editor e.g. mousepad.
  • Image viewer e.g. ristretto.
  • Taking screenshots with xfce4-screenshooter.

GitLab

Default configs of Xfce4 desktop environment are managed in the subproject xfce4-phone.

They go into the package postmarketos-ui-xfce4.

Gallery