Add possibility to use alternative path

This commit is contained in:
Isak Ellmer 2025-04-15 15:46:12 +02:00
parent fc69aa6e2b
commit 5fa012f9ad
4 changed files with 13 additions and 3 deletions

View file

@ -10,7 +10,7 @@
#include "xdg-activation-v1-client-protocol.h"
static void read_items(struct menu *menu) {
char *path = strdup(getenv("PATH"));
char *path = menu->path ? strdup(menu->path) : strdup(getenv("PATH"));
for (char *p = strtok(path, ":"); p != NULL; p = strtok(NULL, ":")) {
DIR *dir = opendir(p);
if (dir == NULL) {