1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(scripts): unicodmenu

This commit is contained in:
2021-03-04 18:54:48 +01:00
parent e2a0ba3eed
commit 5869807936
4 changed files with 60 additions and 44 deletions

View File

@@ -40,49 +40,6 @@ let
i3-msg move container to workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
'';
# 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 = "03fv69ah8msh2j6i3lm4sdkckqq8jwn1kj43j98dh0xjpzazsy46";
};
kaomoji-file = pkgs.writeText "kaomoji.txt" ''
¯\(°_o)/¯ dunno lol shrug dlol
¯\_()_/¯ dunno lol shrug dlol
( ͡° ͜ʖ ͡°) lenny
¯\_( ͡° ͜ʖ ͡°)_/¯ lenny shrug dlol
( д) aaah sad noo
(^o^)丿 hi yay hello
(^o^: ups hehe
(^^) yay
(´) angry argh
(^_^) byebye!! bye
<(^.^<) <(^.^)> (>^.^)> (7^.^)7 (>^.^<) dance
(-.-)Zzz... sleep
() oh noes woot
(°°  table flip
() why woot
(___) gloom I see you
    sad
(\/) (°,,,,°) (\/) krebs
'';
in with pkgs;
writers.writeDashBin "emoji-menu" ''
PATH=${lib.makeBinPath [ coreutils dmenu gnused libnotify xclip xdotool ]}
chosen=$(cat ${emoji-file} ${kaomoji-file} | cut -d ';' -f1 | 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 --app-name="emoji-menu" "'$chosen' copied to clipboard." &
fi
'';
in {
services.xserver = {
displayManager.defaultSession = "none+i3";
@@ -257,7 +214,7 @@ in {
''
}";
"${modifier}+p" = "exec --no-startup-id ${pkgs.pass}/bin/passmenu -l 5";
"${modifier}+u" = "exec ${emoji-menu}/bin/emoji-menu";
"${modifier}+u" = "exec ${pkgs.scripts.unicodmenu}/bin/unicodmenu";
"${modifier}+F7" = "exec ${pkgs.scripts.showkeys-toggle}/bin/showkeys-toggle";
"${modifier}+F8" = "exec ${pkgs.xorg.xkill}/bin/xkill";

View File

@@ -138,6 +138,7 @@ in {
scripts.fkill
scripts.wttr
scripts.boetlingk
scripts.unicodmenu
scripts.trans
scripts.liddel-scott-jones
# kmein.slide

View File

@@ -300,6 +300,9 @@ in rec {
packages = [ pkgs.xclip pkgs.scrot kpaste pkgs.libnotify pkgs.dmenu ];
};
unicodmenu = pkgs.callPackage ./unicodmenu.nix { };
bvg = pkgs.callPackage ./bvg.nix { };
nav = pkgs.callPackage ./nav.nix { };
k-lock = pkgs.callPackage ./k-lock.nix { };

View File

@@ -0,0 +1,55 @@
{ lib, fetchurl, writeText, writers, coreutils, dmenu, gnused, libnotify, xclip, xdotool }:
let
emoji-file = fetchurl {
url = "https://raw.githubusercontent.com/kmein/unipicker/master/symbols";
sha256 = "1ygv239binnl841k4jivv9jirzd9b8azxz6zxzg5lzvvgw6yng64";
};
kaomoji-file = writeText "kaomoji.txt" ''
¯\(°_o)/¯ dunno lol shrug dlol
¯\_()_/¯ dunno lol shrug dlol
( ͡° ͜ʖ ͡°) lenny
¯\_( ͡° ͜ʖ ͡°)_/¯ lenny shrug dlol
( д) aaah sad noo
(^o^)丿 hi yay hello
(^o^: ups hehe
(^^) yay
(´) angry argh
(^_^) byebye!! bye
<(^.^<) <(^.^)> (>^.^)> (7^.^)7 (>^.^<) dance
(-.-)Zzz... sleep
() oh noes woot
(°°  table flip
() why woot
(___) gloom I see you
    sad
(\/) (°,,,,°) (\/) krebs
 (ل͜) putting table back
 \(°°)/   flip all dem tablez
(`ω´) bear look
(ل͜) strong flex muscle bicep
(ò_óˇ) strong flex muscle bicep
(><) excite
( ` -´).* wizard spell magic
   puss in boots big eye
̯̫̯̫(ˆ̮ ̮ˆ) nyan cat
ʕʔ bear
(ԾɷԾ) adventure time
() happy yay
() happy yay
(º  º )/ panic
'';
in # ref https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode
writers.writeDashBin "unicodmenu" ''
PATH=${lib.makeBinPath [ coreutils dmenu gnused libnotify xclip xdotool ]}
chosen=$(cat ${emoji-file} ${kaomoji-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 --app-name="$(basename "$0")" "'$chosen' copied to clipboard." &
fi
''