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 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