Hail to Wayland!

This commit is contained in:
rydesun 2026-06-29 22:58:15 +08:00
parent 7996a1cbbe
commit 75ae9af916
17 changed files with 61 additions and 70 deletions

View file

@ -10,11 +10,13 @@ shadow-opacity = 0.48
shadow-exclude = [ shadow-exclude = [
"argb && ( "argb && (
window_type = 'menu' (window_type = 'menu' && class_g != 'fcitx')
|| window_type = 'dropdown_menu'
|| window_type = 'popup_menu' || window_type = 'popup_menu'
|| window_type = 'utility' || window_type = 'tooltip'
|| (window_type = 'combo' && class_g != 'fcitx')
|| (window_type = 'utility' && class_g != 'Dunst')
)" )"
, "QTILE_INTERNAL = 1"
, "class_g = 'TelegramDesktop' && argb && override_redirect" , "class_g = 'TelegramDesktop' && argb && override_redirect"
] ]
@ -33,13 +35,13 @@ corner-radius = 12
rounded-corners-exclude = [ rounded-corners-exclude = [
"QTILE_INTERNAL" "QTILE_INTERNAL"
, "IS_FLOATING@:c = 0" , "IS_FLOATING@ = 0"
, "class_g = 'kitty'" , "class_g = 'kitty'"
, "class_g = 'mpv'", , "class_g = 'mpv'"
]; ];
################################# #################################
# Background-Blurring # # Blur #
################################# #################################
blur-method = "dual_kawase" blur-method = "dual_kawase"
@ -54,14 +56,13 @@ blur-background-exclude = [
################################# #################################
backend = "glx" backend = "glx"
glx-no-stencil = true
glx-no-rebind-pixmap = true
vsync = true vsync = true
mark-wmwin-focused = true use-damage = true
unredir-if-possible = true
use-ewmh-active-win = true
mark-ovredir-focused = true mark-ovredir-focused = true
detect-rounded-corners = true detect-rounded-corners = true
detect-client-opacity = true detect-client-opacity = true
use-ewmh-active-win = true
detect-transient = true detect-transient = true
detect-client-leader = true detect-client-leader = true
use-damage = true

View file

@ -1,2 +1,6 @@
[Unit] [Unit]
Description=Run desktop applications under Wayland Description=Run desktop applications under Wayland
BindsTo=graphical-session.target
Wants=graphical-session-pre.target graphical-session.target
After=graphical-session-pre.target

View file

@ -1,2 +1,6 @@
[Unit] [Unit]
Description=Run desktop applications under X11 Description=Run desktop applications under X11
BindsTo=graphical-session.target
Wants=graphical-session-pre.target graphical-session.target
After=graphical-session-pre.target

View file

@ -1,9 +0,0 @@
[Unit]
Description=blueman
[Service]
ExecStart=/usr/bin/blueman-applet
[Install]
WantedBy=X11.target
WantedBy=Wayland.target

View file

@ -6,4 +6,3 @@ ExecStart=/usr/bin/copyq
[Install] [Install]
WantedBy=X11.target WantedBy=X11.target
WantedBy=Wayland.target

View file

@ -1,10 +1,11 @@
[Unit] [Unit]
Description=fcitx5 Description=fcitx5
After=graphical-session.target
PartOf=graphical-session.target
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/bin/fcitx5 -d ExecStart=/usr/bin/fcitx5 -d
[Install] [Install]
WantedBy=X11.target WantedBy=graphical-session.target
WantedBy=Wayland.target

View file

@ -1,9 +1,10 @@
[Unit] [Unit]
Description=kdeconnect Description=kdeconnect
After=graphical-session.target
PartOf=graphical-session.target
[Service] [Service]
ExecStart=/usr/bin/kdeconnect-indicator ExecStart=/usr/bin/kdeconnect-indicator
[Install] [Install]
WantedBy=X11.target WantedBy=graphical-session.target
WantedBy=Wayland.target

View file

@ -1,9 +0,0 @@
[Unit]
Description=lxqt-config-monitor
[Service]
Type=oneshot
ExecStart=/usr/bin/lxqt-config-monitor -l
[Install]
WantedBy=X11.target

View file

@ -1,9 +1,10 @@
[Unit] [Unit]
Description=network-manager-applet Description=network-manager-applet
After=graphical-session.target
PartOf=graphical-session.target
[Service] [Service]
ExecStart=/usr/bin/nm-applet ExecStart=/usr/bin/nm-applet
[Install] [Install]
WantedBy=X11.target WantedBy=graphical-session.target
WantedBy=Wayland.target

View file

@ -1,3 +1,2 @@
[Install] [Install]
WantedBy=X11.target WantedBy=graphical-session.target
WantedBy=Wayland.target

View file

@ -1,9 +0,0 @@
[Unit]
Description=playerctld
[Service]
Type=oneshot
ExecStart=/usr/bin/playerctld daemon
[Install]
WantedBy=default.target

View file

@ -1,9 +1,10 @@
[Unit] [Unit]
Description=udiskie Description=udiskie
After=graphical-session.target
PartOf=graphical-session.target
[Service] [Service]
ExecStart=/usr/bin/udiskie --smart-tray ExecStart=/usr/bin/udiskie --smart-tray
[Install] [Install]
WantedBy=X11.target WantedBy=graphical-session.target
WantedBy=Wayland.target

View file

@ -0,0 +1,3 @@
[Install]
WantedBy=
WantedBy=Wayland.target

View file

@ -1,8 +0,0 @@
[Unit]
Description=xsettingsd
[Service]
ExecStart=/usr/bin/xsettingsd
[Install]
WantedBy=X11.target

View file

@ -16,6 +16,8 @@ fi
if [[ -n "$@" ]]; then if [[ -n "$@" ]]; then
# 启动锁屏程序 # 启动锁屏程序
xss-lock -- betterlockscreen -l & xss-lock -- betterlockscreen -l &
# 托盘
snixembed &
exec "$@" exec "$@"
fi fi

View file

@ -1,8 +1,6 @@
typeset -U path PATH if [[ "$HOME" == */ ]]; then HOME=${HOME:0:-1}; fi
path=($path ~/.bin)
### XDG目录 ### XDG目录
if [[ "$HOME" == */ ]]; then HOME=${HOME:0:-1}; fi
export XDG_CONFIG_HOME=$HOME/.config export XDG_CONFIG_HOME=$HOME/.config
export XDG_CACHE_HOME=$HOME/.cache export XDG_CACHE_HOME=$HOME/.cache
export XDG_DATA_HOME=$HOME/.data export XDG_DATA_HOME=$HOME/.data
@ -73,8 +71,8 @@ export XDG_MENU_PREFIX=plasma-
export XCURSOR_PATH="$XDG_DATA_HOME"/icons:/usr/share/icons export XCURSOR_PATH="$XDG_DATA_HOME"/icons:/usr/share/icons
### Qt ### Qt
# 无桌面环境用qt5ct配置Qt主题 # 假装成kde
export QT_QPA_PLATFORMTHEME=qt5ct export QT_QPA_PLATFORMTHEME=kde
# 禁止Qt自动缩放。用xrdb手动设置DPI # 禁止Qt自动缩放。用xrdb手动设置DPI
export QT_AUTO_SCREEN_SCALE_FACTOR=0 export QT_AUTO_SCREEN_SCALE_FACTOR=0
@ -85,7 +83,6 @@ export QT_ENABLE_HIGHDPI_SCALING=0
export GTK_USE_PORTAL=1 export GTK_USE_PORTAL=1
### Fcitx ### Fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx export XMODIFIERS=@im=fcitx
export SDL_IM_MODULE=fcitx export SDL_IM_MODULE=fcitx
@ -97,17 +94,28 @@ export GLFW_IM_MODULE=ibus
command -v dbus-update-activation-environment &>/dev/null && \ command -v dbus-update-activation-environment &>/dev/null && \
dbus-update-activation-environment --systemd --all 2>/dev/null dbus-update-activation-environment --systemd --all 2>/dev/null
USE_WAYLAND=true
# NOTE: 直接在登录shell中自启桌面环境 # NOTE: 直接在登录shell中自启桌面环境
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
# 只在桌面环境使用中文 if $USE_WAYLAND; then
command -v dbus-update-activation-environment &>/dev/null && \ export QT_FONT_DPI=144
dbus-update-activation-environment --systemd LANG=zh_CN.UTF-8 2>/dev/null export GDK_DPI_SCALE=1.5
fi
export LANG=zh_CN.UTF-8
## QTile尚不支持wayland输入法相关协议
export GTK_IM_MODULE=fcitx
if true; then command -v dbus-update-activation-environment &>/dev/null && \
LANG=zh_CN.UTF-8 xinit qtile start dbus-update-activation-environment --systemd --all 2>/dev/null
if $USE_WAYLAND; then
qtile start -b wayland
else else
LANG=zh_CN.UTF-8 qtile start -b wayland xinit qtile start
fi fi
fi fi
# 只在桌面环境使用中文tty保持英文
unset LANG
# vim:foldmethod=marker # vim:foldmethod=marker

4
.zshrc
View file

@ -1,4 +1,7 @@
# {{{ 环境 # {{{ 环境
typeset -U path PATH
path+=(/usr/sbin /usr/local/sbin $HOME/.bin)
Z_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"/zsh Z_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"/zsh
Z_DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}"/zsh Z_DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}"/zsh
Z_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}"/zsh Z_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}"/zsh
@ -60,7 +63,6 @@ setopt extended_history # 记录时间戳
if [[ -f "$Z_ZINIT_BIN" ]]; then if [[ -f "$Z_ZINIT_BIN" ]]; then
source "$Z_ZINIT_BIN" source "$Z_ZINIT_BIN"
else else
echo "zinit: not found" >/dev/stderr
zinit() {} zinit() {}
fi fi