fix: windows 11 wsl2
This commit is contained in:
parent
a25821283c
commit
6402287cc6
|
@ -6,8 +6,8 @@ DIR=$(dirname "$(readlink -f "$0")")
|
|||
|
||||
log 'Setting up shell'
|
||||
|
||||
case "$UNAMEA" in
|
||||
*Ubuntu*)
|
||||
case "$PM" in
|
||||
*apt*)
|
||||
if ! has_cmd fish; then
|
||||
sudo add-apt-repository ppa:fish-shell/release-3 -y -n
|
||||
pm_update
|
||||
|
@ -24,6 +24,9 @@ case "$UNAMEA" in
|
|||
./install --all
|
||||
exitrepo
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$UNAMEA" in
|
||||
*artix*)
|
||||
sudo pacman -S --noconfirm --needed fish dash fzf bat the_silver_searcher
|
||||
# prevent bash upgradation relink /bin/sh
|
||||
|
|
|
@ -37,10 +37,8 @@ pacman_china_mirror() {
|
|||
' "$MIRRORLIST_BAK" | sudo tee "$MIRRORLIST" >/dev/null
|
||||
}
|
||||
|
||||
|
||||
# setup package mirror for CHINA
|
||||
case "$UNAMEA" in
|
||||
*Ubuntu*)
|
||||
case "$PM" in
|
||||
*apt*)
|
||||
# backup original sources.list
|
||||
if [ ! -f /etc/apt/sources.list.bak ]; then
|
||||
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||
|
@ -49,6 +47,11 @@ case "$UNAMEA" in
|
|||
awk '$0 ~ /^deb/ {$2="https://mirrors.aliyun.com/ubuntu/"; print}' /etc/apt/sources.list.bak \
|
||||
| sudo tee /etc/apt/sources.list
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# setup package mirror for CHINA
|
||||
case "$UNAMEA" in
|
||||
*artix*)
|
||||
# enable arch repo
|
||||
sudo pacman -S --needed --noconfirm artix-archlinux-support
|
||||
|
@ -63,8 +66,8 @@ case "$UNAMEA" in
|
|||
echo "[multilib]" >> sudo tee -a /etc/pacman
|
||||
echo "Include = /etc/pacman.d/mirrorlist-arch" >> sudo tee -a /etc/pacman
|
||||
fi
|
||||
;;
|
||||
pacman_china_mirror /etc/pacman.d/mirrorlist Asia
|
||||
pacman_china_mirror /etc/pacman.d/mirrorlist-arch
|
||||
sudo pacman -Sy
|
||||
;;
|
||||
esac
|
||||
|
|
10
gui/pass.sh
10
gui/pass.sh
|
@ -18,7 +18,7 @@ case "$PM" in
|
|||
sudo apt install -y pass
|
||||
if [ -n "$WSL" ]; then
|
||||
PINENTRY=$PDIR/bin/pinentry-wsl-ps1.sh
|
||||
BROWSERPASS_NATIVE="$(wsl-win-path.sh %USERPROFILE%)/browser-wsl.bat"
|
||||
BROWSERPASS_NATIVE="$(wsl-win-path.sh %USERPROFILE%)/browserpass-wsl.bat"
|
||||
echo "@echo off\r\nbash -c 'browserpass'" \
|
||||
> "$BROWSERPASS_NATIVE"
|
||||
else
|
||||
|
@ -52,10 +52,6 @@ make configure
|
|||
make
|
||||
sudo make install
|
||||
exitrepo
|
||||
if [ -n "$WSL" ]; then
|
||||
echo "Please download browserpass-native for windows 64 and extract it to /usr/local/bin"
|
||||
x-open https://github.com/browserpass/browserpass-native/releases/latest
|
||||
fi
|
||||
|
||||
# enable browser-native for google-chrome
|
||||
#make -C /usr/lib/browserpass hosts-chrome-user
|
||||
|
@ -79,6 +75,6 @@ fi
|
|||
# configuration
|
||||
|
||||
if [ -n "$WSL" ]; then
|
||||
echo "Please update path in *-host.json file located at C:\Program Files\Browserpass to"
|
||||
echo $BROWSERPASS_NATIVE
|
||||
echo 'Please update path in files "C:\Program Files\Browserpass\*-host.json" to'
|
||||
cmd.exe /c 'echo %USERPROFILE%\browserpass-wsl.bat' 2>/dev/null | sed 's/\\/\\\\/g'
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user