Other optional configurations
Based on your own needs, select the corresponding functions to configure.
Switch between KDE's Wayland and X11
# Ubuntu
sudo apt install plasma-workspace-x11 plasma-workspace-wayland
# Fedora,Rocky
sudo dnf install plasma-workspace-x11 plasma-workspace-wayland
Then restart. At the bottom left of the KDE login screen, you can choose between X11 and Wayland!
Modify DNS
Using NetworkManager (most recommended, suitable for most modern distributions) This is the most flexible method. NetworkManager is the default network management tool for most mainstream distributions such as Ubuntu, Fedora, and CentOS.
- Modify the global configuration file (applies to all connections): create or edit the
/etc/NetworkManager/conf.d/dns.conffile:
sudo nano /etc/NetworkManager/conf.d/dns.conf
Add the following content:
[main]dns=none
systemd-resolved=falserc-manager=unmanaged
This tells NetworkManager not to manage DNS settings.
- Create a static resolv.conf file: edit the
/etc/resolv.conffile (create it if it doesn't exist):
sudo nano /etc/resolv.conf
Add the DNS server you want, for example:
nameserver 223.5.5.5
nameserver 119.29.29.29
options timeout:1 attempts:2
- Prevent file from being overwritten: To prevent other system services from overwriting this file, set it as immutable:
sudo chattr +i /etc/resolv.conf
(To modify this file, first use sudo chattr -i /etc/resolv.conf to unlock it)
Restart NetworkManager:
sudo systemctl restart NetworkManager
- Use
resolvectlorsystemd-resolveto check if it was successful (most recommended).
This is the most direct method to view the system's default DNS configuration.
resolvectl status
Or (for older systems)
systemd-resolve --status

Screenshot shortcut key
KDE's built-in screenshot tool is incredibly useful, and it can also record the screen. However, OBS is more professional for screen recording, so we generally only use this screenshot tool for taking screenshots.
QQ and WeChat screenshots still have some minor issues under Wayland as of 2025, so we chose KDE's built-in screenshot tool.

Here, in the custom shortcut key for capturing a rectangular area, simply enter the shortcut key you want to use.
Search tool
KDE's built-in search tool is also very useful for quickly opening the application you want. Just like this, so we'll also set up a shortcut key to invoke it.


The Meta key is the Windows key, with a Microsoft logo on it.
Disable SELinux
There's no need to enable this on a personal computer — it's just asking for trouble. On Android, however, it's fine to turn it on.
Fedora currently has this enabled by default (enforcing mode), so it needs to be turned off.
There are two ways to disable it: disabled and permissive modes. Below are the differences between these two modes:
| Features | Disabled mode | Permissive mode |
|---|---|---|
| SELinux kernel module status | Completely disable SELinux, kernel module does not run. | The SELinux kernel module is functioning normally, but it only logs violations without blocking access. |
| Access control policy | No policy is enforced, and all access is permitted. | Check the policy and record violations, but will not block operation 36. |
| Logging | Do not generate SELinux-related audit logs37. | Log all policy violations to /var/log/audit/audit.log. |
| Safety | Minimal, fully relying on traditional Linux DAC (Discretionary Access Control)28. | Higher than Disabled mode, provides a debugging environment while retaining log analysis capabilities. |
| Switching method | You must modify the configuration file /etc/selinux/config and restart the system34. | You can temporarily switch it using the command setenforce 0 without needing to reboot. |
| Applicable Scenarios | Only for completely avoiding SELinux compatibility issues (such as with outdated software); long-term use is not recommended. | Used for debugging strategies, troubleshooting permission issues, or testing SELinux rules during development. |
Due to Disabled mode, SELinux is completely turned off, and kernel modules are not loaded. All process and file access is controlled solely by traditional Linux user/group permissions (such as rwx). Therefore, we choose Permissive mode, in which SELinux policies are loaded normally but only violations are logged (e.g., when a process attempts to access an unauthorized file).
Below is the tutorial for the modification mode:
sudo vim /etc/selinux/config


# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# See also:
# https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-selinux/#getting-started-with-selinux-selinux-states-and-modes
#
# NOTE: In earlier Fedora kernel builds, SELINUX=disabled would also
# fully disable SELinux during boot. If you need a system with SELinux
# fully disabled instead of SELinux running with no policy loaded, you
# need to pass selinux=0 to the kernel command line. You can use grubby
# to persistently set the bootloader to boot with selinux=0:
#
# grubby --update-kernel ALL --args selinux=0
#
# To revert back to SELinux enabled:
#
# grubby --update-kernel ALL --remove-args selinux
#
SELINUX=permissive
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
SELINUXTYPE is about modifying SELinux policies. The targeted policy is SELinux's default policy, which primarily enforces mandatory access control on high-risk network services (such as Apache, MySQL, SSH), while other non-critical processes continue to use traditional Linux user/group permissions (DAC). This design strikes a balance between security and usability, so no modification is needed.
Just restart.
sudo reboot
UEFI boot interface rEFInd
https://www.bilibili.com/video/BV1qh411Q7d4
Install rEFInd
# Ubuntu
sudo apt update
sudo apt install refind
# Fedora
sudo dnf makecache
sudo dnf install rEFInd
Note: If you have installed three operating systems, try to install rEFInd on the first system of the Linux partition.
Confirm whether refind was installed successfully.

As shown in the figure, in the /boot/efi/EFI folder, there is a refind.
If you don't have this refind file, you'll need to install it manually.
Manual Installation Method One:
Find the /usr/share/rEFInd/ folder and check if there is a refind-install inside it. Simply run the command below.
cd /usr/share/rEFInd/
sudo ./refind-install
sudo reboot


Manual Installation Method Two:
cd /usr/share/rEFInd/
sudo cp -r /usr/share/rEFInd/refind /boot/efi/EFI/
sudo reboot
After installation, you can check the /boot/efi/EFI folder to see if refind is present.
Configure refind.conf
cd /boot/efi/EFI/refind
sudo vim ./refind.conf
Add at the last line: (If you don't know how to use the vim editor, look it up on Baidu yourself)
dont_scan_dirs ESP:/EFI/boot,EFI/ubuntu,EFI/boot,EFI/deepin_os,EFI/UOS,EFI/fedora

sduo reboot
#如果使用refind-install安装的refind,默认自动将rEFInd启动项作为第一项,如果没有进BIOS手动配置

Done!!!
Beautify
rEFInd-glassy theme: https://pan.baidu.com/s/1HgfXG3m4j57VIk4k6inI-g
Extraction code: zimo
Remember to extract it.
cd /boot/efi/EFI/refind
mkdir -p ./themes
# 你把美化包解压到哪里了,就cd到哪里
cd ~/Downloads
sudo cp -r ./rEFInd-glassy /boot/efi/EFI/refind/themes
Then
cd /boot/efi/EFI/refind
sudo vim ./refind.conf
Add at the last line: (If you don't know how to use the vim editor, look it up on Baidu yourself)
include themes/rEFInd-glassy/theme.conf
# 重新启动电脑
sudo reboot

KDE theme
First, download a theme you like from the KDE Store, then extract it.

# cd进主题的文件夹
cd ~/Downloads
# 把主题文件复制到KDE的主题
sudo cp -r ./Apple.BigSur.Dark.P6 /usr/share/plasma/look-and-feel
Once you enter the settings, you'll see it. If you can't see it, just restart your computer.

Self-starting Applications and Scripts

In the upper right corner, you can add scripts and applications. Before adding a script, make sure it has executable permissions. You can also choose to run scripts at startup and shutdown.
Example: Take the docker_x11 command xhost +local:docker as an example.
First, find a folder to store the scripts. You can create one yourself in the home partition.

touch docker_x11.bash
sudo chmod a+x ./docker_x11.bash
sudo vim ./docker_x11.bash
#!/bin/bash
# 等待 X Server 就绪(最多等 10 秒)
for i in {1..10}; do
if [ -n "$DISPLAY" ] && xset q >/dev/null 2>&1; then
/usr/bin/xhost +local:docker
exit 0
fi
sleep 1
done
In the vim editor, use :wq to save and exit.

In KDE 6 settings, find Autostart, then add a login script, not a logout script.
🟢 Login Script
- When does it execute? It runs automatically when a user logs into the system (e.g., via terminal, TTY, or SSH).
🔴 Logout Script
- When does it execute? It runs automatically when the user exits the shell or logs out of the login session.

Just find the script file and add it in.


Just restart.
Switching from Bash to Zsh
What is a shell?
Simply put, the shell is the medium through which you interact with applications. Typically, you enter the application you want to use along with its arguments into the shell. The shell then searches for the application you want to invoke in the PATH, parses the arguments, and passes them in. Finally, it returns the results to you.
If you are using the bash shell, you are most likely using some Linux distribution. Currently, most linux distributions still use bash as the default shell. Windows uses Powershell by default. Starting from Catalina, MacOS has switched its default shell from bash to zsh.
What are the advantages of zsh?
Compared to bash, zsh has a vast plugin community and mature plugin management frameworks like oh my zsh, which makes extending zsh's functionality extremely easy. You can manage zsh plugins just like you manage vim plugins.
zsh installation and configuration
First, check what shell you're currently using (usually it's bash).
echo $SHELL # 应该会显示/usr/bin/bash
# 或
echo $0 # 应该显示 "-bash"
Now let's install zsh.
# Debian系
sudo apt install zsh
#红帽系
sudo dnf install zsh

Confirm whether the installation was successful.
# 查看shell版本
bash --version
zsh --version

How do I configure zsh?
It's pretty much the same as bash.
zsh's global configuration file is located at /etc/zsh.zshc, and the single-user configuration file is located at ~/.zshrc.
But it is not recommended to modify any files right now, as we have a more elegant configuration approach:
oh my zsh!
Project address:
https://github.com/ohmyzsh/ohmyzsh
oh my zsh is currently the most popular zsh plugin management tool, comparable to vim-plug or Vundle in Vim.
Install oh my zsh
# 方式一(可能需要科学上网)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 方式二
sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
The image below shows an option to set zsh as the default shell now.


As shown in the image above, the installation was successful.
Configure oh my zsh
Now check the .zshrc file, and you'll find that Oh My Zsh has already configured almost everything for you.
If you want to use plugins, you can find the plugins section and add them there.
Here is my .zshrc for your reference.
Customize a unique zsh
Remember in the previous post I mentioned it's not recommended to modify .zshrc. This is because after using the Oh My Zsh framework, Oh My Zsh creates a ~/oh-my-zsh directory to store related files. Inside it, there is a folder named custom where we can place our configuration scripts. Oh My Zsh will automatically load the vim scripts in this directory.
Basic support for bash configuration commands. For example, the blogger migrated the bashrc script to zsh without making any changes.
I created a script named myshrc.zsh to store configurations. The file is provided below for your reference.
cd /home/用户名/.oh-my-zsh/custom
touch ./myshrc.zsh
vim ./myshrc.zsh
Simply copy all the custom settings you added in your ~/.bashrc file into this file.
For example, mine:
# 配置CUDA
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
# 配置ROS-DISTRO
export ROSDISTRO_INDEX_URL=https://mirrors.bfsu.edu.cn/rosdistro/index-v4.yaml
# 配置ROS1 Noetic
# source /opt/ros/noetic/setup.zsh
# export ROS_MASTER_URI=http://localhost:11311
# export ROS_HOSTNAME=localhost
# export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/home/tungchiahui/UserFloder/MySource/ROS_WS/gazebo_models:/home/tungchiahui/UserFloder/MySource/ROS_WS/ign_models
# 配置ROS2 Humble
source /opt/ros/humble/setup.zsh
export ROS_DOMAIN_ID=6
export IGN_GAZEBO_RESOURCE_PATH=$IGN_GAZEBO_RESOURCE_PATH:/home/tungchiahui/UserFloder/MySource/ROS_WS/gazebo_models:/home/tungchiahui/UserFloder/MySource/ROS_WS/ign_models
Then you can refresh the current terminal environment.
# 刷新环境
source ~/.zshrc
# 检查自己的配置是否生效
echo $LD_LIBRARY_PATH
Corresponding to my configuration above, the following will be printed by echo, indicating success.
/usr/local/cuda/lib64:/usr/local/cuda/lib64:
Switch the default shell.
If you select "yes" in the image below, you won't need to reconfigure it.

chsh -s $(which zsh)
echo $SHELL # 应输出 "/usr/bin/zsh"
echo $0 # 若显示 "-zsh",表示已生效
Done!
If you find that it cannot be set as default here, as shown in the image below:

Then use the following command to force the modification:
# 强制修改
sudo usermod -s /usr/bin/zsh tungchiahui(用户名)
# 验证
grep tungchiahui(用户名) /etc/passwd # 检查是否显示 "/usr/bin/zsh"
# 重启
sudo reboot

Verify after restart
echo $SHELL # 应输出 "/usr/bin/zsh"
echo $0 # 若显示 "-zsh",表示已生效

All done again!
Plugin tutorial
powerlevel10k
This plugin beautifies zsh, with the advantage of having minimal impact on terminal performance and being relatively fast.
https://github.com/romkatv/powerlevel10k
Install powerlevel10k
# 国外用户
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
# 国内用户
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
Download fonts

Please provide the Markdown fragment you'd like me to translate.


# 刷新当前环境变量
source ~/.zshrc
Check here whether all icons are displaying correctly. If they are not, it indicates a font issue. Close the terminal and reopen it to see if the font problem persists.
Okay, keep going with y.
It is recommended to refer to the configuration in this tutorial.
https://www.bilibili.com/video/BV1dX4y127JL


Below is what it looks like once configured:


If you want to reconfigure, enter:
p10k configure
If VSCode icons are not displaying completely, follow the steps below.


- Search
Terminal › Integrated: Font Family
Enter a font name that supports Nerd Font, for example:
MesloLGS NF
(MesloLGS NF must be placed at the very beginning)
- Basic ligature support
Search Terminal › Integrated: Font Ligatures
Check Enabled (allow font rendering of special ligature characters)
- Ensure GPU acceleration is enabled
- Search
Terminal › Integrated: Gpu Acceleration - Set to
on(improve rendering performance)
If GPU acceleration causes issues
- Try setting it to
offand then restart the terminal. - Check whether Fallback Ligatures are in effect.

Just reopen the terminal (GPU settings require restarting the terminal).

Add color to the terminal
If there is no color in your terminal text, add this. Some distributions like Rocky Linux have no color by default, while out-of-the-box distributions such as Fedora and Ubuntu generally have color by default.
vim ~/.bashrc
Place the following content at the very bottom of the file and save it.
# =========================================================
# Fedora / Ubuntu style colored bash prompt
# =========================================================
# Enable color support
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# Git branch function
parse_git_branch() {
git branch 2>/dev/null | sed -n '/^\*/s/^\* //p'
}
if [ "$color_prompt" = yes ]; then
if [ "$EUID" -eq 0 ]; then
# root prompt (red)
PS1='\[\e[1;31m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[1;33m\]$(parse_git_branch)\[\e[0m\]\$ '
else
# normal user prompt (green)
PS1='\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[1;33m\]$(parse_git_branch)\[\e[0m\]\$ '
fi
else
PS1='\u@\h:\w\$ '
fi
# Enable colored commands
alias ls='ls --color=auto'
alias ll='ls -lh --color=auto'
alias la='ls -A --color=auto'
alias grep='grep --color=auto'
alias diff='diff --color=auto'
alias ip='ip -color=auto'
export CLICOLOR=1
source ~/.bashrc
Flatpak software management tool
Flatpak is similar to package management tools like apt and dnf, allowing you to install software. However, it does not install basic system-level software, but rather applications like QQ and QQ Music.
When your apt or dnf doesn't have a certain piece of software, you can check Flathub to see if it's available there.
Install Flatpak
- Ubuntu
# 安装flatpak
sudo apt update && sudo apt install flatpak
# 先添加官方国外源
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# 再修改为中科大镜像源
sudo flatpak remote-modify flathub --url=https://mirrors.ustc.edu.cn/flathub
# 查看仓库详情
flatpak remotes --show-details

- Fedora
Fedora already comes with it.
# 先添加官方国外源
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# 再修改为中科大镜像源
sudo flatpak remote-modify flathub --url=https://mirrors.ustc.edu.cn/flathub
# 查看仓库详情
flatpak remotes --show-details

Font Issue Resolution
Because Flatpak is sandboxed, it often lacks fonts. Install fonts first.
#Ubuntu
sudo apt install google-noto-sans-cjk-fonts google-noto-serif-cjk-fonts
# Fedora
sudo dnf install google-noto-sans-cjk-fonts google-noto-serif-cjk-fonts
Actually, this font is called: Noto Sans CJK / Noto Serif CJK It also includes: I am sorry, I cannot process this request. The input appears to be a language label ("Chinese (Simplified + Traditional)") rather than a Markdown fragment to translate. Please provide the actual Markdown content you need translated. Japanese (JP) Korean (KR)
Then set Flatpak's font access permissions (override) so that all Flatpak applications can "see" these fonts:
sudo flatpak override --filesystem=/usr/share/fonts
sudo flatpak override --filesystem=~/.local/share/fonts
If you have previously installed Flatpak software, the above operations will not take effect on already installed software. Using QQ Music as an example, we need to make it take effect.
Enter the Flatpak sandbox environment. This command lets you enter the QQ Music sandbox terminal, just like "entering a container." The paths inside are isolated from the main system.
flatpak run --command=bash com.qq.QQmusic
Delete the old fontconfig cache. Flatpak caches font indexes within its own sandbox. After deleting the old cache, the new fonts can be recognized again.
rm -rvf ~/.var/app/com.qq.QQmusic/cache/fontconfig/
Rebuild the font cache. This step forces a rescan of the font paths (including /usr/share/fonts and user font paths). Generate a new cache file to fix the display issue.
fc-cache -f -v
Install the software
Go to the official website above to search for the software and download it.


flatpak install flathub com.obsproject.Studio

Run the software
Method 1 (Official)

flatpak install flathub com.obsproject.Studio
Method 2 (just run it as a regular software)


Appimage
For example, QQ Music only provides deb and AppImage formats, but not RPM packages (this is the case for version 1.1.7; RPM support may come later. The developers really dropped the ball by not even providing an RPM.) So if I want to install QQ Music on Fedora, I either use AppImage or choose Flatpak (I'll go with AppImage here).
First, download the AppImage.
https://y.qq.com/download/download.html

Go download a QQ Music icon from Google (since Google allows downloading transparent icons).


Put them in a folder under /home/用户名 (you can decide the name yourself; for example, I use the /home/tungchiahui/UserFloder/Applications/qqmusic/ folder).
First, grant QQ Music execution permissions.
cd ~/UserFloder/Applications/qqmusic
sudo chmod +x ./qqmusic-1.1.7.AppImage
Configure shortcuts for QQ Music:
cd ~/.local/share/applications/
touch ./qqmusic.desktop
vim ./qqmusic.desktop
sudo chmod +x ./qqmusic.desktop
Here is the content:
[Desktop Entry]
Name=QQ音乐
Exec=/home/tungchiahui/UserFloder/Applications/qqmusic/qqmusic-1.1.7.AppImage
Icon=/home/tungchiahui/UserFloder/Applications/qqmusic/QQ_Music2023.svg
Type=Application
Categories=Audio;Music;Player;
Comment=QQ Music Client for Linux
Now you can find the software and open it. If you can't find it, please restart — some less advanced distributions don't refresh the icon list very quickly.

If QQ Music crashes, this is just a problem with the QQ Music software itself. Follow the steps shown in the image below.


If you are not using KDE, you can also directly modify qqmuic.desktop: add --no-sandbox at the end of exec.
[Desktop Entry]
Name=QQ音乐
Exec=/home/tungchiahui/UserFloder/Applications/qqmusic/qqmusic-1.1.7.AppImage --no-sandbox
Icon=/home/tungchiahui/UserFloder/Applications/qqmusic/QQ_Music2023.svg
Type=Application
Categories=Audio;Music;Player;
Comment=QQ Music Client for Linux

If QQ Music is missing fonts, please install the font (this font supports multiple languages).
sudo dnf install google-noto-sans-cjk-fonts google-noto-serif-cjk-fonts
Modify the HOSTNAME
For example, I want to change it to Dell-G15-5511.
sudo hostnamectl set-hostname "Dell-G15-5511"
hostnamectl | grep "Static hostname" # 验证静态主机名
sudo systemctl restart systemd-hostnamed # 重启主机名服务
sudo systemctl restart NetworkManager # 重启网络服务
sudo reboot
echo $HOSTNAME # 验证主机名

Delete the application configuration.
Some application configurations are problematic, so you can delete their cache.
The cache is stored in the ~/.config folder.
For example, VScode is having issues:


Deleting it like this ends it.
And the following ~/.vscode is an extension.
