X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=Scripts%2Femoter;fp=Scripts%2Femoter;h=c7f199e4bf32e21642c784ac6216a89bd5cfdb95;hb=2894bed4452f6e6f781f8d3b84f6ad6bd40a1e62;hp=0000000000000000000000000000000000000000;hpb=fbb59f2fad421264e4703357595ded05998788ca;p=dotfiles.git diff --git a/Scripts/emoter b/Scripts/emoter new file mode 100755 index 0000000..c7f199e --- /dev/null +++ b/Scripts/emoter @@ -0,0 +1,17 @@ +#!/bin/sh + +emote_dir="$HOME/Downloads/emotes" + +mode="image/png" +[ "$1" = "-g" ] && mode="image/gif" + +emote_name="$(ls $emote_dir | grep -E '\.png$|\.jpeg$|\.jpg' | dmenu)" +[ ! -f "$emote_dir/$emote_name" ] && exit 0 + +echo "$emote_dir/$emote_name" | \ + xargs xclip -selection clipboard -t "$mode" -i + +# now paste the image +xdotool getactivewindow key ctrl+v +xdotool getactivewindow key --delay 250 KP_Enter +