content/blog/void-xfce.md (view raw)
1+++
2title = "Modernizing XFCE"
3date = 2023-02-05
4template = "blog-page.html"
5[taxonomies]
6tags = [ "foss", "advice" ]
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/{/#{/' /usr/share/pipewire/pipewire.conf > /etc/pipewire/pipewire.conf
50echo 'context.exec = [ { path = "/usr/bin/wireplumber" args = "" } ]' > /etc/pipewire/pipewire.conf.d/10-wireplumber.conf
51ln -s /usr/share/applications/pipewire* /etc/xdg/autostart
52xbps-remove pulseaudio alsa-plugins-pulseaudio
53reboot
54```
55
56## Make Firefox more secure
57I like Firefox as a browser, but it doesn't come with sane defaults as far as privacy's concerned.
58
59First, visit [Firefox Profilemaker](https://ffprofile.com/) and create a customized `profile.zip`.
60
61Then, extract your zip file to the correct destination:
62```
63sudo xbps-install zip unzip p7zip xarchiver thunar-archive-plugin
64unzip -o ~/Downloads/profile.zip -d ~/.mozilla/firefox/xxxxxxxx.default-default/
65```
66
67Some useful extensions I always install are:
68- [Bitwarden](https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager), a password manager;
69- [Decentraleyes](https://addons.mozilla.org/en-US/firefox/addon/decentraleyes), to serve common JS libraries locally;
70- [I still don't care about cookies](https://addons.mozilla.org/en-US/firefox/addon/istilldontcareaboutcookies), to hide and auto-reject cookie warnings;
71- [LibRedirect](https://addons.mozilla.org/en-US/firefox/addon/libredirect), a redirector for [alternative front-ends](https://github.com/mendel5/alternative-front-ends);
72- [SponsorBlock](https://addons.mozilla.org/en-US/firefox/addon/sponsorblock), to skip YouTube sponsorships automagically;
73- [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin), the best ad-blocker.
74
75## Customize your DE
76
77Install the last required packages for desktop usability:
78```
79sudo xbps-install -S xfce4-whiskermenu-plugin xfce4-clipman-plugin xfce4-pulseaudio-plugin xfce4-screenshooter xclip micro neovim mpv yt-dlp
80```
81
82Remove orphaned and cached packages:
83```
84sudo xbps-remove -Oo
85```
86
87Now, open XFCE's Settings Manager and set the following options:
88- Appearance → Style → Choose "Adwaita-dark"
89- Desktop → Background → _<Choose your favorite wallpaper>_
90- Desktop → Icons → Set "Icon type" to "None"
91- Panel → _<Customize your panels>_
92- Screensaver → Disable "Enable Screensaver"
93- Text Editor Settings → Enable:
94 - "Show line numbers",
95 - "Highlight matching brackets",
96 - "Wrap long lines"
97- Window Manager → Style → Button layout → Remove "Shade" button from title bar
98- Window Manager → Advanced → Windows snapping → Enable "To other windows"
99- Window Manager → Advanced → Wrap workspaces when reaching the screen edge → Disable "With a dragged window"
100- Window Manager Tweaks → Cycling → Enable:
101 - "Cycle through minimized windows in most recently used order",
102 - "Cycle through windows on all workspaces",
103 - "Raise windows while cycling"
104- Window Manager Tweaks → Accessibility → Disable:
105 - "Raise windows when any mouse button is pressed",
106 - "Use mouse wheel on title bar to roll up the window"
107- Window Manager Tweaks → Accessibility → Enable "Notify of urgency by making window's decoration blink"
108- Window Manager Tweaks → Compositor → Enable "Show shadows under popup windows"
109- Xfce Terminal Settings → General → Scrolling → Set "Scrollbar is" to "Disabled"
110- Xfce Terminal Settings → Appearance →
111 - enable "Use system font",
112 - set "Background" to "Transparent background",
113 - set Opacity to 0.80;
114- Xfce Terminal Settings → Colors → Presets → Choose "Tango"
115- Keyboard → Behavior → Enable "Restore num lock state on startup"
116
117
118## Shortcuts
119Finally, set the following shortcuts:
120- Keyboard → Application Shortcuts
121
122| Command | Shortcut |
123|--------------------------------------------------------------------------------------------------|-------------------------|
124| `exo-open --launch TerminalEmulator` | `Super` + `Return` |
125| `xfce4-popup-whiskermenu` | `Super` |
126| `xfce4-screenshooter --clipboard --region` | `Shift` + `Super` + `S` |
127| `xfce4-screenshooter --clipboard --window` | `Super` + `S` |
128| `xfce4-screenshooter --clipboard --fullscreen` | `Print` |
129| `sh -c 'xclip -selection clipboard -t image/png -o > "$HOME/Pictures/$(date +%Y-%m-%d_%T).png"'` | `Shift` + `Super` + `V` |
130| `xflock4` | `Super` + `L` |
131| `loginctl suspend` | `Shift` + `Super` + `L` |