all repos — birabittoh.github.io @ f09a92b0d1e07d2e76237b5d2961ecd61e501f18

My current website, built with Zola.

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

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