From 6deb7a6fb6a7248583cf9814282a17c0385162b0 Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Mon, 12 Apr 2021 16:43:12 +0100 Subject: fix dmount completion --- bin/dmount | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/dmount b/bin/dmount index 457e189..794de4f 100755 --- a/bin/dmount +++ b/bin/dmount @@ -7,6 +7,12 @@ use Try::Tiny; use List::Util 'uniq'; use Net::DBus; +# you probably want /etc/udev/rules.d/88-udisks2.rules with: +# +# SUBSYSTEM=="block", ENV{UDISKS_FILESYSTEM_SHARED}="1" +# +# so everything is mounted under /media instead of /run/media/$USER/ + my $bus = Net::DBus->system(); my $srv = $bus->get_service('org.freedesktop.UDisks2'); my $ud = $srv->get_object('/org/freedesktop/UDisks2/Manager'); @@ -54,7 +60,7 @@ elsif ($ARGV[0] eq '--list') { elsif ($ARGV[0] eq '--bashcomp') { print <<"EOF"; _dmount_list() { - COMPREPLY=( \$($cmd --list) ) + COMPREPLY=( $( compgen -W '\$($cmd --list)' -- "\$2" ) ) } complete -F _dmount_list $cmd -- cgit v1.2.3