diff --git a/skel/disp b/skel/disp index 0a9af27..f91eb2a 100644 --- a/skel/disp +++ b/skel/disp @@ -115,7 +115,14 @@ _xrandr() { xrandr "$@" } _list_arandr() { - test -d "$ARANDR_FOLDER" || return + [[ -d "$ARANDR_FOLDER" ]] || { + _arandr_empty + return + } + [[ $(ls -A "$ARANDR_FOLDER") ]] || { + _arandr_empty + return + } ls "$ARANDR_FOLDER" | head -n 6 | awk '{printf(" %d %s\n", NR+3, $0) }' } _run_arandr_script() { @@ -125,6 +132,9 @@ _run_arandr_script() { sh -x "$ARANDR_FOLDER/$script_name" } } +_arandr_empty() { + echo " [No arandr scripts]" +} _help() { echo 'DISPtool @@ -144,7 +154,7 @@ _help() { Second argument to any previous sets the gamma correction value Configuration file: '$CONFIG' - Display settings saved with arandr are displayed last: + Display settings saved with arandr are displayed last ' _list_arandr exit @@ -164,7 +174,8 @@ i=$1 if [ -z "$1" ]; then echo "Currently connected displays:" xrandr | grep --color=always -e ".* connected" -e '.*\*' | awk '{ print $1,$2,$3} ' - echo 'Menu choices: + + echo 'See further help by running with argument: -h 0 Run "arandr" to setup manually 1 Main display only ('$MAIN') @@ -173,9 +184,7 @@ if [ -z "$1" ]; then a All displays on s Create and edit configuration '$CONFIGURED' - See further help by running with argument: -h - Settings from arandr: - ' + Settings by arandr:' _list_arandr read -N 1 i echo ""