Skip to content

Instantly share code, notes, and snippets.

@xxxzc
Created November 15, 2021 03:56
Show Gist options
  • Save xxxzc/33af88c8420c929d7a10aab79257cd1d to your computer and use it in GitHub Desktop.
Save xxxzc/33af88c8420c929d7a10aab79257cd1d to your computer and use it in GitHub Desktop.
在 WSL2 Arch 上安装 GNOME Shell

在 WSL2 Arch 上安装 gnome-shell

配置 archlinuxcn 源

https://mirror.tuna.tsinghua.edu.cn/help/archlinuxcn/

安装 gnome 和 genie-systemd

sudo pacman -S gnome --needed 
sudo pacman -S genie-systemd --needed

编写启动脚本

nano ~/startgnome.sh
chmod a+x ~/startgnome.sh
#!/bin/bash
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0.0;
export XDG_SESSION_TYPE="x11"
export XDG_RUNTIME_DIR=~/xdg
export XDG_SESSION_CLASS="user"
gnome-session

安装配置 vcxsrv

https://sourceforge.net/projects/vcxsrv/

配置

  1. 选择 One large window 或者 Fullscreen
  2. 选择 Start no client
  3. 取消勾选 Native opengl,勾选 Disable access control

启动

先打开 VcXsrv,再运行 genie -c ~/startgnome.sh

替换 Super 键为 Alt

  1. 安装打开 gnome-tweaks
  2. Keyboard & Mouse > Additional Layout Options
  3. Alt and Win behavior > Alt is swapped with Win,用其他选项也可以

参考:

My WSL2 Ubuntu 20.04 Environment

Setting up Arch Linux with KDE Plasma in Windows Subsystem for Linux 2

注:不建议使用 X410 或者 GWSL(我两个都买了,没用),VcXsrv 足够用了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment