From 1cada48ab4755e1c3a6bf445ac9f1dbdf419167b Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 23 Sep 2023 12:59:22 +0530 Subject: readd rofi --- patches/2bwm/nerd-patch.diff | 12 +++++--- programs/rofi.nix | 72 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 programs/rofi.nix diff --git a/patches/2bwm/nerd-patch.diff b/patches/2bwm/nerd-patch.diff index b0642e5..9e315be 100644 --- a/patches/2bwm/nerd-patch.diff +++ b/patches/2bwm/nerd-patch.diff @@ -1,28 +1,32 @@ diff --git a/config.h b/config.h -index 0985d2e..4dce13d 100644 +index 0985d2e..baa77f8 100644 --- a/config.h +++ b/config.h -@@ -40,7 +40,8 @@ static const uint8_t borders[] = {3,5,5,4}; +@@ -40,7 +40,10 @@ static const uint8_t borders[] = {3,5,5,4}; #define LOOK_INTO "WM_NAME" static const char *ignore_names[] = {"bar", "xclock"}; ///--Menus and Programs---/// -static const char *menucmd[] = { "", NULL }; +// static const char *menucmd[] = { "", NULL }; +static const char *terminal[] = { "st", NULL }; ++static const char *rofi_run[] = { "rofi", "-show", "combi" }; ++static const char *rofi_window[] = { "rofi", "-show", "window" }; ///--Custom foo---/// static void halfandcentered(const Arg *arg) { -@@ -193,7 +194,8 @@ static key keys[] = { +@@ -193,7 +196,10 @@ static key keys[] = { { MOD |SHIFT, XK_Right, cursor_move, {.i=TWOBWM_CURSOR_RIGHT}}, { MOD |SHIFT, XK_Left, cursor_move, {.i=TWOBWM_CURSOR_LEFT}}, // Start programs - { MOD , XK_w, start, {.com = menucmd}}, + //{ MOD , XK_w, start, {.com = menucmd}}, + { MOD , XK_Return, start, {.com = terminal}}, ++ { MOD , XK_d, start, {.com = rofi_run}}, ++ { MOD , XK_i, start, {.com = rofi_window}}, // Exit or restart 2bwm { MOD |CONTROL, XK_q, twobwm_exit, {.i=0}}, { MOD |CONTROL, XK_r, twobwm_restart, {.i=0}}, -@@ -215,7 +217,7 @@ static key keys[] = { +@@ -215,7 +221,7 @@ static key keys[] = { static Button buttons[] = { { MOD ,XCB_BUTTON_INDEX_1, mousemotion, {.i=TWOBWM_MOVE}, false}, { MOD ,XCB_BUTTON_INDEX_3, mousemotion, {.i=TWOBWM_RESIZE}, false}, diff --git a/programs/rofi.nix b/programs/rofi.nix new file mode 100644 index 0000000..12c0d7b --- /dev/null +++ b/programs/rofi.nix @@ -0,0 +1,72 @@ +{ config +, pkgs +, theme +, ... +}: + +with theme; +let + inherit (config.lib.formats.rasi) mkLiteral; + rofi-theme = { + "@import" = "default"; + "*" = { + active-background = mkLiteral theme.base00; + alternate-active-background = mkLiteral theme.base00; + alternate-normal-background = mkLiteral theme.base00; + background = mkLiteral theme.base00; + background-color = mkLiteral theme.base00; + normal-background = mkLiteral theme.base00; + selected-active-background = mkLiteral theme.base00; + selected-normal-background = mkLiteral theme.base00; + selected-urgent-background = mkLiteral theme.base00; + + active-foreground = mkLiteral theme.base05; + alternate-active-foreground = mkLiteral theme.base05; + alternate-normal-foreground = mkLiteral theme.base05; + foreground = mkLiteral theme.base05; + normal-foreground = mkLiteral theme.base05; + selected-active-foreground = mkLiteral theme.base0C; + selected-normal-foreground = mkLiteral theme.base0C; + urgent-foreground = mkLiteral theme.base05; + + border = mkLiteral "4px solid"; + border-color = mkLiteral theme.base01; + }; + + inputbar.children = [ "entry" ]; + + element.padding = 10; + entry = { + padding = 10; + placeholder = "type to filter"; + }; + listview.border = 0; + scrollbar.handle-width = 0; + window = { + padding = 40; + width = 800; + height = 600; + }; + }; +in +{ + programs.rofi = { + enable = true; + font = "Fira Code 21"; + location = "top-left"; + xoffset = 20; + yoffset = 20; + cycle = true; + theme = rofi-theme; + extraConfig = { + modes = mkLiteral "[ combi ]"; + combi-modes = mkLiteral "[ window, run ]"; + # window = mkLiteral ''{ display-name: "[w]"; }''; + # run = mkLiteral ''{ display-name: "[r]"; }''; + kb-clear-line = "Control+c"; + kb-remove-word-back = "Control+w"; + }; + }; +} + + -- cgit v1.2.3