mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat: fix secrets permissions, move ./packages to flake outputs
This commit is contained in:
21
packages/menu-calc.nix
Normal file
21
packages/menu-calc.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
writers,
|
||||
gnused,
|
||||
pari,
|
||||
dmenu,
|
||||
xclip,
|
||||
}:
|
||||
writers.writeDashBin "=" ''
|
||||
# https://github.com/onespaceman/menu-calc
|
||||
|
||||
answer=$(echo "$@" | ${pari}/bin/gp -q | ${gnused}/bin/sed '/\./ s/\.\{0,1\}0\{1,\}$//')
|
||||
|
||||
action=$(printf "copy\nclear" | ${dmenu}/bin/dmenu -p "= $answer")
|
||||
|
||||
case $action in
|
||||
"clear") $0 ;;
|
||||
"copy") printf %s "$answer" | ${xclip}/bin/xclip -selection clipboard;;
|
||||
"") ;;
|
||||
*) $0 "$answer $action" ;;
|
||||
esac
|
||||
''
|
||||
Reference in New Issue
Block a user