AutoYADM commit: 2025-05-10 14:59:04
This commit is contained in:
parent
affb9e052a
commit
d7409496ef
3 changed files with 19 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
words = [
|
words = [
|
||||||
"diceware",
|
"diceware",
|
||||||
"hmac",
|
"hmac",
|
||||||
|
"linewise",
|
||||||
"pathlib",
|
"pathlib",
|
||||||
"ttp",
|
"ttp",
|
||||||
"typst",
|
"typst",
|
||||||
|
|
|
@ -9,15 +9,17 @@
|
||||||
|
|
||||||
set -l cmd $argv[1]
|
set -l cmd $argv[1]
|
||||||
# get clip contents, and preserve newlines
|
# get clip contents, and preserve newlines
|
||||||
set -l contents (wl-paste -n | string collect -N)
|
set -l contents (wl-paste -n | string collect -N --allow-empty)
|
||||||
count "$contents"
|
count "$contents"
|
||||||
if test "$cmd" = inline
|
if test "$cmd" = inline
|
||||||
# if there's more than 1 newline, it
|
# if there's more than 1 newline, it
|
||||||
# has to be linewise
|
# has to be linewise
|
||||||
set -l lines (string split -n \n "$contents")
|
set -l lines (string split -n \n "$contents")
|
||||||
set -S lines
|
set -S lines
|
||||||
|
set -S contents
|
||||||
|
|
||||||
printf "%s" "$(string join \n "$lines")"
|
# string join \n $lines
|
||||||
|
printf "%s" (string join \n $lines | string collect -N)
|
||||||
# if test "$newlines" -eq 1
|
# if test "$newlines" -eq 1
|
||||||
# printf "%s" (string trim --chars \n "$contents")
|
# printf "%s" (string trim --chars \n "$contents")
|
||||||
# else
|
# else
|
||||||
|
|
14
.config/helix/scripts/paste.py
Executable file
14
.config/helix/scripts/paste.py
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# tiny script to force inline vs. linewise paste in Helix
|
||||||
|
|
||||||
|
cmd = sys.argv[1]
|
||||||
|
contents = subprocess.check_output(["wl-paste", "-n"], text=True)
|
||||||
|
if cmd == "inline":
|
||||||
|
print(contents.rstrip("\n"), end="")
|
||||||
|
elif cmd == "linewise":
|
||||||
|
if contents[-1] != "\n":
|
||||||
|
contents += "\n"
|
||||||
|
print(contents, end="")
|
Loading…
Add table
Add a link
Reference in a new issue