2022-05-06 03:01:56 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
2022-05-04 01:11:31 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
config = lib.mkIf config.services.xserver.enable {
|
|
|
|
|
2022-05-15 19:24:16 +00:00
|
|
|
home-manager.users.${config.user} = {
|
|
|
|
|
|
|
|
home.packages = with pkgs;
|
|
|
|
[
|
|
|
|
jq # Required for rofi-systemd
|
|
|
|
];
|
|
|
|
|
|
|
|
programs.rofi = {
|
|
|
|
enable = true;
|
|
|
|
cycle = true;
|
|
|
|
location = "center";
|
|
|
|
pass = { };
|
|
|
|
plugins = [ pkgs.rofi-calc pkgs.rofi-emoji pkgs.rofi-systemd ];
|
|
|
|
theme = let
|
|
|
|
inherit (config.home-manager.users.${config.user}.lib.formats.rasi)
|
|
|
|
mkLiteral;
|
|
|
|
in {
|
|
|
|
|
|
|
|
# Inspired by https://github.com/sherubthakur/dotfiles/blob/master/users/modules/desktop-environment/rofi/launcher.rasi
|
|
|
|
|
|
|
|
"*" = {
|
2022-07-26 03:36:06 +00:00
|
|
|
background-color = mkLiteral config.colorscheme.base00;
|
|
|
|
foreground-color = mkLiteral config.colorscheme.base07;
|
|
|
|
text-color = mkLiteral config.colorscheme.base07;
|
|
|
|
border-color = mkLiteral config.colorscheme.base04;
|
2022-05-15 19:24:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Holds the entire window
|
|
|
|
"#window" = {
|
|
|
|
transparency = "real";
|
2022-07-26 03:36:06 +00:00
|
|
|
background-color = mkLiteral config.colorscheme.base00;
|
|
|
|
text-color = mkLiteral config.colorscheme.base07;
|
2022-05-15 19:24:16 +00:00
|
|
|
border = mkLiteral "4px";
|
2022-07-26 03:36:06 +00:00
|
|
|
border-color = mkLiteral config.colorscheme.base04;
|
2022-05-15 19:24:16 +00:00
|
|
|
border-radius = mkLiteral "4px";
|
|
|
|
width = mkLiteral "850px";
|
|
|
|
padding = mkLiteral "15px";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Wrapper around bar and results
|
|
|
|
"#mainbox" = {
|
2022-07-26 03:36:06 +00:00
|
|
|
background-color = mkLiteral config.colorscheme.base00;
|
2022-05-15 19:24:16 +00:00
|
|
|
border = mkLiteral "0px";
|
|
|
|
border-radius = mkLiteral "0px";
|
2022-07-26 03:36:06 +00:00
|
|
|
border-color = mkLiteral config.colorscheme.base04;
|
2022-05-15 19:24:16 +00:00
|
|
|
children = map mkLiteral [ "inputbar" "listview" ];
|
|
|
|
spacing = mkLiteral "10px";
|
|
|
|
padding = mkLiteral "10px";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Unknown
|
|
|
|
"#textbox-prompt-colon" = {
|
|
|
|
expand = false;
|
|
|
|
str = ":";
|
|
|
|
margin = mkLiteral "0px 0.3em 0em 0em";
|
2022-07-26 03:36:06 +00:00
|
|
|
text-color = mkLiteral config.colorscheme.base07;
|
2022-05-15 19:24:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Command prompt left of the input
|
|
|
|
"#prompt" = { enabled = false; };
|
|
|
|
|
|
|
|
# Actual text box
|
|
|
|
"#entry" = {
|
2022-07-26 03:36:06 +00:00
|
|
|
placeholder-color = mkLiteral config.colorscheme.base03;
|
2022-05-15 19:24:16 +00:00
|
|
|
expand = true;
|
|
|
|
horizontal-align = "0";
|
|
|
|
placeholder = "Launch Program";
|
|
|
|
padding = mkLiteral "0px 0px 0px 5px";
|
|
|
|
blink = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Top bar
|
|
|
|
"#inputbar" = {
|
|
|
|
children = map mkLiteral [ "prompt" "entry" ];
|
|
|
|
border = mkLiteral "1px";
|
|
|
|
border-radius = mkLiteral "4px";
|
|
|
|
padding = mkLiteral "6px";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Results
|
|
|
|
"#listview" = {
|
2022-07-26 03:36:06 +00:00
|
|
|
background-color = mkLiteral config.colorscheme.base00;
|
2022-05-15 19:24:16 +00:00
|
|
|
padding = mkLiteral "0px";
|
|
|
|
columns = 1;
|
|
|
|
lines = 12;
|
|
|
|
spacing = "5px";
|
|
|
|
cycle = true;
|
|
|
|
dynamic = true;
|
|
|
|
layout = "vertical";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Each result
|
|
|
|
"#element" = {
|
|
|
|
orientation = "vertical";
|
|
|
|
border-radius = mkLiteral "0px";
|
|
|
|
padding = mkLiteral "5px 0px 5px 5px";
|
|
|
|
};
|
|
|
|
"#element.selected" = {
|
|
|
|
border = mkLiteral "1px";
|
|
|
|
border-radius = mkLiteral "4px";
|
2022-07-26 03:36:06 +00:00
|
|
|
border-color = mkLiteral config.colorscheme.base07;
|
|
|
|
background-color = mkLiteral config.colorscheme.base04;
|
|
|
|
text-color = mkLiteral config.colorscheme.base00;
|
2022-05-15 19:24:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
"#element-text" = {
|
|
|
|
expand = true;
|
|
|
|
# horizontal-align = mkLiteral "0.5";
|
|
|
|
vertical-align = mkLiteral "0.5";
|
|
|
|
margin = mkLiteral "0px 2.5px 0px 2.5px";
|
|
|
|
};
|
|
|
|
"#element-text.selected" = {
|
2022-07-26 03:36:06 +00:00
|
|
|
background-color = mkLiteral config.colorscheme.base04;
|
|
|
|
text-color = mkLiteral config.colorscheme.base00;
|
2022-05-15 19:24:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Not sure how to get icons
|
|
|
|
"#element-icon" = {
|
|
|
|
size = mkLiteral "18px";
|
|
|
|
border = mkLiteral "0px";
|
|
|
|
padding = mkLiteral "2px 5px 2px 2px";
|
2022-07-26 03:36:06 +00:00
|
|
|
background-color = mkLiteral config.colorscheme.base00;
|
2022-05-15 19:24:16 +00:00
|
|
|
};
|
|
|
|
"#element-icon.selected" = {
|
2022-07-26 03:36:06 +00:00
|
|
|
background-color = mkLiteral config.colorscheme.base04;
|
|
|
|
text-color = mkLiteral config.colorscheme.base00;
|
2022-05-15 19:24:16 +00:00
|
|
|
};
|
2022-05-07 13:24:17 +00:00
|
|
|
|
|
|
|
};
|
2022-05-15 19:24:16 +00:00
|
|
|
xoffset = 0;
|
|
|
|
yoffset = -20;
|
|
|
|
extraConfig = {
|
|
|
|
show-icons = true;
|
|
|
|
kb-cancel = "Escape,Super+space";
|
|
|
|
modi = "window,run,ssh,emoji,calc,systemd";
|
2022-05-07 13:24:17 +00:00
|
|
|
};
|
2022-05-07 13:56:16 +00:00
|
|
|
};
|
2022-05-15 19:24:16 +00:00
|
|
|
|
2022-05-04 01:11:31 +00:00
|
|
|
};
|
2022-05-15 19:24:16 +00:00
|
|
|
|
2022-05-15 12:18:03 +00:00
|
|
|
gui.launcherCommand = "${pkgs.rofi}/bin/rofi -show run -modi run";
|
2022-05-15 19:24:16 +00:00
|
|
|
gui.systemdSearch = "${pkgs.rofi-systemd}/bin/rofi-systemd";
|
2022-06-03 02:09:53 +00:00
|
|
|
gui.altTabCommand = "${pkgs.rofi}/bin/rofi -show window -modi window";
|
2022-05-04 01:11:31 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|