I have tried messing around with a script that sets my display resolutions as i use my laptop with different setups of external monitors. also to learn bash i suppose.
now, i have a associative array with all my monitors configured as keys, and expected resolution as value.
declare -A known_monitor
known_monitor[Virtual1]=1920x1200
known_monitor[Virtual2]=1400x1050
Known_monitor[eDP-1]=2560x1440
when i try to access the monitors like this:
for monitor in "${monitors[@]}"
do
echo ------------------
echo $monitor
echo ${known_monitor[$monitor]}
echo ------------------
done
I see the $monitor value, but the "known_monitor" is empty.
------------------
eDP-1
------------------
I have tried moving parantheses around and adding citation marks, but nothing seems to work.
Any advice would be helpful, Thanks in advance!