bemenu -> wmenu

This commit is contained in:
2025-10-25 23:30:01 +00:00
parent 67a6e5fa53
commit dc4de3e6b8
19 changed files with 40 additions and 41 deletions

View File

@@ -0,0 +1,2 @@
#!/bin/sh
eval "wmenu $WMENU_HOPTS \"$@\""

View File

@@ -8,13 +8,13 @@
#exec 2>/tmp/pinentry.log
#set -x
############################### PATCH #################################
. ~/.config/menu/env.sh
#######################################################################
VERSION='1.0'
FLAVOR='bash'
############################### PATCH #################################
. ~/.config/bemenu/env.sh
#######################################################################
keyinfo=''
error=''
timeout=0
@@ -125,9 +125,8 @@ cmd_getpin()
output="$(
echo -n "|"
############################### PATCH #################################
bemenu \
--password indicator \
--prompt "${prompt:-$def_prompt}" \
~/.local/bin/menu/horizontal.sh \
-Pp "${prompt:-$def_prompt}" \
</dev/null | tr -d '\n'
ret=${PIPESTATUS[0]}
# yad \

View File

@@ -1,9 +1,9 @@
#!/bin/bash
rl_full="$(cat "$HOME/.config/bemenu/"*.runlist)"
rl_full="$(cat ~/.config/menu/*.runlist)"
rl="$(echo "$rl_full" | cut -d' ' -f2-)"
inp="$(echo "$rl" | bemenu --prompt ">")"
inp="$(echo "$rl" | ~/.local/bin/menu/vertical.sh -p ">")"
[ -z "$inp" ] && exit 0
eval "inp_arr=($inp)"
@@ -18,5 +18,5 @@ case "$exectr" in
exec) exec $inp;;
float-sh) exec alacritty msg create-window --class="term_float" --working-directory="$HOME" --command "$SHELL" -c "($inp)";;
float-sh-keep) exec alacritty msg create-window --class="term_float" --working-directory="$HOME" --command "($inp); read -n1";;
*) exec bash "$HOME/.local/bin/bemenu/run-$exectr.sh" "${inp_arr[@]}"
*) exec bash "$HOME/.local/bin/menu/run-$exectr.sh" "${inp_arr[@]}"
esac

4
arch-user/bin/menu/vertical.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
input=$(cat)
lines=$(echo "$input" | wc -l)
echo "$input" | eval "wmenu $WMENU_VOPTS -l $((lines < 50 ? lines : 50)) \"$@\""

View File

@@ -1,6 +1,6 @@
#!/bin/bash
out="$(printf '' | bemenu --prompt ':sway')"
out="$(printf '' | ~/.local/bin/menu/horizontal.sh -p ':sway')"
eval "executor_args=($out)"
#shellcheck disable=SC2154
sway "${executor_args[@]}"

View File

@@ -41,7 +41,7 @@ formatted_list=$(echo "$window_list" | while IFS='|' read -r id app_id name work
printf "%s%s%s %s %s\n" "$workspace" "$indicator" "$id" "$app_id" "$name"
done)
selection=$(echo "$formatted_list" | bemenu --auto-select --width-factor 100 --prompt "/" --index "$(echo "$formatted_list" | awk 'substr($0,2,1)==">" {print NR-1}')" )
selection=$(echo "$formatted_list" | ~/.local/bin/menu/vertical.sh -p "/")
[ -z "$selection" ] && exit 0
window_id=$(echo "$selection" | sed -E 's/^...([0-9]+).*/\1/')