#!/bin/bash layouts=("$(ls "$HOME/.screenlayout/")") add="add layout..." layouts+=("$add") choice=$(printf '%s\n' "${layouts[@]}" | dmenu -i -p 'Choose a screenlayout:') || exit 0 if [ "$choice" = "$add" ] then arandr & exit 0 fi exec "$HOME/.screenlayout/$choice"