I am currently able to temporarily switch my keyboard layout from US to Danish while holding caps, and toggle permanently using alt+space, with the following command:
setxkbmap -option "grp:caps_switch,grp:alt_space_toggle" -layout "us,dk"
However, I would like to also be able to switch to Greek layout by holding another modifier, preferably AltGR (my physical keyboard layout is Danish, so it has AltGr), but I can't find a way to do it using
setxkbmap. It seems like the
grp:*_switch options always switch between the first two layouts. Is this even possible with
setxkbmap? Or is there some other tool that will allow me to do it?
Edit: Since what I want doesn't seem to be possible with existing tools, I instead created a custom keyboard layout that has both the Greek letters and the Danish special letters on the 3rd and 4th layers (normally accessed with AltGr and AltGr+shift). I then assigned both caps lock and AltGr as 3rd layer modifiers. This solution was only possible because there happened to be no overlap between the Danish and Greek keys that I needed so I could fit them on the same layer. If anyone is reading this and wants to be able to switch between three different full layouts, I think that would also be possible by adding a 5th keyboard layer.