Skip to content

Commit

Permalink
add anyrun
Browse files Browse the repository at this point in the history
replaced rofi with anyrun in hyprland
TODO: make colors dynamic
  • Loading branch information
mardukpill committed Jul 21, 2024
1 parent 229cee4 commit 77fcc72
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 14 deletions.
81 changes: 70 additions & 11 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};

anyrun = {
url = "github:anyrun-org/anyrun";
inputs.nixpkgs.follows = "nixpkgs";
};

hardware.url = "github:nixos/nixos-hardware";
razer-laptop-control.url = "github:Razer-Linux/razer-laptop-control-no-dkms";

Expand Down Expand Up @@ -72,6 +77,7 @@
nixvim.homeManagerModules.nixvim
spicetify-nix.homeManagerModules.default
nix-colors.homeManagerModules.default
anyrun.homeManagerModules.default
];

systems.modules.nixos = with inputs; [ home-manager.nixosModules.home-manager ];
Expand Down
41 changes: 41 additions & 0 deletions modules/home/utility/anyrun/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
pkgs,
lib,
config,
namespace,
inputs,
...
}:
let
inherit (lib) mkEnableOption mkIf;

cfg = config.${namespace}.utility.anyrun;
in
{
options.${namespace}.utility.anyrun = {
enable = mkEnableOption "anyrun.";
};

config = mkIf cfg.enable {
programs.anyrun = {
enable = true;
config = {
plugins = with inputs.anyrun.packages.${pkgs.system}; [
applications
# kidex
rink
symbols
shell
# dictionary
# randr
];
width.fraction = 0.2;
# x.fraction = 0.1;
y.fraction = 0.2;
hidePluginInfo = true;
closeOnClick = true;
};
extraCss = builtins.readFile ./theme.css; # TODO: don't use static colors
};
};
}
62 changes: 62 additions & 0 deletions modules/home/utility/anyrun/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
* {
all: unset;
font-size: 1.2rem;
}

#window,
#match,
#entry,
#plugins,
#main {
background: transparent;
}

#match.activatable {
border-radius: 8px;
margin: 4px 0;
padding: 4px;
transition: 50ms ease-out;
}
#match.activatable:first-child {
margin-top: 12px;
}
#match.activatable:last-child {
margin-bottom: 0;
}

#match:hover {
background: rgba(255, 255, 255, 0.05);
}
#match:selected:nth-child(3n+1) {
background: rgba(255, 255, 255, 0.1);
border-radius: 8px;
border: 3px solid #F6C177;
}
#match:selected:nth-child(3n+2) {
background: rgba(255, 255, 255, 0.1);
border-radius: 8px;
border: 3px solid #9CCFD8;
}
#match:selected:nth-child(3n) {
background: rgba(255, 255, 255, 0.1);
border-radius: 8px;
border: 3px solid #C4A7E7;
}

#entry {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
padding: 4px 8px;
}

box#main {
background: #191724;
box-shadow:
inset 0 0 0 1px rgba(255, 255, 255, 0.1),
0 5px 5px 5px rgba(0, 0, 0, 0.5);
border: 3px solid #EB6F92;
border-radius: 20px;
padding: 12px;
}

6 changes: 4 additions & 2 deletions modules/home/wms/hyprland/binds.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
}:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) enabled;

cfg = config.${namespace}.wms.hyprland;
in
{
config = mkIf cfg.enable {
dotties.utility.anyrun = enabled;

wayland.windowManager.hyprland = {
settings = {
"$mod" = "SUPER";
Expand Down Expand Up @@ -58,8 +61,7 @@ in
"$mod CONTROL_SHIFT, S, exec, grimblast --notify edit screen"

# rofi
"$mod, D, exec, pkill rofi || ${pkgs.rofi-wayland}/bin/rofi -show drun"
"$mod, Period, exec, pkill rofi || ${pkgs.bemoji}/bin/bemoji"
"$mod, D, exec, ${pkgs.anyrun}/bin/anyrun"

# client controls
"$mod, M, fullscreen, 1"
Expand Down
1 change: 0 additions & 1 deletion modules/home/wms/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ in
imports = lib.snowfall.fs.get-non-default-nix-files ./.;

config = mkIf cfg.enable {
dotties.apps.rofi = enabled;
dotties.utility.mako = enabled;
dotties.utility.waybar = enabled;
dotties.services.swww = {
Expand Down

0 comments on commit 77fcc72

Please sign in to comment.