From 64c5de2f8400b0d2589f9543978f777cb002a2bd Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 1 Oct 2023 16:33:22 -0500 Subject: [PATCH] add wofi --- home/features/desktop/wayland-wm/default.nix | 1 + .../desktop/wayland-wm/wofi-run-shell.patch | 20 +++++++++++++++++++ home/features/desktop/wayland-wm/wofi.nix | 19 ++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 home/features/desktop/wayland-wm/wofi-run-shell.patch create mode 100644 home/features/desktop/wayland-wm/wofi.nix diff --git a/home/features/desktop/wayland-wm/default.nix b/home/features/desktop/wayland-wm/default.nix index f609bba..2af4bfe 100644 --- a/home/features/desktop/wayland-wm/default.nix +++ b/home/features/desktop/wayland-wm/default.nix @@ -3,6 +3,7 @@ ./kitty.nix ./mako.nix ./waybar.nix + ./wofi.nix ]; xdg.mimeApps.enable = true; diff --git a/home/features/desktop/wayland-wm/wofi-run-shell.patch b/home/features/desktop/wayland-wm/wofi-run-shell.patch new file mode 100644 index 0000000..2a633f2 --- /dev/null +++ b/home/features/desktop/wayland-wm/wofi-run-shell.patch @@ -0,0 +1,20 @@ +--- a/src/wofi.c Mon Feb 22 23:53:57 2021 -0800 ++++ b/src/wofi.c Wed Aug 11 13:49:13 2021 -0300 +@@ -881,12 +881,15 @@ + } + + void wofi_term_run(const char* cmd) { ++ char *shell = getenv("SHELL"); ++ if (!shell) shell = "sh"; ++ + if(terminal != NULL) { +- execlp(terminal, terminal, "-e", cmd, NULL); ++ execlp(terminal, terminal, "-e", shell, "-c", cmd, NULL); + } + size_t term_count = sizeof(terminals) / sizeof(char*); + for(size_t count = 0; count < term_count; ++count) { +- execlp(terminals[count], terminals[count], "-e", cmd, NULL); ++ execlp(terminals[count], terminals[count], "-e", shell, "-c", cmd, NULL); + } + fprintf(stderr, "No terminal emulator found please set term in config or use --term\n"); + exit(1); \ No newline at end of file diff --git a/home/features/desktop/wayland-wm/wofi.nix b/home/features/desktop/wayland-wm/wofi.nix new file mode 100644 index 0000000..742d1ba --- /dev/null +++ b/home/features/desktop/wayland-wm/wofi.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: { + programs.wofi = { + enable = true; + package = pkgs.wofi.overrideAttrs (oa: { + patches = (oa.patches or [ ]) ++ [ + ./wofi-run-shell.patch # Fix for https://todo.sr.ht/~scoopta/wofi/174 + ]; + }); + settings = { + image_size = 48; + columns = 3; + allow_images = true; + insensitive = true; + run-always_parse_args = true; + run-cache_file = "/dev/null"; + run-exec_search = true; + }; + }; +} \ No newline at end of file