[bin] format and correct comments
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
7b0833252a
commit
c4c80945e8
@ -195,7 +195,7 @@ set with a valid OpenAI key.
|
|||||||
# If the user passes '-h', '--help', or 'help' print out a little bit of help.
|
# If the user passes '-h', '--help', or 'help' print out a little bit of help.
|
||||||
# text.
|
# text.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"-h" | "--help" | "help")
|
"-h" | "--help" | "help")
|
||||||
printf 'Generate kaomojis on request.\n\n'
|
printf 'Generate kaomojis on request.\n\n'
|
||||||
printf 'Usage: %s [kind]\n' "$(basename "$0")"
|
printf 'Usage: %s [kind]\n' "$(basename "$0")"
|
||||||
exit 1
|
exit 1
|
||||||
@ -206,13 +206,13 @@ esac
|
|||||||
# kind of Kaomoji produced.
|
# kind of Kaomoji produced.
|
||||||
sentiment=""
|
sentiment=""
|
||||||
if [[ $1 != "" ]]; then
|
if [[ $1 != "" ]]; then
|
||||||
sentiment=" $1"
|
sentiment=" $1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ask mods to generate Kaomojis. Save the output in a variable.
|
# Ask mods to generate Kaomojis. Save the output in a variable.
|
||||||
kaomoji="$(mods "generate 10${sentiment} kaomojis. number them and put each one on its own line.")"
|
kaomoji="$(mods "generate 10${sentiment} kaomojis. number them and put each one on its own line.")"
|
||||||
if [[ $kaomoji == "" ]]; then
|
if [[ $kaomoji == "" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Pipe mods output to gum so the user can choose the perfect kaomoji. Save that
|
# Pipe mods output to gum so the user can choose the perfect kaomoji. Save that
|
||||||
@ -220,13 +220,13 @@ fi
|
|||||||
# in front of the Kaomoji.
|
# in front of the Kaomoji.
|
||||||
choice="$(echo "$kaomoji" | gum choose | cut -d ' ' -f 2)"
|
choice="$(echo "$kaomoji" | gum choose | cut -d ' ' -f 2)"
|
||||||
if [[ $choice == "" ]]; then
|
if [[ $choice == "" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the current session is Wayland, copy with wl-copy, otherwise copy with xclipboard
|
# If the current session is Wayland, copy with wl-copy, otherwise copy with xclipboard
|
||||||
if [ "$XDG_SESSION_TYPE" = "wayland" ]
|
if [ "$XDG_SESSION_TYPE" = "wayland" ]
|
||||||
then printf '%s' "$choice" | wc-copy # X11
|
then printf '%s' "$choice" | wc-copy # Wayland
|
||||||
else printf '%s' "$choice" | xclip -sel clip # Wayland
|
else printf '%s' "$choice" | xclip -sel clip # X11
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We're done!
|
# We're done!
|
||||||
|
Loading…
Reference in New Issue
Block a user