From 290ba0dca24e019b8d7a2d6e0155577a24abfe47 Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Mon, 19 Sep 2022 11:02:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=8B=E5=89=8D=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E6=8A=8A=20boot:windows=20=E6=94=B9=E6=88=90=20boot:win?= =?UTF-8?q?=EF=BC=8C=E5=BF=98=E4=BA=86=E8=BF=99=E6=98=AF=20run-script-os?= =?UTF-8?q?=20=E8=A7=84=E5=AE=9A=E7=9A=84=E5=86=99=E6=B3=95=E3=80=82?= =?UTF-8?q?=E5=8F=88=E6=94=B9=E4=BA=86=E5=9B=9E=E5=8E=BB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian-config.sh | 1 - nixhome/.bashrc | 2 +- proxy.sh | 2 +- wsl-install-xfce.sh | 26 ++++++++++++++++++++++++++ wsl-install.bat | 7 +++++++ 5 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 wsl-install-xfce.sh diff --git a/debian-config.sh b/debian-config.sh index 6d8dbca..07984b9 100755 --- a/debian-config.sh +++ b/debian-config.sh @@ -104,4 +104,3 @@ fi echo echo "=== Debian System Setup Completed >>>" - diff --git a/nixhome/.bashrc b/nixhome/.bashrc index 214ba98..3a1cbd8 100644 --- a/nixhome/.bashrc +++ b/nixhome/.bashrc @@ -47,7 +47,7 @@ alias cvs='cvs -z9' alias ps='ps -elf' -alias emacs='emacs -nw' +alias emacst='emacs -nw' alias myip='ifconfig | grep netmask' diff --git a/proxy.sh b/proxy.sh index 6010469..f2a7077 100755 --- a/proxy.sh +++ b/proxy.sh @@ -5,7 +5,7 @@ function proxy(){ read -p ">>> " proxySwitch if [ $proxySwitch ] && [ $proxySwitch == "u" ] then - export ALL_PROXY=socks5://127.0.0.1:1090 + export ALL_PROXY=socks5://127.0.0.1:8099 export http_proxy=http://127.0.0.1:41091 export https_proxy=https://127.0.0.1:41091 echo -e "--- 已开启网络代理" diff --git a/wsl-install-xfce.sh b/wsl-install-xfce.sh new file mode 100644 index 0000000..7a8cfb8 --- /dev/null +++ b/wsl-install-xfce.sh @@ -0,0 +1,26 @@ +echo Install xfce on WSL2-Debian11/Ubuntu ... +echo 2022-09-14 测试无效! + +sudo apt update && sudo apt -y upgrade +sudo apt-get purge xrdp +# install xfce +sudo apt-get install -y xfce4 xfce4-goodies +# install xrdp +sudo apt-get install xrdp +sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak +sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini +sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini +sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini +echo xfce4-session > ~/.xsession +# install dbus +sudo apt-get install dbus-x11 +sudo service dbus start +# because while starting xrdp I got the error 'Failed to execute child process 'dbus-launch'': +# export the correct DBUS_SESSION_BUS_ADDRESS and DBUS_SESSION_BUS_PID +export $(dbus-launch) +# enable dbus +sudo systemctl enable dbus +sudo /etc/init.d/dbus start +sudo /etc/init.d/xrdp start +# check xrdp status +sudo /etc/init.d/xrdp status \ No newline at end of file diff --git a/wsl-install.bat b/wsl-install.bat index 5639a27..17a9b03 100644 --- a/wsl-install.bat +++ b/wsl-install.bat @@ -1,3 +1,5 @@ +echo Run PowerShell in Administrator mode + echo Enable [Windows Subsystem for Linux] feature dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart @@ -11,3 +13,8 @@ wsl --update wsl --shutdown wsl --list --online wsl --install -d Debian + +@REM 2022-09-13 +@REM 发现安装 WSL 被简化了 +@REM https://docs.microsoft.com/en-us/windows/wsl/install (2022-08-13) +@REM 只要 `wsl --install -d debian` 即可 \ No newline at end of file