added otter launcher

This commit is contained in:
2026-07-04 13:41:07 +01:00
parent 06d93d6e4f
commit d28858fb45
3 changed files with 103 additions and 17 deletions

View File

@@ -11,8 +11,6 @@ loop_mode = false # don't quit after executing a module, useful with scratchpads
external_editor = "nvim" # if set, press ctrl+x ctrl+ee (or v in vi normal mode) to edit prompt in the specified program
delay_startup = 0 # sometimes the otter runs too fast even before the terminal window is ready; this slows it down by milliseconds; useful when chafa image is skewed
# ANSI color codes are allowed. However, \x1b should be replaced with \u001B, because the rust toml crate cannot read \x as an escaped character
[interface]
# use three quotes to write longer codes
header = """
@@ -41,12 +39,6 @@ hint_color = "\u001B[30m" # suggestion color in hint mode
move_interface_right = 21
move_interface_down = 0
[overlay]
overlay_cmd = """
chafa -s 20x20 ~/.config/otter-launcher/cat.png
"""
overlay_trimmed_lines = 1
[[modules]]
description = "programs"
prefix = "app"

View File

@@ -21,12 +21,16 @@
}: {
packages = {
otter-launcher = let
config-file = ./config.toml;
extra-config = ''
[overlay]
overlay_cmd = """
${pkgs.chafa} -s 20x20 ${./cat.png}
"""
[overlay]
overlay_cmd = """
${lib.getExe pkgs.chafa} -s 20x20 ${./cat.png}
"""
# overlay_trimmed_lines = 1
'';
final-config = pkgs.writeText "config.toml" ''
${builtins.readFile ./config.toml}
${extra-config}
'';
in
inputs.wrappers.lib.wrapPackage ({
@@ -38,10 +42,7 @@
inherit pkgs;
package = inputs.otter-launcher.packages.${pkgs.stdenv.hostPlatform.system}.default;
flags = {
"-c" = lib.mkMerge [
config-file
extra-config
];
"-c" = final-config;
};
});
};