Another idea for pbcopy & pbpaste use, simple snippet processor that
works in every application that works with clipboard. Could be useful if
you have to fill forms with similar values again and again...
```
# MAIN
#pbcopy </dev/null # clear clipboard
OUT=""
while :; do
TXT="$(pbpaste)" # read from clipbard
if [ "$TXT" = "$OUT" ]; then
# wait for a change
sleep 0.1 # sleep 100ms
continue
fi
OUT="$TXT"
# define your macros/snippets
case "$TXT" in
"M1") OUT="MACRO1";;
"M2") OUT="MACRO M2";;
"IP1") OUT="fdf4:26f8:bebb:0:3973:b5eb:fe86:b000";;
"IP2") OUT="fdf4:26f8:bebb:0:f1bf:a0f:efb:c2e2";;
"IP3") OUT="2a00:1450:4014:80d::200e";;
"!D") OUT="$(date '+%Y-%m-%d')";;
"!T") OUT="$(date '+%H:%M:%S')";;
"!!") OUT="$(date '+%Y-%m-%d %H:%M:%S')";;
"!@") OUT="[email protected]";;
# LOOP, Loop and loop, they cycle!
"LOOP") OUT="Loop";;
"Loop") OUT="loop";;
"loop") OUT="LOOP";;
esac
if [ "$TXT" != "$OUT" ]; then
echo "REPLACE: $TXT -> $OUT"
echo -n "$OUT" | pbcopy # write to clipboard
fi
done
```
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1854092
Title:
pbcopy & pbpaste for Linux
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/xsel/+bug/1854092/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs