This commit is contained in:
2026-01-12 21:13:25 -07:00
parent 474ced6590
commit 94102b9d8c
3 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
#!/bin/sh
path=$(lf -selection-path=/dev/stdout | tail -n 1)
copyq copy "$(xdg-mime query filetype "$path")" - < "$path"
niri msg action focus-window-previous && sleep .1s && copyq paste

21
home/.local/bin/xrescat Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
awk -v query="$1" '
/^!/ || length($0) == 0 { next }
{
delI=index($0, ":")
path=substr($0, 0, delI - 1)
gsub(/[\\.^$(){}\[\]|+]/, "\\\\&", path)
gsub(/*/, ".*?", path)
gsub(/\\\.?\\./, "\\.[^.]*\\.", path)
gsub(/^\?$/, "^[^.]*$", path)
gsub(/^\?\\./, "^[^.]*\\.", path)
gsub(/\\.\?$/, "\\.[^.]*$", path)
}
query ~ path {
res=substr($0, delI + 1)
gsub(/^[\t ]+/, "", res)
printf "%s", res
exit
}
' "$HOME/.Xdefaults"