1
0
Fork 0
This commit is contained in:
Luca Bilke 2024-02-02 19:31:02 +01:00
parent ad6861f54e
commit a5e2ad9da0
7 changed files with 9 additions and 15 deletions

View file

@ -33,5 +33,4 @@ stderr="$XDG_RUNTIME_DIR/dwm-stderr"
[ -p "$stderr" ] || mkfifo "$stderr"
cat <"$stdout" | infolog "$1" &
cat <"$stderr" | errorlog "$1" &
# shellcheck disable=2068
pidof -sx "$1" || $@ >"$stdout" 2>"$stderr"
pidof -sx "$1" || "$@" >"$stdout" 2>"$stderr"

View file

@ -134,21 +134,22 @@ cmd fzfshortcut ${{
}}
cmd fzfgrep ${{
set +ue
RG_PREFIX="rg --hidden --column --line-number --no-heading --color=always --smart-case "
RG_PREFIX="rg --hidden --column --line-number --no-heading --color=always --smart-case --follow "
res="$(
FZF_DEFAULT_COMMAND="$RG_PREFIX ''" \
fzf --bind "change:reload:$RG_PREFIX {q} || true" \
--ansi --layout=reverse --header 'Searching file contents' |\
grep -iv -e 'Trash/files' -e 'Trash/info'
)"
file="$(realpath $(echo "$res" | cut -d':' -f1 | sed 's/\\/\\\\/g;s/"/\\"/g'))"
file="$(realpath "$(echo "$res" | cut -d':' -f1 | sed 's/\\/\\\\/g;s/"/\\"/g')")"
row="$(echo "$res" | cut -d':' -f2)"
column="$(echo "$res" | cut -d':' -f3)"
if [ -n "$res" ]; then
# shellcheck disable=2154
lf -remote "send $id select '$file'"
if [ -n "$VIM" ]; then
lf -remote "send $id open '$file'"
elif ([ "$EDITOR" = "nvim" ] || [ "$EDITOR" = "vim" ]) && [ -n "$EMBEDDED" ]; then
elif { [ "$EDITOR" = "nvim" ] || [ "$EDITOR" = "vim" ]; } && [ -n "$EMBEDDED" ]; then
lf -remote "send $id \$$EDITOR +'call cursor($row, $column)' -- $([ -n "$EMBEDDED" ] && echo "--") '$file'"
else
lf -remote "send $id \$$EDITOR '$file'"

View file

@ -43,7 +43,6 @@ alias \
/^WM_NAME/{sub(/.* =/, \"title:\"); print}'"
# Void specific aliases
# shellcheck disable=SC2139
alias \
x="xbps-install" \
xr="xbps-remove" \

View file

@ -7,8 +7,7 @@ BLUE="$(tput setaf 4)"
NC="$(tput sgr0)"
dgit() {
# shellcheck disable=2068
git -C "$STOW_DIR/$DOTS_PACKAGE" $@
git -C "$STOW_DIR/$DOTS_PACKAGE" "$@"
}
printf "%b" "${BOLD}${BLUE}Removing dotfile symlinks...$NC\n\n"

View file

@ -7,8 +7,7 @@ clean() {
}
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
# shellcheck disable=2068
command lf $@
command lf "$@"
else
[ ! -d "$HOME/.cache/lf" ] && mkdir --parents "$HOME/.cache/lf"
export FIFO_UEBERZUG="$XDG_CACHE_HOME/lf/ueberzug-$$"
@ -16,6 +15,5 @@ else
ueberzug layer -s -p json <"$FIFO_UEBERZUG" &
exec 3>"$FIFO_UEBERZUG"
trap clean EXIT
# shellcheck disable=2016,2068
command lf $@ 3>&-
command lf "$@" 3>&-
fi

View file

@ -1,5 +1,4 @@
#!/bin/sh
# shellcheck disable=2037
TPdevice=$(xinput | sed -nre '/TouchPad|Touchpad/s/.*id=([0-9]*).*/\1/p')

View file

@ -8,8 +8,7 @@ IFS='
types=${1:-ext2,ext3,ext4,xfs,btrfs,vfat}
first=true
for mnt in $(findmnt -Py -t "$types"); do
# shellcheck disable=SC2086
eval $mnt
eval "$mnt"
[ -d "$TARGET" ] || break
[ "$TARGET" = "/var/lib/docker" ] && break
[ "$first" = "false" ] && printf " | "