nixos/home/desktop/rofi/default.nix

140 lines
3.5 KiB
Nix
Raw Normal View History

{
config,
pkgs,
fonts,
accentColourName,
...
}: {
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
terminal = with config.programs; "${
if alacritty.enable
then alacritty.package
else pkgs.alacritty
}/bin/alacritty";
font = fonts.monospace.name;
location = "center";
plugins = with pkgs; [rofi-emoji];
extraConfig = {
modi = "run,drun,ssh,window,emoji,combi";
combi-modi = "drun,ssh,window,emoji";
sidebar-mode = true;
sort = true;
sorting-method = "fzf";
matching = "fuzzy";
icon-theme = config.gtk.iconTheme.name;
show-icons = true;
application-fallback-icon = "application-x-addon";
drun-display-format = "{icon} {name} ({categories})";
disable-history = false;
hide-scrollbar = true;
display-run = " 󰅴 Run ";
display-drun = " 󱓞 Apps ";
display-ssh = " 󰢹 SSH ";
display-window = " 󰧨 Move ";
display-emoji = " 󰞅 Emoji ";
display-combi = " 󰛡 Combi ";
};
theme = with builtins; let
inherit (config.lib.formats.rasi) mkLiteral;
sc = config.scheme;
bg = mkLiteral "rgba (${sc.base00-rgb-r}, ${sc.base00-rgb-g}, ${sc.base00-rgb-b}, 80%)";
bg2 = mkLiteral "rgba (${sc.base01-rgb-r}, ${sc.base01-rgb-g}, ${sc.base01-rgb-b}, 100%)";
fg = mkLiteral sc.withHashtag.base05;
fg2 = mkLiteral sc.withHashtag.base04;
border = mkLiteral sc.withHashtag.${accentColour};
blue = mkLiteral sc.withHashtag.blue;
in {
"*" = {
background-color = mkLiteral "transparent";
text-color = fg;
font = with fonts; "${monospace.name} ${toString sizes.popups}";
};
window = {
height = mkLiteral "75%";
width = mkLiteral "75%";
border = mkLiteral "1px";
border-color = border;
border-radius = mkLiteral "5px";
background-color = bg;
};
inputbar = {
children = map mkLiteral ["prompt" "entry"];
padding = mkLiteral "2px";
};
prompt = {
background-color = bg2;
padding = mkLiteral "6px";
text-color = blue;
border-radius = mkLiteral "5px";
margin = mkLiteral "20px 0px 0px 20px";
};
textbox-prompt-colon = {
expand = false;
str = "=";
};
entry = {
padding = mkLiteral "6px";
margin = mkLiteral "20px 0px 0px 10px";
};
listview = {
border = mkLiteral "0px 0px 0px";
padding = mkLiteral "6px 0px 0px";
margin = mkLiteral "10px 0px 0px 20px";
columns = 2;
lines = 5;
};
element = {
padding = mkLiteral "5px";
};
"element-icon" = {
size = mkLiteral "25px";
};
"element selected" = {
background-color = bg2;
text-color = blue;
border-radius = mkLiteral "5px";
};
mode-switcher = {
spacing = 0;
};
button = {
padding = mkLiteral "10px";
text-color = fg2;
border-radius = mkLiteral "5px";
vertical-align = mkLiteral "0.5";
horizontal-align = mkLiteral "0.5";
};
"button selected" = {
background-color = bg2;
text-color = blue;
};
message = {
margin = mkLiteral "2px";
padding = mkLiteral "2px";
border-radius = mkLiteral "5px";
};
textbox = {
padding = mkLiteral "6px";
margin = mkLiteral "20px 0px 0px 20px";
text-color = blue;
};
};
};
}