From ea076bca3dc20be2d47ee99bd52e584925fd83c0 Mon Sep 17 00:00:00 2001 From: Arrow-x Date: Fri, 3 Nov 2023 17:14:13 +0100 Subject: [PATCH 1/2] allow menu in confic --- waldl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/waldl b/waldl index 4d28621..85b7d16 100755 --- a/waldl +++ b/waldl @@ -32,9 +32,6 @@ quality=large # atleast : least res atleast=1920x1080 -# allow the user to customize the defaults -[ -e "$HOME/.config/waldlrc" ] && . "$HOME/.config/waldlrc" - # the menu command used when no query is provided sh_menu () { : | dmenu -p "search wallhaven:" @@ -42,6 +39,10 @@ sh_menu () { # rofi -dmenu -l 0 -p "search wallpapers" } +# allow the user to customize the defaults +[ -e "$HOME/.config/waldlrc" ] && . "$HOME/.config/waldlrc" + + ########################## ## getting search query ## ########################## From 8e17ea41ec9d5025ffab59aac6a5c6408b96a838 Mon Sep 17 00:00:00 2001 From: Arrow-x Date: Mon, 6 Nov 2023 16:15:07 +0100 Subject: [PATCH 2/2] make the command just a variable and use eval --- waldl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/waldl b/waldl index 85b7d16..93ff6c6 100755 --- a/waldl +++ b/waldl @@ -31,17 +31,15 @@ sorting=relevance quality=large # atleast : least res atleast=1920x1080 - # the menu command used when no query is provided -sh_menu () { - : | dmenu -p "search wallhaven:" - # ROFI: comment the previous line and uncomment the next line for rofi - # rofi -dmenu -l 0 -p "search wallpapers" -} +menu_command="rofi -dmenu -l 0 -p 'search wallpapers'" # allow the user to customize the defaults [ -e "$HOME/.config/waldlrc" ] && . "$HOME/.config/waldlrc" +sh_menu () { + eval "$menu_command" +} ########################## ## getting search query ##