add return only on a new line
This commit is contained in:
parent
9eb2ad26a4
commit
cdd5785be6
1 changed files with 19 additions and 6 deletions
|
@ -1,11 +1,24 @@
|
|||
#!/bin/bash
|
||||
sleep 1
|
||||
|
||||
# Inhalt aus der Zwischenablage holen
|
||||
clipboard_content="$(wl-paste -n)"
|
||||
line_count=$(printf "%s" "$clipboard_content" | wc -l)
|
||||
|
||||
{
|
||||
echo "typedelay 100"
|
||||
# Jede Zeile aus der Zwischenablage tippen und mit Return abschließen
|
||||
wl-paste | while IFS= read -r line; do
|
||||
echo "type $line"
|
||||
echo "key enter"
|
||||
done
|
||||
} | DOTOOL_XKB_LAYOUT=de dotool && notify-send -t 5000 -u low "Eingabe abgeschlossen" "Inhalt wurde getippt"
|
||||
|
||||
if [ "$line_count" -gt 1 ]; then
|
||||
# Mehrere Zeilen → jede Zeile tippen und Enter drücken
|
||||
printf "%s\n" "$clipboard_content" | while IFS= read -r line; do
|
||||
echo "type $line"
|
||||
echo "key enter"
|
||||
done
|
||||
else
|
||||
# Nur eine Zeile → einfach tippen ohne Enter
|
||||
echo "type $clipboard_content"
|
||||
fi
|
||||
|
||||
} | DOTOOL_XKB_LAYOUT=de dotool
|
||||
|
||||
notify-send -t 5000 -u low "Eingabe abgeschlossen" "Inhalt wurde getippt"
|
||||
|
|
Loading…
Add table
Reference in a new issue