Text this: Realizing triality and $p$-ality by lattice twisted gauging in (1+1)d quantum spin systems