all repos — website-hugo @ 08ef1f43ff4049b87d78edf43a783b5f98c326ac

My personal blog, built with Hugo!

content/articles/void-xfce.md (view raw)

  1---
  2title: "Modernizing XFCE"
  3date: 2023-02-05T16:58:16+01:00
  4tags: [foss,advice]
  5---
  6
  7This article is more of a memo for myself. Since I often re-install Linux systems, I spend a lot of time doing repetitive tasks and often forget some steps, which leads me to waste even more time figuring out what's wrong.
  8
  9These instructions allow you to get a fully functional and modern-looking XFCE desktop on a fresh install of [Void Linux]() (even though they can be adapted to work in any distro).
 10
 11## Initial system update
 12First thing I tried was to update the system, but the ISO was quite old. I had to update `xbps` before anything else:
 13
 14```
 15sudo xbps-install -u xbps
 16sudo xbps-install -Su
 17```
 18
 19## Avoid session saving
 20One thing I hate about XFCE is its fixation to save sessions. A lot of times I get my session saved and restored even with all settings turned off.
 21
 22A quick and easy solution to disable session saving entirely is just to create an empty file in place of the `sessions` directory.
 23```
 24rm ~/.cache/sessions
 25touch ~/.cache/sessions
 26```
 27
 28This way, even with everything turned on, XFCE fails create a folder with that name and everything works (or doesn't, in this case) like a charm.
 29
 30## Change that shell
 31Your shell is the main tool you use to communicate with your system, so it makes sense to replace `bash` with something more modern and feature-rich.
 32
 33```
 34sudo xbps-install -S zsh zsh-completions curl
 35chsh -s /bin/zsh
 36zsh
 37curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
 38```
 39
 40## Get some good sound quality
 41I don't like `pulseaudio`. Let's replace it with `pipewire` and `wireplumber`.
 42
 43```
 44su
 45xbps-install pipewire wireplumber
 46mkdir -p /etc/pipewire/pipewire.conf.d
 47sed '/path.*=.*pipewire-media-session/s/{/#{/' /usr/share/pipewire/pipewire.conf > /etc/pipewire/pipewire.conf
 48echo 'context.exec = [ { path = "/usr/bin/wireplumber" args = "" } ]' > /etc/pipewire/pipewire.conf.d/10-wireplumber.conf
 49ln -s /usr/share/applications/pipewire* /etc/xdg/autostart
 50xbps-remove pulseaudio alsa-plugins-pulseaudio
 51reboot
 52```
 53
 54## Make Firefox more secure
 55I like Firefox as a browser, but it doesn't come with sane defaults as far as privacy's concerned.
 56
 57First, visit [Firefox Profilemaker](https://ffprofile.com/) and create a customized `profile.zip`.
 58
 59Then, extract your zip file to the correct destination:
 60```
 61sudo xbps-install zip unzip p7zip xarchiver thunar-archive-plugin
 62unzip -o ~/Downloads/profile.zip -d ~/.mozilla/firefox/xxxxxxxx.default-default/
 63```
 64
 65Some useful extensions I always install are:
 66- [Bitwarden](https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager), a password manager;
 67- [Decentraleyes](https://addons.mozilla.org/en-US/firefox/addon/decentraleyes), to serve common JS libraries locally;
 68- [I still don't care about cookies](https://addons.mozilla.org/en-US/firefox/addon/istilldontcareaboutcookies), to hide and auto-reject cookie warnings;
 69- [LibRedirect](https://addons.mozilla.org/en-US/firefox/addon/libredirect), a redirector for [alternative front-ends](https://github.com/mendel5/alternative-front-ends);
 70- [SponsorBlock](https://addons.mozilla.org/en-US/firefox/addon/sponsorblock), to skip YouTube sponsorships automagically;
 71- [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin), the best ad-blocker.
 72
 73## Customize your DE
 74
 75Install the last required packages for desktop usability:
 76```
 77sudo xbps-install -S xfce4-whiskermenu-plugin xfce4-clipman-plugin xfce4-pulseaudio-plugin xfce4-screenshooter xclip micro neovim mpv yt-dlp
 78```
 79
 80Remove orphaned and cached packages:
 81```
 82sudo xbps-remove -Oo
 83```
 84
 85Now, open XFCE's Settings Manager and set the following options:
 86- Appearance → Style → Choose "Adwaita-dark"
 87- Desktop → Background → _<Choose your favorite wallpaper>_
 88- Desktop → Icons → Set "Icon type" to "None"
 89- Panel → _<Customize your panels>_
 90- Screensaver → Disable "Enable Screensaver"
 91- Text Editor Settings → Enable:
 92    - "Show line numbers",
 93    - "Highlight matching brackets",
 94    - "Wrap long lines"
 95- Window Manager → Style → Button layout → Remove "Shade" button from title bar
 96- Window Manager → Advanced → Windows snapping → Enable "To other windows"
 97- Window Manager → Advanced → Wrap workspaces when reaching the screen edge → Disable "With a dragged window"
 98- Window Manager Tweaks → Cycling → Enable:
 99    - "Cycle through minimized windows in most recently used order",
100    - "Cycle through windows on all workspaces",
101    - "Raise windows while cycling"
102- Window Manager Tweaks → Accessibility → Disable:
103    - "Raise windows when any mouse button is pressed",
104    - "Use mouse wheel on title bar to roll up the window"
105- Window Manager Tweaks → Accessibility → Enable "Notify of urgency by making window's decoration blink"
106- Window Manager Tweaks → Compositor → Enable "Show shadows under popup windows"
107- Xfce Terminal Settings → General → Scrolling → Set "Scrollbar is" to "Disabled"
108- Xfce Terminal Settings → Appearance →
109    - enable "Use system font",
110    - set "Background" to "Transparent background",
111    - set Opacity to 0.80;
112- Xfce Terminal Settings → Colors → Presets → Choose "Tango"
113- Keyboard → Behavior → Enable "Restore num lock state on startup"
114
115
116## Shortcuts
117Finally, set the following shortcuts:
118- Keyboard → Application Shortcuts
119
120| Command                                                                   | Shortcut                |
121|---------------------------------------------------------------------------|-------------------------|
122| `exo-open --launch TerminalEmulator`                                      | `Super` + `Return`      |
123| `xfce4-popup-whiskermenu`                                                 | `Super`                 |
124| `xfce4-screenshooter --clipboard --region`                                | `Shift` + `Super` + `S` |
125| `xfce4-screenshooter --clipboard --window`                                | `Shift` + `S`           |
126| `xfce4-screenshooter --clipboard --fullscreen`                            | `Print`                 |
127| `sh -c 'xclip -selection clipboard -t image/png -o > "$HOME/Pictures/$(date +%Y-%m-%d_%T).png"'` | `Shift` + `Super` + `V` |
128| `xflock4`                                                                 | `Super` + `L`           |
129| `loginctl suspend`                                                        | `Shift` + `Super` + `L` |