fix wdmenu arguments

This commit is contained in:
lelgenio 2020-11-16 10:17:10 -03:00
parent c3acd8f092
commit b734408012
4 changed files with 15 additions and 7 deletions

View File

@ -35,14 +35,21 @@ map global find 'r' ': find_ripgrep<ret>' -docstring 'ripgrep all file'
map global find 'g' ': find_git_file<ret>' -docstring 'git files'
map global find 'c' ': find_dir<ret>' -docstring 'change dir'
map global find 'b' ': find_buffer<ret>' -docstring 'find buffer'
map global find 'd' ': find_delete<ret>' -docstring 'file to delete'
define-command -hidden find_file \
%{ edit -existing %sh{
test "$PWD" -eq "$HOME" || args="-H"
test "$PWD" -ne "$HOME" && args="-H"
fd -tf "$args" | sed "/.git\//d" | wdmenu
} }
define-command -hidden find_delete \
%{ nop %sh{
test "$PWD" -ne "$HOME" && args="-H"
fd -tf "$args" | sed "/.git\//d" | wdmenu | xargs trash
} }
define-command -hidden find_git_file \
%{ edit -existing %sh{ git ls-files | wdmenu } }
@ -56,8 +63,9 @@ define-command -hidden find_buffer \
define-command -hidden find_ripgrep \
%{ eval %sh{
rg -n . | wdmenu |
perl -ne 'print "edit \"$1\" \"$2\" " if /(.+):(\d+):/'
patter=$( wdmenu -p "Regex")
rg --column -n "$patter" | wdmenu |
perl -ne 'print "edit \"$1\" \"$2\" \"$3\" " if /(.+):(\d+):(\d+):/'
} }

View File

@ -1,7 +1,7 @@
#!/bin/sh
opts="Fone\nSpeaker\nHDMI"
out=$(printf $opts | wdmenu -p "Saida:")
out=$(printf $opts | wdmenu -p "Output")
vol=$(pamixer --get-volume)
if [ "$out" = "HDMI" ]

View File

@ -4,10 +4,10 @@ test -n "$SWAYSOCK" && swaymsg fullscreen off > /dev/null
# {%@@ if launcher == "wofi" @@%} #
which wofi &> /dev/null &&
exec wofi -d $argv
exec wofi -d $@
# {%@@ else @@%} #
which bemenu &> /dev/null &&
exec bmenu $argv
exec bmenu $@
# {%@@ endif @@%} #
notify-send "Error" "Launcher program missing"

View File

@ -25,7 +25,7 @@ main() {
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
entry=`printf '%s\n' "${password_files[@]}" | "$dmenu" -p Password $@`
entry=`printf '%s\n' "${password_files[@]}" | "$dmenu" -p "Password" $@`
[ -n "$entry" ] || exit