In Ubuntu-beased systems:
sudo apt-get install disper
In Arch-based systems it is in AUR.
Various commands available with this utility HERE.
The command to cycle between clone, extended, internal and external displays should be like this:
disper --cycle-stages='-e : -c : -S : -s' --cycle
In that case, it would extend to the right. To cycle between the same options but extend to the left:
disper --direction=left --cycle-stages='-e : -c : -S : -s' --cycle
Disper will detect displays and use the maximal resolutions by default.
The command can be then associated to a short-key. To add that, go to System>Control Center>Keyboard Shortcuts, Add.