From 812a8d3669d4aaa3ded718eac2e4b3e69354d8d6 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sat, 23 Sep 2023 18:31:08 +0100 Subject: [PATCH] Add back anyrun with a config to test --- flake.lock | 43 ++++++++++++++++++++++ flake.nix | 6 +++- home/hyprland/anyrun.nix | 77 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 home/hyprland/anyrun.nix diff --git a/flake.lock b/flake.lock index fdbfa3be..18f08fc2 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "anyrun": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1692476235, + "narHash": "sha256-NGUDp/24HCIVWE0xZNHIdzz3q2WDk7MQz1wC7ub/e2U=", + "owner": "Kirottu", + "repo": "anyrun", + "rev": "76af3eb198f376303194c31a83f2399a043acf1b", + "type": "github" + }, + "original": { + "owner": "Kirottu", + "repo": "anyrun", + "type": "github" + } + }, "catppuccin-alacritty": { "flake": false, "locked": { @@ -144,6 +165,27 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "anyrun", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685662779, + "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "gitui": { "flake": false, "locked": { @@ -247,6 +289,7 @@ }, "root": { "inputs": { + "anyrun": "anyrun", "catppuccin-alacritty": "catppuccin-alacritty", "catppuccin-bat": "catppuccin-bat", "catppuccin-fish": "catppuccin-fish", diff --git a/flake.nix b/flake.nix index b52a69f9..3814e7bf 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,10 @@ url = "github:hyprwm/Hyprland"; inputs.nixpkgs.follows = "nixpkgs"; }; + anyrun = { + url = "github:Kirottu/anyrun"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # Non-flake inputs doom-emacs = { @@ -95,7 +99,7 @@ }; extraSpecialArgs = specialArgs // { inherit wallpapers catppuccin-themes; - inherit (inputs) doom-emacs gitui; + inherit (inputs) doom-emacs gitui anyrun; }; commonModule = { pkgs, ... }: { nix = { diff --git a/home/hyprland/anyrun.nix b/home/hyprland/anyrun.nix new file mode 100644 index 00000000..dc597071 --- /dev/null +++ b/home/hyprland/anyrun.nix @@ -0,0 +1,77 @@ +{ pkgs, anyrun, ... }: { + programs.anyrun = { + enable = true; + + config = { + plugins = with anyrun.packages.${pkgs.system}; [ + applications + randr + rink + shell + symbols + translate + ]; + + width.fraction = 0.3; + y.absolute = 15; + hidePluginInfo = true; + closeOnClick = true; + }; + + extraCss = '' + * { + all: unset; + font-family: Lexend; + font-size: 1.3rem; + } + + #window, + #match, + #entry, + #plugin, + #main { background: transparent; } + + #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; } + + #plugin:hover #match.activatable { + border-radius: 10px; + padding: .3rem; + margin-top: .01rem; + margin-bottom: 0; + } + + #match:selected, #match:hover, #plugin:hover { + background: rgba(255, 255, 255, .1); + } + + #entry { + background: rgba(255,255,255,.05); + border: 1px solid rgba(255,255,255,.1); + border-radius: 16px; + margin: .3rem; + padding: .3rem 1rem; + } + + 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; } + + 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; + } + ''; + }; +}