1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

rofi: add options to for location, xoffset & yoffset

This commit is contained in:
Mogria 2018-01-27 18:10:13 +01:00 committed by Robert Helgesson
parent 2304c145f3
commit 6833f96c14
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86

View file

@ -113,6 +113,17 @@ let
(rowsColorsToString colors.rows)}
'';
locationsMap = {
center = 0;
top-left = 1;
top = 2;
top-right = 3;
right = 4;
bottom-right = 5;
bottom = 6;
bottom-left = 7;
left = 8;
};
in
{
@ -195,6 +206,28 @@ in
description = "Whether to run rofi fullscreen.";
};
location = mkOption {
default = "center";
type = types.enum (builtins.attrNames locationsMap);
description = "The location rofi appears on the screen.";
};
xoffset = mkOption {
default = 0;
type = types.int;
description = ''
Offset in the x-axis in pixels relative to the chosen location.
'';
};
yoffset = mkOption {
default = 0;
type = types.int;
description = ''
Offset in the y-axis in pixels relative to the chosen location.
'';
};
colors = mkOption {
default = null;
type = types.nullOr colorsSubmodule;
@ -258,6 +291,9 @@ in
${setOption "terminal" cfg.terminal}
${setOption "cycle" cfg.cycle}
${setOption "fullscreen" cfg.fullscreen}
${setOption "location" (builtins.getAttr cfg.location locationsMap)}
${setOption "xoffset" cfg.xoffset}
${setOption "yoffset" cfg.yoffset}
${setColorScheme cfg.colors}