Created
June 6, 2021 18:38
-
-
Save pschyska/af3b627871a7ec65b900ccd8ab67959a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let lfopen = substituteAll { | |
src = ./files/lfopen; | |
isExecutable = true; | |
dir = "bin"; | |
path = makeBinPath [ coreutils lf config.programs.alacritty.package ]; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!@shell@ | |
# shellcheck shell=bash | |
# vim: ft=sh | |
PATH="@path@:$PATH" | |
set -e | |
set -u | |
set -o pipefail | |
wd=${1:-$PWD} | |
temp=$(mktemp -d -t lfopen.XXXXXXXXXX) | |
cleanup() { | |
[[ -d $temp ]] && rm -rf "$temp" | |
} | |
trap cleanup EXIT | |
chan="$temp/ch" | |
mkfifo "$chan" | |
cat "$chan" & | |
alacritty --class lf --title "lf: $wd" --working-directory "$wd" \ | |
-e lf -selection-path "$chan" | |
[ -f "$chan" ] && rm "$chan" | |
# kill $! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment