niksos/modules/gui/anyrun.nix

127 lines
4.2 KiB
Nix
Raw Normal View History

{
2023-10-13 21:04:24 +02:00
config,
inputs,
2023-10-13 21:04:24 +02:00
lib,
pkgs,
...
2024-05-05 12:38:40 +02:00
}: let
2024-07-15 23:18:25 +02:00
cfg = config.poz.programs.anyrun;
inherit (config.poz.other.system) username;
2024-05-05 12:38:40 +02:00
2024-07-25 11:45:44 +02:00
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
2023-10-13 21:04:24 +02:00
in {
2024-07-15 23:18:25 +02:00
options.poz.programs.anyrun.enable = mkEnableOption "anyrun";
2023-10-13 21:04:24 +02:00
config = mkIf cfg.enable {
home-manager.users.${username} = {
2023-10-13 21:04:24 +02:00
imports = [ inputs.anyrun.homeManagerModules.default ];
programs.anyrun = {
enable = true;
config = {
plugins = with inputs.anyrun.packages.${pkgs.system}; [
applications
dictionary
kidex
rink
symbols
translate
];
hideIcons = false;
ignoreExclusiveZones = false;
layer = "overlay";
hidePluginInfo = false;
closeOnClick = true;
showResultsImmediately = true;
maxEntries = 50;
width.fraction = 0.3;
y.absolute = 15;
};
2023-10-13 21:04:24 +02:00
extraCss = ''
* {
all: unset;
font-family: Lexend;
font-size: 1.3rem;
}
2023-10-13 21:04:24 +02:00
#window,
#match,
#entry,
#plugin,
#main { background: transparent; }
2023-10-13 21:04:24 +02:00
#match.activatable {
border-radius: 16px;
padding: .3rem .9rem;
margin-top: .01rem;
}
#match.activatable:first-child { margin-top: .7rem; }
#match.activatable:last-child { margin-bottom: .6rem; }
2023-10-13 21:04:24 +02:00
#plugin:hover #match.activatable {
border-radius: 10px;
padding: .3rem;
margin-top: .01rem;
margin-bottom: 0;
}
2023-10-13 21:04:24 +02:00
#match:selected, #match:hover, #plugin:hover {
background: rgba(255, 255, 255, .1);
}
2023-10-13 21:04:24 +02:00
#entry {
background: rgba(255,255,255,.05);
border: 1px solid rgba(255,255,255,.1);
border-radius: 16px;
margin: .3rem;
padding: .3rem 1rem;
}
2023-10-13 21:04:24 +02:00
list > #plugin {
border-radius: 16px;
margin: 0 .3rem;
}
list > #plugin:first-child { margin-top: .3rem; }
list > #plugin:last-child { margin-bottom: .3rem; }
list > #plugin:hover { padding: .6rem; }
2023-10-13 21:04:24 +02:00
box#main {
background: rgba(0, 0, 0, .5);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 0 0 1px rgba(0, 0, 0, .5);
border-radius: 24px;
padding: .3rem;
}
'';
extraConfigFiles = {
"applications.ron".text = ''
Config(
desktop_actions: true,
terminal: Some("foot"),
max_entries: 30,
)
'';
"dictionary.ron".text = ''
Config(
prefix: ":d",
)
'';
"symbols.ron".text = ''
Config(
prefix: ":s",
2023-11-25 17:12:09 +01:00
max_entries: 30,
2023-10-13 21:04:24 +02:00
)
'';
"translate.ron".text = ''
Config(
prefix: ":",
language_delimiter: ">",
)
'';
};
};
};
};
}