mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat: emailmenu
This commit is contained in:
18
packages/emailmenu.nix
Normal file
18
packages/emailmenu.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
writers,
|
||||
lib,
|
||||
coreutils,
|
||||
dmenu,
|
||||
gawk,
|
||||
libnotify,
|
||||
xclip,
|
||||
khard,
|
||||
}:
|
||||
writers.writeDashBin "emailmenu" ''
|
||||
history_file=$HOME/.cache/emailmenu
|
||||
PATH=${lib.makeBinPath [coreutils dmenu gawk libnotify xclip]}
|
||||
chosen=$(${khard}/bin/khard email --parsable | awk '!seen[$0]++' | dmenu -p unicode -1 -l 10 | tee --append "$history_file" | cut -f1)
|
||||
[ "$chosen" != "" ] || exit
|
||||
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
|
||||
notify-send --app-name="$(basename "$0")" "'$chosen' copied to clipboard." &
|
||||
''
|
||||
Reference in New Issue
Block a user