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