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

move to wayland

This commit is contained in:
2026-01-06 22:46:12 +01:00
parent 3d9a48c65e
commit cecc249daa
17 changed files with 534 additions and 357 deletions

View File

@@ -5,7 +5,7 @@
curl,
gnused,
coreutils,
xclip,
wl-clipboard,
libnotify,
writers,
options ? { },
@@ -17,14 +17,6 @@ let
{
imports = [ options ];
options = {
selection = lib.mkOption {
default = "clipboard";
type = lib.types.enum [
"primary"
"secondary"
"clipboard"
];
};
dmenu = lib.mkOption {
default = "${dmenu}/bin/dmenu -i -p klem";
type = lib.types.path;
@@ -49,7 +41,7 @@ in
writers.writeDashBin "klem" ''
set -efu
${xclip}/bin/xclip -selection ${cfg.selection} -out \
${wl-clipboard}/bin/wl-paste \
| case $(echo "${lib.concatStringsSep "\n" (lib.attrNames cfg.scripts)}" | ${cfg.dmenu}) in
${lib.concatStringsSep "\n" (
lib.mapAttrsToList (option: script: ''
@@ -58,7 +50,7 @@ writers.writeDashBin "klem" ''
)}
*) ${coreutils}/bin/cat ;;
esac \
| ${xclip}/bin/xclip -selection ${cfg.selection} -in
| ${wl-clipboard}/bin/wl-copy
${libnotify}/bin/notify-send --app-name="klem" "Result copied to clipboard."
''