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

@@ -27,7 +27,7 @@ PACKAGES=(
neomutt telegram-desktop # communication
greetd sway swaybg swayidle # desktop basic
alacritty bemenu-wayland i3blocks mako libnotify # terminals, ui
alacritty wmenu i3blocks mako libnotify # terminals, ui
wev wl-clipboard wtype slurp grim # interaction
ttf-roboto ttf-roboto-mono otf-font-awesome # fonts
kvantum kvantum-qt5 kvantum-theme-materia materia-gtk-theme # themes

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/')

View File

@@ -1,24 +0,0 @@
#!/bin/sh
export BEMENU_OPTS="\
--ignorecase \
--width-factor 0.5 \
--fn \"{{ .theme.font.name_mono }} {{ math.Add .theme.font.size_base_pt .theme.font.size_step_pt }}\" \
--list 500 \
--border 2 \
--scrollbar autohide \
--border-radius 4 \
--bdr #{{ .theme.color.fg_accent }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} \
--scf #{{ .theme.color.fg_accent }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} \
--scb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--nb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--ab #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--hb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--fb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--tb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--nf #{{ .theme.color.fg }} \
--af #{{ .theme.color.fg }} \
--cf #{{ .theme.color.fg }} \
--hf #{{ .theme.color.fg_accent }} \
--tf #{{ .theme.color.fg_accent }} \
--ff #{{ .theme.color.fg_accent }} \
"

View File

@@ -1 +1 @@
pinentry-program ~/.local/bin/bemenu/pinentry.sh
pinentry-program ~/.local/bin/menu/pinentry.sh

View File

@@ -0,0 +1,15 @@
#!/bin/sh
export WMENU_VOPTS="\
-i \
-f '{{ .theme.font.name_mono }} {{ math.Add .theme.font.size_base_pt .theme.font.size_step_pt }}' \
-n {{ .theme.color.fg }} -N {{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
-m {{ .theme.color.fg_accent }} -M {{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
-s {{ .theme.color.fg_accent }} -S {{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
"
export WMENU_HOPTS="\
-i \
-f '{{ .theme.font.name_mono }} {{ math.Add .theme.font.size_base_pt .theme.font.size_step_pt }}' \
-n {{ .theme.color.fg }} -N {{ .theme.color.bg }} \
-m {{ .theme.color.fg_accent }} -M {{ .theme.color.bg }} \
-s {{ .theme.color.fg_accent }} -S {{ .theme.color.bg }} \
"

View File

@@ -25,6 +25,8 @@ set keymap vi-command
"n":backward-char
"\C-n":backward-char
# e -> k (reverse swap)
set keymap vi-insert
"\C-e":"\C-j"
set keymap vi-command
"e":previous-history
"\C-e":kill-line

View File

@@ -188,11 +188,11 @@ bindsym --to-code {
XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5% && pkill -SIGRTMIN+2 i3blocks
XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5% && pkill -SIGRTMIN+2 i3blocks
XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle && pkill -SIGRTMIN+2 i3blocks
XF86Calculator exec .local/bin/bemenu/run-calc.sh calc tui
XF86Calculator exec .local/bin/menu/run-calc.sh calc tui
# basic scripts
$mod+Return exec alacritty msg create-window
$mod+Colon exec ~/.local/bin/sway/command-mode.sh
$mod+Space exec ~/.local/bin/bemenu/run.sh
$mod+Space exec ~/.local/bin/menu/run.sh
}
##############################################

View File

@@ -48,7 +48,7 @@ mkdir -p "${USER_DIRS[@]}"
########## scripts #############
cp -rf bin/* ~/.local/bin
LN_EXCLUDE_DIRS=(i3blocks bemenu sway)
LN_EXCLUDE_DIRS=(i3blocks menu sway)
ln_exclude_dirs_cmp=" ${LN_EXCLUDE_DIRS[*]} "
for sdir in bin/*; do
@@ -93,5 +93,6 @@ export IS_COMPAT=0
###############################
swaymsg reload || true
. ~/.profile
echo ok