#!/usr/bin/env fish # wrapper around bemenu # bmenu * - use as dmenu, -p for custom prompt (man bemenu) # bmenu run - select from .desktop files and run it # bmenu start - internal option if test "$argv[1]" = "run" test -n "$argv[2]" && set t "$argv[2]" || set t "terminal" set -l launcher_args \ --dmenu="bmenu start -p Iniciar:" \ --term "$t" \ --no-generic if test -n "$SWAYSOCK" set launcher_args $launcher_args --i3-ipc end exec j4-dmenu-desktop $launcher_args end if test -n "$SWAYSOCK" swaymsg -t get_outputs | jq -r 'map(.focused)|reverse|index(true)' | read focused_output test -n "$focused_output" and set focused_output "-m $focused_output" else if test -n "$NIRI_SOCKET" set -l focused_name (niri msg -j focused-output | jq -r '.name') set -l focused_index (niri msg -j outputs | jq -r --arg focused "$focused_name" 'keys | index($focused)') if test -n "$focused_index"; and test "$focused_index" != "null" set focused_output "-m $focused_index" end end set -l config "$HOME/.config/bmenu.conf" if test -f $config source $config end exec dhist wrap -- bemenu \ $focused_output\ --ignorecase\ --border 2\ --center\ --width-factor 0.5\ --no-overlap\ --list 30\ --prefix '>'\ --bdr "$bdr"\ --fn "$fn"\ --tb "$tb" --tf "$tf" \ --fb "$fb" --ff "$ff" \ --nb "$nb" --nf "$nf" \ --ab "$ab" --af "$af" \ --hb "$hb" --hf "$hf" \ $argv # vim: ft=fish