File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -56,18 +56,11 @@ sndev__start() {
5656}
5757
5858sndev__dmenu_profile () {
59- # dmenu allows to select multiple profiles with CTRL+Enter
60- # in which case it will immediately write the selected profile to stdout
61- # so we loop over each line of the output and add each profile to an array
62- # to make sure we don't add duplicates
59+ # dmenu allows to select multiple profiles with CTRL+Enter in which case it will
60+ # immediately write the selected profile to stdout even if it was already selected
61+ # so we use sort+uniq to remove duplicates
6362 profiles=" minimal payments wallets email search images capture"
64- selected=()
65- while read -r sel; do
66- if [[ ! " ${selected[*]} " =~ " ${sel} " ]]; then
67- selected+=(" $sel " )
68- fi
69- done < <( echo " $profiles " | tr ' ' ' \n' | dmenu)
70- printf ' %s,' " ${selected[@]} " | sed ' s/,$//'
63+ echo " $profiles " | tr ' ' ' \n' | dmenu | sort | uniq | tr ' \n' ' ,' | sed ' s/,$//'
7164}
7265
7366sndev__help_start () {
You can’t perform that action at this time.
0 commit comments