some new tweaks

This commit is contained in:
Never Gude 2026-01-28 00:57:01 +01:00
parent f541e725d9
commit 01df064f68
9 changed files with 85 additions and 9 deletions

View file

@ -7,10 +7,26 @@ abbr --add adl album-dl.fish
abbr --add vv nvim
abbr --add tr gio trash
function mvi
function alacritty
command alacritty msg create-window $argv
end
function mvi --description 'Launches mpv with mvi configuration'
mpv --config-dir=$HOME/.config/mvi/ $argv
end
function open --description 'Opens a file in its default application'
argparse h/help -- $argv
or return
if set -ql _flag_help
echo "open [-h|--help] [STRING]"
return 0
end
niri msg action spawn -- xdg-open $argv
end
# BEGIN opam configuration
# This is useful if you're using opam as it adds:
# - the correct directories to the PATH

View file

@ -1,11 +1,25 @@
function menu --description 'Opens a menu of a list of Strings and writes the result to stdout'
argparse h/help -- $argv
argparse h/help p/prompt=? index -- $argv
or return
if set -ql _flag_help
echo "menu [-h|--help] [STRING ...]"
echo "menu [-h|--help] [-p|--prompt=?] [--placeholder] [--index] [STRING ...]"
return 0
end
string join -- \n $argv | fuzzel --dmenu -l (count $argv) || exit 0
set fuzzel_args
if set -ql _flag_prompt
set -a fuzzel_args "--prompt=$_flag_prompt"
end
if set -ql _flag_placeholder
set -a fuzzel_args "--placeholder=$_flag_placeholder"
end
if set -ql _flag_index
set -a fuzzel_args "--index"
end
string join -- \n $argv | fuzzel --dmenu -l (count $argv) $fuzzel_args || exit 0
end

View file

@ -0,0 +1,25 @@
function prompt --description 'Opens a menu of a list of Strings and writes the result to stdout'
argparse h/help p/prompt=? placeholder=? password -- $argv
or return
if set -ql _flag_help
echo "menu [-h|--help] [-p|--prompt=?] [--placeholder=?] [--password] [STRING ...]"
return 0
end
set fuzzel_args
if set -ql _flag_prompt
set -a fuzzel_args "--prompt=$_flag_prompt"
end
if set -ql _flag_placeholder
set -a fuzzel_args "--placeholder=$_flag_placeholder"
end
if set -ql _flag_password
set -a fuzzel_args "--password=●"
end
string join -- \n $argv | fuzzel --dmenu --prompt-only='' $fuzzel_args || exit 0
end