diff --git a/.config/systemd/user/copyq.service b/.config/systemd/user/copyq.service index 915a33b..dd6bf1a 100644 --- a/.config/systemd/user/copyq.service +++ b/.config/systemd/user/copyq.service @@ -1,5 +1,7 @@ [Unit] Description=copyq +After=graphical-session.target +PartOf=graphical-session.target [Service] ExecStart=/usr/bin/copyq diff --git a/.config/systemd/user/picom.service b/.config/systemd/user/picom.service index 54dce06..29a15f1 100644 --- a/.config/systemd/user/picom.service +++ b/.config/systemd/user/picom.service @@ -1,5 +1,7 @@ [Unit] Description=picom +After=graphical-session.target +PartOf=graphical-session.target [Service] ExecStart=/usr/bin/picom diff --git a/.config/xdg-desktop-portal/portals.conf b/.config/xdg-desktop-portal/portals.conf index 8d4eeb5..7aa40b9 100644 --- a/.config/xdg-desktop-portal/portals.conf +++ b/.config/xdg-desktop-portal/portals.conf @@ -1,4 +1,6 @@ [preferred] -default=kde;wlr;gtk +default=kde;gtk +org.freedesktop.impl.portal.Settings=gtk org.freedesktop.impl.portal.Screenshot=wlr org.freedesktop.impl.portal.ScreenCast=wlr +org.freedesktop.impl.portal.RemoteDesktop=wlr diff --git a/.zprofile b/.zprofile index 703724d..e2c8834 100644 --- a/.zprofile +++ b/.zprofile @@ -1,5 +1,8 @@ if [[ "$HOME" == */ ]]; then HOME=${HOME:0:-1}; fi +typeset -U path PATH +path=($HOME/.bin $path) + ### XDG目录 export XDG_CONFIG_HOME=$HOME/.config export XDG_CACHE_HOME=$HOME/.cache @@ -88,27 +91,42 @@ export XMODIFIERS=@im=fcitx export SDL_IM_MODULE=fcitx # Kitty需要该变量 export GLFW_IM_MODULE=ibus + +# 关掉无障碍 +export NO_AT_BRIDGE=1 # }}} -USE_WAYLAND=true -# NOTE: 直接在登录shell中自启桌面环境 -if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then - if $USE_WAYLAND; then +USE_WAYLAND=1 + +start_wm() { + export LANG=zh_CN.UTF-8 + if (($USE_WAYLAND)); then export QT_FONT_DPI=144 export GDK_DPI_SCALE=1.5 fi - export LANG=zh_CN.UTF-8 - ## QTile尚不支持wayland输入法相关协议 - export GTK_IM_MODULE=fcitx - if $USE_WAYLAND; then + if [ $# -gt 0 ]; then + "$@" + elif (($USE_WAYLAND)); then qtile start -b wayland else xinit qtile start fi + + # 上面的程序退出后执行 + exit_wm_cleanup +} + +exit_wm_cleanup() { + systemctl stop --user graphical-session.target + + # 只在桌面环境使用中文,tty保持英文 + unset LANG QT_FONT_DPI GDK_DPI_SCALE +} + +# 直接在第一个登录shell中自启桌面环境 +if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then + start_wm fi -# 只在桌面环境使用中文,tty保持英文 -unset LANG - # vim:foldmethod=marker