Archlinux User Softwares
Archlinux user softwares. Common and useful tools and apps for a personal machine.
Swaylock (swaylock-effects)
swaylock is a wayland screen locker. The original project is current unmaintained. Multiple fork
projects exist, swaylock-effects is one of them.
The original swaylock project is not actively maintained. The community maintains some forks of the original projects. They inherit a former project, one by one, basically.
To install the fork by jirutka,
run yay -S swaylock-effects-git. Note that there are other forks that you
could try, but I haven’t used them, so use at your own risk.
Don’t try to kill swaylock on another tty, this would result in a red screen.
If you really want to unlock swaylock, send pkill -USR1 swaylock in other tty.
See: https://github.com/swaywm/sway/issues/7046
Configure swaylock-effects in .swaylock/config. I posted my config below
1 | screenshots |
- The
graceattribute defines a period during which a keyboard/mouse event will cancel the lock process - The
grace-no-mouseandgrace-no-touchattributes remove mouse and touchpad events from those can cancel the lock - The
ring-colorandkey-hl-colorattributes customize the appearance of the ring showing in the lock state
Neovide - a smooth neovim GUI client
If you want fancier animation in neovim, and you don’t have a preference with work with everything inside terminal, you could try Neovide.
On Debian based distros, do NOT use the snap package. It has a lot of problems and the developers said they would probably discontinue it later
You could start neovide from the command line, or through an app launcher like
rofi. For launchers, they look for a .desktop entry file in some certain locations
that matches the request. The entry file might not set environment variables correctly,
as some neovim plugins depend on.
For example, some neovim plugin requires a correct python interpreter to work. And
starting Neovide from launcher won’t set $PATH correctly. The best solution is to
cook up a shell script and launch neovide there, like this
1 | env PATH="$HOME/anaconda3/bin:$PATH" neovide |
Create a new desktop entry under ~/.local/share/applications/
1 | [Desktop Entry] |
The entry is put under user directory because even if you editted the
the default entry file that comes with Neovide, on the next system
upgrade like pacman -Syu, it will be overwritten and your change is gone.
Fcitx5 (chinese IME pinyin)
Install packages
pacman -S fcitx5-im fcitx5-chinese-addons gtk4
Set environment variable
1 | # /etc/environment |
For fcitx5 to work on Chromium based browsers (e.g. Edge), add --gtk-version=4 to launch
parameters. You also need to install gtk4 if you have not.
If you have this problem: fcitx5 pinyin input window looks blurry in some apps such as Alacritty and
Chromium-based browser, disable ‘enable fractional scaling on wayland’ in fcitx5-configtool.
However, even with gtk4 enabled, chromium core seems to still have issue displaying fcitx5 under
wayland. The popup font is blurry (probably due to fractional scaling) and the popup position is
misaligned. Using a more native alternative such as Firefox could be a solution.
Tmux + Alacrity + Neovim settings on ArchLinux
To enable tmux true colors so that neovim colorschemes are displayed properly:
.tmux.conf
1 | set -ag terminal-overrides ",xterm-256color:RGB" |
alacritty.toml
1 | [env] |
Then restart tmux (could by kill all sessions and start tmux again) for config to load.
Note: this is the minal config (as least for me) to work. You might need other options in tmux configuration to get colors right.
Hyprland Obs Recording
Require xdg-desktop-portal-hyprland for obs to be able to use pipewire screen sharing
Docker
docker is available in the extra package, install with
pacman -S docker.
Start docker daemon with systemctl start docker, or enable it on boot with systemctl enable docker.
You have to use docker commands with root users, e.g. sudo docker pull, etc.
You can asign yourself to the docker group to remove sudo.
usermod -aG docker <username>, then newgrp docker to refresh the group priviledge.
Waybar
To correctly get the CPU temperature in waybar, check directory /sys/class/thermal/.
/sys/class contains a bunch of “devices”, in the hardware sense, and exposes
theme as if they were just files. Here, you can find thermal devices like temperature gauges,
cooling devices like fans, keyboard backlights, etc.
It your CPU is of x86 architecture, find the zone under which the type file
is ‘x86_pkg_temp’, which means “x86 packaging temperature”.
Set thermal-zone to it.
1 | "temperature": { |
interval controls the polling interval.
Browser
For firefox browser, it is recommented to install an emoji font and a Chinese font for
most pages to display properly, such as noto-fonts-cjk and noto-fonts-emoji.
Go to Settings, search for ‘Fonts’, configure fonts for ‘Latin’:
- Proportional: set to
sans-serif - Serif: a default font for ArchLinux will do, like
Nimbus Roman - Sans-serif: a default font will do, like
Nimbus Sans - Monospace: JetBrainsMono Nerd Font
For firefox, in the same window where you find the settings for variable font types (serif, sans-serif, etc.), in the very bottom there is a tickbox for “Allow pages to choose their own fonts, instead of your selections above”. Do NOT untick this, because if you do so, sites can’t display external fonts with css sheets. External fonts are those transfered on the internet rather than installed on your computer. You can browser some of those fonts at Google Fonts, where they give you a
<link>tag to include in your site document if you wanna use the font.
Media Control (Spotify)
Bring music to your Arch Linux Hyprland!
First, install your favorite music player, e.g. Netease Cloud Music, Spotify, etc. This is of your choice, but remember to pick one that supports MPRIS (Media Player Remote Interfacing Specification). There is any standard media control unit in Linux, but relax, we’re gonna make one!
It turns out, the Python script here can control any MPRIS clients, not just music players! You might be surprised that playing video in browser can be controlled, too.
You get a list of MPRIS clients currently running by
1 | $ playerctl -l |
Spotify is recommended as its support for Linux should be stronger. Both Spotify Free or Premium will do, but a premium subscription removes advertisement between songs. A Premium Family plan should take you no more than $160 RMB per year.
Install python-gobject (provides the import gi modules) and playerctl for MPRIS capabilities. gtk4
is also required, in principle. If you have installed other GUI apps before, all those could have been
already installed.
1 | pacman -S python-gobject playerctl |
There’s a caveat here. In the following script, I put a shebang #!/usr/bin/env /usr/bin/python3
at the top, instead of leaving the exact interpreter running it to shell program, I want the system
python (the one installed by pacman) to be used to execute the script. If you take a look at the
package content of playerctl, you’ll find
that the Python library is installed under the system Python’s site-package. The gi library doesn’t
have a pip distribution. The official document recommends installation via the python-gobject
package, too. If you have an Anaconda Python or some other Python in nonstandard locations, you’d
probably want to set up like this.
Python script to control
1 | #!/usr/bin/env /usr/bin/python3 |
Put the script somewhere under your home directory, ~/.config/waybar/ for example.
Setup the module in waybar config
1 | "custom/media": { |
Remember to chmod the script so you could execute it as if it was a binary:$HOME/.config/waybar/custom_modules/mediaplayer.py 2> /dev/null
TMUX
TMUX is a well-known Linux terminal session manager. It’s helpful in the way that you can preserve terminal sessions even if you quited the terminal. Most people running long caculation would want that rather than having the entire job lost at logout.
The default tmux configuration isn’t very sensitive and friendly for starters. Some tweaks and plugins are recommended to improve it.
Install TPM (TMUX Plugin Manager)
Clone TPM repo
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
Put the following at the bottom of ~/.tmux.conf
1 | # List of plugins |
Source the file or restart tmux (by stopping all sessions). Press Prefix + I to install plugins.
Add the following line before the run line to install Catppuccin theme
1 | # Catppuccin theme |
This assumes your tmux config file is
~/.tmux.conf. However somebody’s could be at~/.config/tmux/tmux.conf, due toXDG_CONFIG_HOMEconvention. Depending on where your config file is located, the plugins are installed to different directories:~/.tmux/plugins/and~/.config/tmux/plugins/, respectively.
Install AUR package
yay -S wechat-universal-bwrap
Remember to configure /etc/resolv.conf properly as the package binds that directory in the
sandbox. Wechat will read from that directly for DNS. Otherwise, you might not be able to login via
scanning the QR code.
According to wiki, the recommended way is
to set /etc/resolv.conf as a soft link to /run/systemd/resolve/stub-resolv.conf. This propagates
the systemd-resolved managed configuration to all clients. stub-resolv.conf contains the local
stub 127.0.0.53 as the only DNS server.
1 | ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf |
File Manager: Dolphin
A recent update made it depend on qt6-base. Configuring icon theme by qt5ct no longer works.
Use qt6ct instead.
Wallpaper Daemon: swww
Install swww from AUR: yay -S swww.
Start the daemon by swww-daemon.
Set a wallpaper by swww img <path>
swww supports GIFs and images of many formats. It supports configurable smooth transition effects
while changing wallpaper.