Update dictpopup

improve formating
This commit is contained in:
Konstantin 2023-08-06 14:18:21 -04:00 committed by GitHub
parent 1214a6fb1a
commit 69509a92c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
word=${1:-$(sselp)} word=${1:-$(sselp)}
word_without_spaces=$(echo "$word" | tr -d ' ') word_without_spaces=$(echo "$word" | tr -d ' ')
@ -8,5 +9,5 @@ dict_lookup=$(sdcv -n --utf8-output -e "$word_without_spaces")
if echo "$dict_lookup" | perl -0777 -ne 'exit 0 if /Nothing similar to/; exit 1'; then if echo "$dict_lookup" | perl -0777 -ne 'exit 0 if /Nothing similar to/; exit 1'; then
echo "$dict_lookup" | popup echo "$dict_lookup" | popup
else else
echo "$dict_lookup" | perl -0777 -pe 's/^.*\n.*\n.*\n.*\n//; s/<[^>]*>//g' | popup echo "$dict_lookup" | perl -0777 -pe 's/^.*\n.*\n.*\n.*\n//; s/<[^>]*>//g; s/(--->|-->)//g;' | popup
fi fi