rofi: use string values for location
instead of numbers to be more descriptive
This commit is contained in:
parent
54ac815593
commit
27f7be844a
|
@ -113,6 +113,17 @@ let
|
||||||
(rowsColorsToString colors.rows)}
|
(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
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -196,20 +207,9 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
location = mkOption {
|
location = mkOption {
|
||||||
default = 0;
|
default = "center";
|
||||||
type = types.enum (range 0 8);
|
type = types.enum (builtins.attrNames locationsMap);
|
||||||
description = ''
|
description = "The location rofi appears on the screen.";
|
||||||
Location on the screen following the pattern:
|
|
||||||
<informaltable frame="none">
|
|
||||||
<tgroup cols="1"><tbody>
|
|
||||||
<row><entry>1 (top left)</entry><entry>2 (top)</entry><entry>3 (top right)</entry></row>
|
|
||||||
<row><entry>8 (left)</entry><entry>0 (center)</entry><entry>4 (right)</entry></row>
|
|
||||||
<row><entry>7 (bottom left)</entry><entry>6 (bottom)</entry><entry>5 (bottom right)</entry></row>
|
|
||||||
</tbody>
|
|
||||||
</tgroup>
|
|
||||||
</informaltable>
|
|
||||||
'';
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
xoffset = mkOption {
|
xoffset = mkOption {
|
||||||
|
@ -287,7 +287,7 @@ in
|
||||||
${setOption "terminal" cfg.terminal}
|
${setOption "terminal" cfg.terminal}
|
||||||
${setOption "cycle" cfg.cycle}
|
${setOption "cycle" cfg.cycle}
|
||||||
${setOption "fullscreen" cfg.fullscreen}
|
${setOption "fullscreen" cfg.fullscreen}
|
||||||
${setOption "location" cfg.location}
|
${setOption "location" (builtins.getAttr cfg.location locationsMap)}
|
||||||
${setOption "xoffset" cfg.xoffset}
|
${setOption "xoffset" cfg.xoffset}
|
||||||
${setOption "yoffset" cfg.yoffset}
|
${setOption "yoffset" cfg.yoffset}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue