#!/bin/bash

if command -v dmenu-frecency; then
    exec dmenu-frecency
elif command -v j4-dmenu-desktop && command -v rofi; then
    exec j4-dmenu-desktop --usage-log=~/.cache/j4-usage.log --dmenu='rofi -dmenu -i'
elif command -v j4-dmenu-desktop; then
    exec j4-dmenu-desktop --usage-log=~/.cache/j4-usage.log
else
    exec i3-dmenu-desktop
fi

#!/bin/bash

command -v j4-dmenu-desktop && exec j4-dmenu-desktop || exec i3-dmenu-desktop

--- 
+++ 
@@ -1,11 +1,3 @@
 #!/bin/bash
 
-if command -v dmenu-frecency; then
-    exec dmenu-frecency
-elif command -v j4-dmenu-desktop && command -v rofi; then
-    exec j4-dmenu-desktop --usage-log=~/.cache/j4-usage.log --dmenu='rofi -dmenu -i'
-elif command -v j4-dmenu-desktop; then
-    exec j4-dmenu-desktop --usage-log=~/.cache/j4-usage.log
-else
-    exec i3-dmenu-desktop
-fi
+command -v j4-dmenu-desktop && exec j4-dmenu-desktop || exec i3-dmenu-desktop
Add optional support for dmenu-frecency and rofi
