force micro to use external clipboard if osc52 support is missing

This commit is contained in:
Jill 2024-02-19 09:32:57 +03:00
parent 5f3dabf56a
commit 3730e752e1
1 changed files with 8 additions and 3 deletions

View File

@ -1,8 +1,9 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.software.editors.micro;
canUseOSC52 = config.modules.software.system.alacritty.enable;
in {
options.modules.software.editors.micro = {
enable = mkEnableOption "Enable micro, the simple command-line code editor";
@ -13,11 +14,15 @@ in {
in mkIf cfg.enable {
environment.variables.EDITOR = "micro";
hm.home.packages = mkIf (!canUseOSC52) (with pkgs; [
(if (config.modules.desktop.envProto == "x11") then xclip else wl-clipboard-x11)
]);
hm.programs.micro = {
enable = true;
settings = {
autosu = true;
clipboard = "terminal";
clipboard = if canUseOSC52 then "terminal" else "external";
savecursor = true;
scrollbar = true;
tabsize = 2;
@ -61,4 +66,4 @@ in {
color-link symbol.tag "#${base0E},#${base00}"
'';
};
}
}