#!/bin/bash # In case you've ever needed to setup output=$(xrandr|grep ' connected'|awk '{print $1}' | \ dmenu -i -p 'Device to attach') [ -z "$output" ] && exit 0 # Now we pick out where this goes side=$(printf 'left-of\nright-of\nabove\nbelow' | \ dmenu -i -p 'Side') [ -z "$side" ] && exit 0 # Just echo for demonstrative purposes echo "xrandr --output $output --auto --$side eDP-1"