1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00

feat(scripts): dmenu-emoji

This commit is contained in:
Kierán Meinhardt
2020-04-13 11:00:20 +02:00
parent 5cb8da0bf1
commit 30cd8e00b9
2 changed files with 22 additions and 1 deletions

View File

@@ -4,6 +4,27 @@ let
makeScript = { binPath ? [], name, src }: pkgs.writeScriptBin name (builtins.readFile src);
in
{
# https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode
emoji-menu =
let emoji-file = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/LukeSmithxyz/voidrice/master/.local/share/larbs/emoji";
sha256 = "09m2rgb9d5jpiy8q4jz3dw36gkpb4ng2pl7xi7ppsrzzzdvq85qk";
};
in with pkgs; writers.writeDashBin "emoji-menu" ''
PATH=${makeBinPath [ coreutils dmenu gnused libnotify xclip xdotool ]}
chosen=$(cut -d ';' -f1 ${emoji-file} | dmenu -i -l 10 | sed "s/ .*//")
[ "$chosen" != "" ] || exit
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
if [ -n "$1" ]; then
xdotool key Shift+Insert
else
notify-send "'$chosen' copied to clipboard." &
fi
'';
instaget = makeScript {
binPath = [ pkgs.jq pkgs.curl pkgs.gnugrep ];
src = ./instaget.sh;