Configuring desktop environment

Introduction

This page describes how Alexis Huxley configures his XFCE desktop environment; it is a list of points he often forgets are necessary.

Session setup

Under XFCE 4.12, I often found that ~/.dmrc got deleted or reverted to xfce4-session, which was not what I wanted. Under XFCE 4.16, I have yet to see a reoccurence of the same problem. So this section is just a placeholder in case it should reoccur.

Environment variable configuration

  1. How various environment variables are configured (e.g. BROWSER, EDITOR, PATH) is a personal matter. However, this is the moment in time to ensure these are set up during your X login (e.g. by ~/.xsession or a file it sources) and propogated through to non-login terminals (e.g. xfce4-terminal).

    Settings Manager

    This section relates directly to the settings which are configurable by the Settings Manager. The values presented here are just a reminder to myself of how I want things. Everybody else should skip this section.

    1. Open the Settings Manager.
    2. Appearance–>Style: raleigh-reloaded
    3. Appearance–>Icons: elementary Xfce
    4. halusky: Appearance–>Fonts–>Default Font: Sans Regular: 11
    5. halusky: Appearance–>Fonts–>Default Monospace Font: Monospace Regular: 11
    6. Desktop–>Background–>Style: None
    7. Desktop–>Background–>First Colour: Black
    8. Desktop–>Menus–>Desktop Menu–>Include applications menu on desktop right click: NO
    9. Desktop–>Menus–>Window List Menu–>Show window list menu on desktop middle click: NO
    10. Desktop–>Icons–>Icon Type: None
    11. Notifications–>General–>Appearance–>Default position: Bottom right
    12. Notifications–>General–>Appearance–>Disappear after: 5
    13. Notifications–>General–>Animations–>Fade out: NO
    14. Panel–>Panel 2: Remove
    15. Panel–>Panel 1–>Display–>General–>Lock panel: NO (using the grip, move the panel to the bottom of the screen, then …–>Lock panel: YES
    16. sugo, ragu, halusky, cercis & delguine: Panel–>Panel 1–>Display–>Measurements–>Row size: 30
    17. sugo, ragu, halusky, cercis & delguine: Panel–>Panel 1–>Appearance–>Icons–>Adjust size automatically: YES (without this the launcher’s terminal icon will be horizontally squashed)
    18. halusky: Panel–>Panel 1–>Items: remove all then add: Launcher; Window Buttons; Separator; Battery Monitor; Status Tray Plugin (needed for nm-applet); PulseAudio Plugin; Workspace Switcher; Clock
    19. cercis: Panel–>Panel 1–>Items–>Launcher–>General: add: Chess, Log Out, Screenshot, Chess, File Manager, Firefox, Geeqie, GIMP, LibreOffice, Media Player, Pidgin, Terminal, Chess, Settings
    20. not halusky and cercis: Panel–>Panel 1–>Items–>Launcher–>General: add: Xfce Terminal; Log Out; Screenshot; Screensaver; Chess; Audacious; Chromium Web Browser; Geeqie; GNU Image Manipulation Program; LibreOffice; Thunar File Manager; Chess; Settings Manager
    21. Panel–>Panel 1–>Items–>Launcher–>General–>Launcher–>Xfce Terminal: Command: xfce4-terminal --maximize
    22. not cercis: Panel–>Panel 1–>Items–>Launcher–>General–>Launcher–>Screensaver: Name: Lock Screen; Command: xscreensaver-command -lock; Icon: Status Icons–>Locked
    23. close Launcher window
    24. In a terminal run:
      for F in $(grep -il chess ~/.config/xfce4/panel/launcher-1/*); do
          echo -e "[Desktop Entry]\nName=\\ \nVersion=1.0\nExec=true\nIcon=$HOME/etc/pics-essential/transparent-1x1.png" > $F
      done

      and then verify that the items on the launcher are grouped

    25. Panel–>Panel 1–>Items–>Launcher–>General–>Launcher–>Chromium Web Browser: Name: Web Browser; Command: sensible-browser %U; Icon: Web Browser
    26. Panel–>Panel 1–>Items–>Launcher–>General–>Launcher–>GNU Image Manipulation Program: Name: GIMP
    27. Panel–>Panel 1–>Items–>Launcher–>General–>Launcher–>Thunar File Manager: Name:File Browser
    28. Panel–>Panel 1–>Items–>Launcher–>General–>Launcher–>Settings Manager: Name: Settings
    29. Panel–>Panel 1–>Items–>Window Buttons–>Appearance–>Show handle: NO
    30. Panel–>Panel 1–>Items–>Window Buttons–>Appearance–>Sorting order: None
    31. Panel–>Panel 1–>Items–>Separator–>Appearance–>Style: Transparent
    32. Panel–>Panel 1–>Items–>Separator–>Appearance–>Expand: YES
    33. halusky & delguine: Panel–>Panel 1–>Items–>Battery Monitor–>Display–>Display percentage: NO
    34. Panel–>Panel 1–>Items–>Clock–>Clock Options–>Format: HH:MM:SS
    35. Screensaver–>Display Modes–>Mode: Blank Screen Only
    36. Screensaver–>Display Modes–>Blank After: 3
    37. Screensaver–>Advanced–>Display Power Management–>Power Management Enabled: YES
    38. Screensaver–>Advanced–>Display Power Management–>Quick Power-off in Blank Only Mode: YES
    39. Screensaver–>Advanced–>Fading and Colormaps–>Fade to Black when Blanking: NO
    40. Window Manager–>Style–>Theme: Biz
    41. halusky: Window Manager–>Style–>Title Font: Sans Bold 11
    42. Window Manager–>Style–>Button Layout–Shade Button: Hidden
    43. Window Manager–>Focus–>Focus Model: Focus follows mouse
    44. Window Manager–>Advanced–>Window snapping–>To other windows: YES
    45. Window Manager–>Advanced–>Wrap workspaces when reaching the screen edge–>With a dragged window: NO
    46. halusky, cercis & delguine: Workspaces–>General–>Layout–>Number of workspaces: 2
    47. not halusky, cercis & delguine: Workspaces–>General–>Layout–>Number of workspaces: 5
    48. Xfce Terminal Settings–>General–>Dynamically-set title: Replaces initial title
    49. Xfce Terminal Settings–>General–>Scrolling–>Scroll on output: NO
    50. Xfce Terminal Settings–>General–>Scrolling–>Scrollbar is: Disabled
    51. Xfce Terminal Settings–>General–>Scrolling–>Scrollback: 100000
    52. Xfce Terminal Settings–>General–>Cursor–>Cursor blinks: YES
    53. As a workaround for a Xfce4-terminal bug do the following:
      1. Run xfce4-settings-editor.
      2. In the left panel, choose channel ‘xsettings’.
      3. Click ‘Add’.
      4. Add a property called ‘/Gtk/CursorBlinkTimeout’ of type ‘Int’ and value ‘1999999999’ (i.e. 1 less than 2 billion).
      5. Click ‘Close’ and quit the program.
      6. Run xfce4-terminal and validate that the cursor blinks for more than 10s.
    54. Alexis: Xfce Terminal Settings–>General–>Clipboard–>Show unsafe paste dialogue: NO
    55. halusky, sugo, damson: Xfce Terminal Settings–>Appearance–>Font–>Font: Monospace Bold 16
    56. cercis: Xfce Terminal Settings–>Appearance–>Font–>Font: Monospace Regular 15
    57. Xfce Terminal Settings–>Appearance–>Opening New Windows–>Display menubar in new windows: NO
    58. Xfce Terminal Settings–>Colours–>General–>Text colour: darkest yellow
    59. Xfce Terminal Settings–>Advanced–>Double Click: remove ‘:’
    60. not cercis: Default Applications–>Internet–>Web Browser: Debian Sensible Browser (requires BROWSER set)
    61. cercis: Default Applications–>Internet–>Web Browser: Mozilla Firefox
    62. Default Applications–>Utilities–>Terminal Emulator: Xfce Terminal
    63. Sessions and Startup–>Application Autostart–>New: Name:x11vnc; Command: x11vnc -shared -forever -localhost -quiet -nopw (this is to allow connection to the desktop environment)
    64. cercis: Sessions and Startup–>Application Autostart–>New: Name:Pidgin; Command: pidgin
    65. not laptops: Sessions and Startup–>Application Autostart–>Power Management: OFF

          Configuring Chromium

          Sync no longer works on Chromium, so I have reverted to Firefox.

          Configuring Firefox

          Even on cercis this makes sense.

          1. Alexis only: To support per-host profiles do the following:
            1. save the firefox-wrapper script somewhere in your $PATH
            2. export BROWSER=firefox-wrapper in your dot files
            3. always call sensible-browser
            4. Create a Firefox profile as follows:
              1. Run firefox -profileManager
              2. configure a profile named <hostname> and with profile directory ~/.firefox/<hostname>
              3. Be aware that ~/.firefox is not a directory normally used by Firefox.
              4. exit Firefox
            5. Run sensible-browser.
          2. From the hamburger menu, choose Settings and make the following changes:
            1. Sync–>Sync–>Take Your Web With You–>Sign into Sync: enter credentials
            2. Sync–>Sync–>Device name–>Change Device Name: <hostname>
            3. Sync–>Sync–>Syncing–>Change: Bookmarks; Add-ons; Settings
            4. General–>General–>Startup–>Always check if Firefox is your default browser: OFF (yes, that is General twice)
            5. General–>Files and Applications–>Downloads–>Always ask you where to save files: ON
            6. General–>Browsing–>Recommend extensions as you browse: OFF
            7. General–>Browsing–>Recommend features as you browse: OFF
            8. Home–>Home–>New Windows and Tabs–>Homepage and new windows: Blank page
            9. Home–>Home–>New Windows and Tabs–>New tabs: Blank page
            10. Search–>Search–>Default Search Engine: DuckDuckGo
            11. Search–>Search–>Search Suggestions–>Provide search suggestions: OFF
            12. Search–>Search–>Search Shortcuts: disable all of them
            13. Privacy & Security–>Browser Privacy–>Enhanced Tracking Protection: Strict
            14. Privacy & Security–>Browser Privacy–>Do not track: Always
            15. Privacy & Security–>Firefox Data Collection and Use–>Allow Firefox to send technical and interaction data to Mozilla: OFF
            16. Privacy & Security–>Firefox Data Collection and Use–>Allow Firefox to install and run studies: OFF
            17. if I want to start again (e.g. after starting Firefox for the first time in years) then delete and recreate the sync account
          3. From the hamburger menu, choose Add-ons and themes and install the following:
            1. Adblock Plus by Adblock Plus
            2. Foxyproxy Standard by Erik H. Jung
            3. Google Analytics Opt-out by emano waldeck
            4. uBlock Origin by Raymond Hill
            5. Stylebot by Ankit Ahuja
            6. Print Friendly & PDF by Print Friendly & PDF
            7. URL to QR code by Saeed
            8. Video DownloadHelper by mig
            9. Geo URI Handler by Andrew67 Software

            and then adjust the settings (particular ad blacklists and proxies).

          4. Beware that Adblock Plus’s ‘Block social media icons tracking’ option will prevent Nextcloud’s Poll app from correctly displaying its ‘Sharing’ tab! (More info here and here.)
          5. Go to about:config and set:
            1. browser.tabs.closeWindowWithLastTab: false (this prevents closing the last tab)
            2. reader.parse-on-load.enabled: false (this prevents the ‘Reader View’ button from appearing)
            3. extensions.pocket.api: api.getpocket-disabled.com (disable Pocket)
            4. extensions.pocket.enabled: false (disable Pocket)
            5. extensions.pocket.site: getpocket-disabled.com (disable Pocket)
            6. toolkit.legacyUserProfileCustomizations.stylesheets: true (enable userChrome.css)
            7. widget.non-native-theme.scrollbar.size: 24 (widen scrollbar)
          6. Customise the toolbar (remove flexible space, downloads, etc).
          7. Initialise userChrome.css by running:
            PROFILE=<profile-name>
            mkdir -p ~/.firefox/$PROFILE/chrome
            echo -e '@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");' > ~/.firefox/$PROFILE/chrome/userChrome.css

            (Note the profile directory is usually under ~/.mozilla/firefox but I change that above.)

          8. Visit this page and look at the fonts; are they ‘blocky’? If yes then complete this sub-procedure:
            1. Identify the font (right click on some blocky texty; select Inspect; select Fonts; note the font name; in my case it was Helvetica)
            2. Solution #1 (best): add the following to /etc/fonts/local.conf:
              <match target="pattern">
                  <test qual="any" name="family">
                      <string>Helvetica</string>
                  </test>
                  <edit name="family" mode="assign" binding="strong">
                      <string>Arial</string>
                  </edit>
              </match>

              and then log out and log in again (so that X gets restarted).

            3. Solution #2 (worst): go to about:preferences; then Fonts and Colours; then Advanced; disable ‘Allow pages to choose their own fonts, instead of your selections above’.
          9. Move the cache (? or everything) to /scratch/$USER/.

          GIMP

          1. Make the following settings changes:
            1. Edit–>Preferences–>Interface–>Theme: System
            2. Edit–>Preferences–>Interface–>Icon Theme: Legacy
            3. Edit–>Preferences–>Interface–>Toolbox–>Appearance–>Show GIMP logo: OFF
            4. Edit–>Preferences–>Interface–>Toolbox–>Appearance–>Use tool groups: OFF
            5. Windows–>Single-Window Mode: OFF
          2. Configure the contents of the toolbox window to be:
            1. the tools
            2. Layers dialog
            3. Tool Options dialog
            4. Fonts dialog

          Sound

          1. Play a video on youtube and check that sound comes out of the speakers.

          Printers

          This is only for cercis.

          1. Ensure LPDEST is set in ~/.profile and the current environment (e.g. ENVY_5000).
          2. Use Firefox to verify that the printer is listed and can print.
          3. Run:
            date | lp

          Scanning

          This is only for cercis.

          1. Check the scanner works using GIMP: File–>Create–>Xsane–>hpaio*–>…
          2. Click Acquire Preview.
          3. Ensure that a colour document gets a colour preview; if not then this can be changed in one of the windows already open.

          Installing Dropbox (normal mode)

          This is only to be done on delguine and cercis.

          1. Clean up any previous installation by running:
            killall dropbox dropboxd
            mv ~/Dropbox ~/Dropbox.delete-soon
            rm -fr ~/.drop*
            rm <any-symlinks-you're-using-for-dropbox>
          2. Download the 64-bit Dropbox .deb file from here.
          3. Install it by running the following as root:
            dpkg -i <path-to-the-deb-file-you-downloaded>
            apt-get -y -f install
          4. Run dropbox as yourself:
            dropbox start

            but note that it takes quite a long time to start first time (it will open a new tab in the browser to authenticate) and to synchronise.

          5. Remove the downloaded .deb file; you no longer need it.
          6. Verify that Dropbox starts at login-time.
          7. PCMS will complain that the Dropbox respository is not signed. Fix this by running:
            rm /etc/apt/sources.list.d/dropbox.list

          Skype

          delguine only

          1. Download skype from here.
          2. Optionally put it in the package archive.
          3. Install it as follows:
            apt -y install skype

          Unison

          This section is no longer needed but I keep it here in case I ever sync between different distros or distro versions and Unison complains about Unison version mismatches. The official Unison pages link to Norbert Preining’s pages, which lead to his OBS page.

          1. On Debian 10 run:
            cd /tmp
            wget http://download.opensuse.org/repositories/home:/npreining:/debian-unison/Debian_10/amd64/unison-2.51+4.11.1_2.51.4-1~np2_amd64.deb
            dpkg -i --force-all *.deb
            cd <where-to-stash-new-unison>
            cp /usr/bin/unison-2.51+4.11.1 .
            ln -s unison-2.51+4.11.1 unison
            dpkg --purge unison-2.51+4.11.1
          2. On Debian 11 run:
            cd /tmp
            wget http://download.opensuse.org/repositories/home:/npreining:/debian-unison/Debian_11/amd64/unison-2.51+4.11.1_2.51.4-1~np2_amd64.deb
            dpkg -i --force-all *.deb
            cd <where-to-stash-new-unison>
            cp /usr/bin/unison-2.51+4.11.1 .
            ln -s unison-2.51+4.11.1 unison
            dpkg --purge unison-2.51+4.11.1
            

          Use of siteid scripts and site-specific versions of some directories

          This is only for Alexis.

          1. To allow several systems to use identical startup files (e.g. .profile, .bashrc, etc) do the following:
            1. Somewhere in $PATH create a simple script that should just run cat ~/.siteid or display an error message if that file is not found.
            2. Create ~/.siteid containing an suitable site name; ideally this should be a single word (e.g. ‘home‘, ‘work‘, etc).
            3. Modify the startup files to use the siteid command to tailor the environment (e.g.SITEID=$(siteid); [ $SITEID = home ] && nexcloud &)
          2. To allow home synchronisation scripts to exclude arbitrary subdirectories:
            1. Create directory .site-$SITEID.
            2. Move to-be-excluded directories into there and symlink them (e.g. mv ~/.cache ~/.site-home/.cache; ln -sr ~/.site-home/.cache ~)
            3. Note that the ~./.siteid should definitely be relocated in this manner.
            4. Beware that, by default, obexd does not like ~/.cache being a symlink. Use this workaround, which is taken from here:
              mkdir -p ~/.config/systemd/user/obex.service.d/
              {
                  echo "[Service]"
                  #  Remove previous definition
                  echo "ExecStart="
                  #  ExecStart won't expand env vars so wrap in bash
                  echo "ExecStart=/bin/bash -c 'exec /usr/libexec/bluetooth/obexd --symlinks --auto-accept --root=\"\$HOME\"'"
              } > ~/.config/systemd/user/obex.service.d/10-symlink.conf
              systemctl --user daemon-reload
              killall obexd
              systemctl --user start obex
            5. Home synchronisation scripts should assemble a list of exclusions based on running something like find ~ -type d -name '.site-*' -prune -o -print.

              See also