From 609324236a82d2cd21ecb5907c27e88ab2b7d459 Mon Sep 17 00:00:00 2001 From: q3aql Date: Thu, 14 Jul 2022 09:17:56 +0200 Subject: [PATCH] Fix error when cancel selection (dmenu_drun) --- dmenu_drun | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dmenu_drun b/dmenu_drun index ad3abfa..3910552 100755 --- a/dmenu_drun +++ b/dmenu_drun @@ -4,7 +4,7 @@ # dmenu_drun - dmenu script that simulates 'rofi -show drun' # # # # Author: q3aql # -# Last update: 10-07-2022 # +# Last update: 14-07-2022 # ############################################################## # Configuration variables @@ -95,11 +95,13 @@ load_theme create_list_files list_output=$(list_desktop_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " drun:") run_output=$(echo ${list_output} | cut -c 5-999) -if [ "${run_output}" == "Scan New Desktop Files" ] ; then - echo "0" > ${HOME}/.dmenu/read_list - create_list_files - $0 -else - run_desktop_file=$(cat "${load_desktop_files}/${run_output}") - ${runDesktop} "${run_desktop_file}" +if [ ! -z "${run_output}" ] ; then + if [ "${run_output}" == "Scan New Desktop Files" ] ; then + echo "0" > ${HOME}/.dmenu/read_list + create_list_files + $0 + else + run_desktop_file=$(cat "${load_desktop_files}/${run_output}") + ${runDesktop} "${run_desktop_file}" + fi fi