.
This commit is contained in:
5
home/.local/bin/select-and-copy
Executable file
5
home/.local/bin/select-and-copy
Executable 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
21
home/.local/bin/xrescat
Executable 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"
|
||||
Reference in New Issue
Block a user