config/overlays/wl-clipboard-timeout.nix

29 lines
660 B
Nix
Raw Normal View History

2024-07-10 00:31:00 +02:00
final: prev:
let
inherit (final) lib;
in
rec {
# https://github.com/bugaevc/wl-clipboard/issues/185
wl-clipboard-timeout = prev.symlinkJoin {
inherit (prev.wl-clipboard) name;
paths = [
(prev.writeShellScriptBin "wl-copy" ''
timeout 0.3s ${lib.getExe' prev.wl-clipboard "wl-copy"} "$@"
'')
(prev.writeShellScriptBin "wl-paste" ''
timeout 0.3s ${lib.getExe' prev.wl-clipboard "wl-paste"} "$@"
'')
prev.wl-clipboard
];
};
2024-07-10 01:12:00 +02:00
micro = if prev.micro.override.__functionArgs ? wl-clipboard
then prev.micro.override {
wl-clipboard = wl-clipboard-timeout;
}
else prev.micro;
2024-07-10 00:31:00 +02:00
}