AutoYADM commit: 2025-05-10 15:14:08

This commit is contained in:
Daniel Fichtinger 2025-05-10 15:14:08 -04:00
parent d7409496ef
commit a4d0f3aa9b
2 changed files with 25 additions and 13 deletions

View file

@ -1,14 +1,7 @@
#!/usr/bin/env python
import subprocess
import sys
# tiny script to force inline vs. linewise paste in Helix
# tiny script to strip only trailing newlines from clipboard
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="")
print(contents.rstrip("\n"), end="")