Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UwU'ified #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions dmenukaomoji
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
#!/bin/sh

# The famous "get a menu of kaomojis to copy" script.

# Must have xclip installed to even show menu.
#xclip -h 2>/dev/null || exit 1
# If this errors, the user wont be able to know why that is happening as there'll be no error message, why not just let it error normally when trynna run?

chosen=$(dmenu -i -l 20 < ~/.local/share/kaomoji | sed "s/ .*//")

#[ "$chosen" != "" ] || exit
# The != is a little redundant, just placing the variable itself will check if its non-empty.
[ "$chosen" ] || exit

# If you run this command with an argument, it will automatically insert the character.
#if [ -n "$1" ]; then
# Same as above, -n and -z arent all that usefull...
if [ "$1" ]; then
xdotool key Shift+Insert
else
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
notify-send "'$chosen' copied to clipboard." &
fi
[ "$1" ] && xdotool key Shift+Insert || $(echo "$chosen" | tr -d '\n' | xclip -selection clipboard; notify-send "'$chosen' copied to clipboard.")