diff --git a/flake.lock b/flake.lock index bd093cb..35d3315 100644 --- a/flake.lock +++ b/flake.lock @@ -71,6 +71,24 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1768135262, + "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -94,6 +112,27 @@ "type": "github" } }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "otter-launcher", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769638001, + "narHash": "sha256-hGwdJ/+oo+IRo2TiWV/V8BWWptQihcdFV/olTONaHqg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "bd9f031efc634be4b80c5090b9171cc3a9f8e49c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "hyprcursor": { "inputs": { "hyprlang": [ @@ -511,6 +550,21 @@ "type": "github" } }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1765674936, + "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1782723713, @@ -626,6 +680,29 @@ "url": "https://git.voidarc.co.uk/voidarc/nvim" } }, + "otter-launcher": { + "inputs": { + "flake-parts": "flake-parts_2", + "home-manager": "home-manager", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1783145565, + "narHash": "sha256-czL1P2nQV3JrbV6J2b3jXnWcz+Kbz+xhaXKk3+wdnF0=", + "owner": "kuokuo123", + "repo": "otter-launcher", + "rev": "2e35ce8c7ba6f5e4d98bf4c9073f5fa91143744d", + "type": "github" + }, + "original": { + "owner": "kuokuo123", + "repo": "otter-launcher", + "type": "github" + } + }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", @@ -657,6 +734,7 @@ "import-tree": "import-tree", "nixpkgs": "nixpkgs_4", "nvim": "nvim", + "otter-launcher": "otter-launcher", "wrappers": "wrappers_3" } }, @@ -675,6 +753,21 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "wrappers": { "inputs": { "nixpkgs": "nixpkgs_3" diff --git a/modules/features/otter-launcher/config.toml b/modules/features/otter-launcher/config.toml index 621aab6..2853a39 100644 --- a/modules/features/otter-launcher/config.toml +++ b/modules/features/otter-launcher/config.toml @@ -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" diff --git a/modules/features/otter-launcher/default.nix b/modules/features/otter-launcher/default.nix index fdb965f..dc01618 100644 --- a/modules/features/otter-launcher/default.nix +++ b/modules/features/otter-launcher/default.nix @@ -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; }; }); };