diff options
author | Vicente Reyes | 2019-09-05 16:01:20 -0400 |
---|---|---|
committer | Vicente Reyes | 2019-09-05 16:01:20 -0400 |
commit | c76cfa6457612208b7093d11402a10eafc7ae534 (patch) | |
tree | 9beaf4e735f7f40d1324cdccceda9b1520b759b7 /atool-desktop | |
parent | 7b196f622f4e9e58b7ff0fc5845b86f6b0471f44 (diff) | |
download | aur-c76cfa6457612208b7093d11402a10eafc7ae534.tar.gz |
use dmenu-based GUI instead
Diffstat (limited to 'atool-desktop')
-rwxr-xr-x | atool-desktop | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/atool-desktop b/atool-desktop index 09ae295256f5..616ea93be1a8 100755 --- a/atool-desktop +++ b/atool-desktop @@ -1,30 +1,26 @@ #!/bin/sh -e -askyn() ( +choose() { + awk ' + BEGIN { print "."; print ".." } + /[/@]$/ { print substr($0, 1, length-1) } + ' | dmenu -i -p "$(pwd)/" +} + +askdir() { while : do - printf '%s' "$@" ' ' - read answer - case "$answer" in - y) - return 0 - ;; - n) - return 1 - ;; - esac + outdir=$(/bin/ls -F | choose) + if [ "$outdir" = "." ]; then + return 0 + fi + cd "$outdir" done -) - -echo "Directory where extracted files will be stored:" -pwd +} for i in "$@" do - als "$i" - if askyn 'Do you want to extract this archive? [y/n]' - then - aunpack "$i" - fi + askdir $(pwd) + aunpack "$i" done |