Files
colorshell/hypr/scripts/get-dmenu.sh
T
2025-05-15 18:11:50 -03:00

27 lines
579 B
Bash

#!/usr/bin/env bash
# Checks environment for dmenu or dmenu-like apps
# and prints out a command to pipe of.
# -----------
# Licensed under the MIT License
# Made by retrozinndev (João Dias)
# From: https://github.com/retrozinndev/colorshell
DMENUS=(
"anyrun:--plugins:libstdin.so"
"rofi:-dmenu"
"wofi:--show:dmenu"
"dmenu"
)
for dmenu in ${DMENUS[@]}; do
name=$(printf "$dmenu" | awk -F: '{ print $1 }')
cmd=$(env "$name" -h > /dev/null)
code=$?
if [[ ! $code == 127 ]]; then
echo "$dmenu" | sed 's/:/ /g'
break;
fi
done