From b20a586bea29e90d111b848b4581209a18f1f923 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 24 Jun 2021 11:17:06 +0800 Subject: [PATCH 1/2] [misc] add command e for editing file --- cli/lf.sh | 4 +++- cli/lf/lfrc | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cli/lf.sh b/cli/lf.sh index 394591d..80b809f 100755 --- a/cli/lf.sh +++ b/cli/lf.sh @@ -10,7 +10,9 @@ fi log 'Setting up lf' # install lf -env GOPROXY= CGO_ENABLED=0 GO111MODULE=on go get -u -ldflags="-s -w" github.com/gokcehan/lf +if ! has_cmd "lf"; then + env GOPROXY= CGO_ENABLED=0 GO111MODULE=on go get -u -ldflags="-s -w" github.com/gokcehan/lf +fi # linking configuration files lnsf "$DIR/lf/lfrc" "$XDG_CONFIG_HOME/lf/lfrc" diff --git a/cli/lf/lfrc b/cli/lf/lfrc index cd43a86..8a12a28 100644 --- a/cli/lf/lfrc +++ b/cli/lf/lfrc @@ -1,13 +1,9 @@ set drawbox set icons + cmd mkdir %mkdir "$@" - cmd copyfilepath %echo "$f" | xsel -b -map Yp copyfilepath - cmd copyfilename %basename "$f" | xsel -b -map Yn copyfilename - cmd pasteoverwrite %{{ load=$(lf -remote 'load') mode=$(echo "$load" | sed -n '1p') @@ -20,4 +16,8 @@ cmd pasteoverwrite %{{ lf -remote 'send load' lf -remote 'send clear' }} +cmd e $$EDITOR "$@" + +map Yp copyfilepath +map Yn copyfilename map P pasteoverwrite From a395558d7b99f17911b673eb9683c548f7a3df0d Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 24 Jun 2021 11:17:30 +0800 Subject: [PATCH 2/2] [doc] setup GUI for wsl2 --- win/wsl.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 win/wsl.md diff --git a/win/wsl.md b/win/wsl.md new file mode 100644 index 0000000..56cdc0f --- /dev/null +++ b/win/wsl.md @@ -0,0 +1,40 @@ +# GUI + +## X11 for Windows + +1. download and install [vcxsrc](https://sourceforge.net/projects/vcxsrv/) +2. double click on XLaunch to launch vcxsrc for Windows +3. put following setting to `~/.profile.fish` +```fish +set -gx DISPLAY (winip):0.0 +# window size scaling factor +set -gx GDK_SCALE 0.5 +# dpi scaling factor +set -gx GDK_DPI_SCALE 2 +``` + +## PulseAudio for Windows + +### Windows Part +1. download and extract [pluseaudio](https://www.freedesktop.org/wiki/Software/PulseAudio/Ports/Windows/Support/) to your preferred location +2. append following line to `etc/default.pa`: +``` +load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;172.16.0.0/12 +``` +3. append following line to `etc/daemon.conf`: +``` +exit-idle-time = -1 +``` +4. run `bin/pulseaudio.exe` on `cmd/powershell` to start up pulaudio-server for testing +5. using `nssm` [nssm](https://nssm.cc/download) to make `pulseaudio` run as system service + +### WSL Part +1. install package +```sh +sudo apt install libpulse0 +``` +2. setup environment variables on `~/.profile.fish`: +```fish +set -gx PULSE_SERVER tcp:(winip) +``` +3. play sound using `ffplay` to test