Let G be a reductive group over a number field F , which is split at a finite place p of F , and let π be a cuspidal automorphic representation of G, which is cohomological with respect to the trivial coefficient system and Steinberg at p. We use the cohomology of p-arithmetic subgroups of G to attach automorphic L-invariants to π. This generalizes a construction of Darmon (respectively Spieß), who considered the case G = GL 2 over the rationals (respectively over a totally real number field). These L-invariants depend a priori on a choice of degree of cohomology, in which the representation π occurs. We show that they are independent of this choice provided that the π-isotypical part of cohomology is cyclic over Venkatesh's derived Hecke algebra. Further, we show that automorphic L-invariants can be detected by completed cohomology. Combined with a local-global compatibility result of Ding it follows that for certain representations of definite unitary groups the automorphic L-invariants are equal to the Fontaine-Mazur L-invariants of the associated Galois representation.