From 855f8402c6e15bd212c23f462e2eb86d7e879e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20Wi=C3=9Fmann?= Date: Thu, 17 Sep 2015 10:26:04 +0200 Subject: [PATCH] open_download: Warn if download dir is empty --- misc/userscripts/open_download | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/misc/userscripts/open_download b/misc/userscripts/open_download index 4bd22455e..fa3e98675 100755 --- a/misc/userscripts/open_download +++ b/misc/userscripts/open_download @@ -82,6 +82,12 @@ ls-files() { mapfile -t entries < <(ls-files) +# we need to manually check that there are items, because rofi doesn't show up +# if there are no items and -no-custom is passed to rofi. +if [ "${#entries[@]}" -eq 0 ] ; then + die "Download directory »${DOWNLOAD_DIR}« empty" +fi + line=$(printf "%s\n" "${entries[@]}" \ | crop-first-column 55 \ | column -s $'\t' -t \