aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patches/2bwm/nerd-patch.diff12
-rw-r--r--programs/rofi.nix72
2 files changed, 80 insertions, 4 deletions
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 @@
1diff --git a/config.h b/config.h 1diff --git a/config.h b/config.h
2index 0985d2e..4dce13d 100644 2index 0985d2e..baa77f8 100644
3--- a/config.h 3--- a/config.h
4+++ b/config.h 4+++ b/config.h
5@@ -40,7 +40,8 @@ static const uint8_t borders[] = {3,5,5,4}; 5@@ -40,7 +40,10 @@ static const uint8_t borders[] = {3,5,5,4};
6 #define LOOK_INTO "WM_NAME" 6 #define LOOK_INTO "WM_NAME"
7 static const char *ignore_names[] = {"bar", "xclock"}; 7 static const char *ignore_names[] = {"bar", "xclock"};
8 ///--Menus and Programs---/// 8 ///--Menus and Programs---///
9-static const char *menucmd[] = { "", NULL }; 9-static const char *menucmd[] = { "", NULL };
10+// static const char *menucmd[] = { "", NULL }; 10+// static const char *menucmd[] = { "", NULL };
11+static const char *terminal[] = { "st", NULL }; 11+static const char *terminal[] = { "st", NULL };
12+static const char *rofi_run[] = { "rofi", "-show", "combi" };
13+static const char *rofi_window[] = { "rofi", "-show", "window" };
12 ///--Custom foo---/// 14 ///--Custom foo---///
13 static void halfandcentered(const Arg *arg) 15 static void halfandcentered(const Arg *arg)
14 { 16 {
15@@ -193,7 +194,8 @@ static key keys[] = { 17@@ -193,7 +196,10 @@ static key keys[] = {
16 { MOD |SHIFT, XK_Right, cursor_move, {.i=TWOBWM_CURSOR_RIGHT}}, 18 { MOD |SHIFT, XK_Right, cursor_move, {.i=TWOBWM_CURSOR_RIGHT}},
17 { MOD |SHIFT, XK_Left, cursor_move, {.i=TWOBWM_CURSOR_LEFT}}, 19 { MOD |SHIFT, XK_Left, cursor_move, {.i=TWOBWM_CURSOR_LEFT}},
18 // Start programs 20 // Start programs
19- { MOD , XK_w, start, {.com = menucmd}}, 21- { MOD , XK_w, start, {.com = menucmd}},
20+ //{ MOD , XK_w, start, {.com = menucmd}}, 22+ //{ MOD , XK_w, start, {.com = menucmd}},
21+ { MOD , XK_Return, start, {.com = terminal}}, 23+ { MOD , XK_Return, start, {.com = terminal}},
24+ { MOD , XK_d, start, {.com = rofi_run}},
25+ { MOD , XK_i, start, {.com = rofi_window}},
22 // Exit or restart 2bwm 26 // Exit or restart 2bwm
23 { MOD |CONTROL, XK_q, twobwm_exit, {.i=0}}, 27 { MOD |CONTROL, XK_q, twobwm_exit, {.i=0}},
24 { MOD |CONTROL, XK_r, twobwm_restart, {.i=0}}, 28 { MOD |CONTROL, XK_r, twobwm_restart, {.i=0}},
25@@ -215,7 +217,7 @@ static key keys[] = { 29@@ -215,7 +221,7 @@ static key keys[] = {
26 static Button buttons[] = { 30 static Button buttons[] = {
27 { MOD ,XCB_BUTTON_INDEX_1, mousemotion, {.i=TWOBWM_MOVE}, false}, 31 { MOD ,XCB_BUTTON_INDEX_1, mousemotion, {.i=TWOBWM_MOVE}, false},
28 { MOD ,XCB_BUTTON_INDEX_3, mousemotion, {.i=TWOBWM_RESIZE}, false}, 32 { 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 @@
1{ config
2, pkgs
3, theme
4, ...
5}:
6
7with theme;
8let
9 inherit (config.lib.formats.rasi) mkLiteral;
10 rofi-theme = {
11 "@import" = "default";
12 "*" = {
13 active-background = mkLiteral theme.base00;
14 alternate-active-background = mkLiteral theme.base00;
15 alternate-normal-background = mkLiteral theme.base00;
16 background = mkLiteral theme.base00;
17 background-color = mkLiteral theme.base00;
18 normal-background = mkLiteral theme.base00;
19 selected-active-background = mkLiteral theme.base00;
20 selected-normal-background = mkLiteral theme.base00;
21 selected-urgent-background = mkLiteral theme.base00;
22
23 active-foreground = mkLiteral theme.base05;
24 alternate-active-foreground = mkLiteral theme.base05;
25 alternate-normal-foreground = mkLiteral theme.base05;
26 foreground = mkLiteral theme.base05;
27 normal-foreground = mkLiteral theme.base05;
28 selected-active-foreground = mkLiteral theme.base0C;
29 selected-normal-foreground = mkLiteral theme.base0C;
30 urgent-foreground = mkLiteral theme.base05;
31
32 border = mkLiteral "4px solid";
33 border-color = mkLiteral theme.base01;
34 };
35
36 inputbar.children = [ "entry" ];
37
38 element.padding = 10;
39 entry = {
40 padding = 10;
41 placeholder = "type to filter";
42 };
43 listview.border = 0;
44 scrollbar.handle-width = 0;
45 window = {
46 padding = 40;
47 width = 800;
48 height = 600;
49 };
50 };
51in
52{
53 programs.rofi = {
54 enable = true;
55 font = "Fira Code 21";
56 location = "top-left";
57 xoffset = 20;
58 yoffset = 20;
59 cycle = true;
60 theme = rofi-theme;
61 extraConfig = {
62 modes = mkLiteral "[ combi ]";
63 combi-modes = mkLiteral "[ window, run ]";
64 # window = mkLiteral ''{ display-name: "[w]"; }'';
65 # run = mkLiteral ''{ display-name: "[r]"; }'';
66 kb-clear-line = "Control+c";
67 kb-remove-word-back = "Control+w";
68 };
69 };
70}
71
72