From 6833f96c147779fe197657bbcc4bd323324cd6c3 Mon Sep 17 00:00:00 2001 From: Mogria Date: Sat, 27 Jan 2018 18:10:13 +0100 Subject: [PATCH] rofi: add options to for location, xoffset & yoffset --- modules/programs/rofi.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/modules/programs/rofi.nix b/modules/programs/rofi.nix index 9391b2d09..de98a4667 100644 --- a/modules/programs/rofi.nix +++ b/modules/programs/rofi.nix @@ -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}