You can use PyQGIS:
layerlist = []
for lyr in QgsProject().instance().mapLayers().values(): #For every layer added to the map
if lyr.geometryType()==1: #1 is line, 2 polygon, 0 point
layerlist.append(lyr) #If the geometrytype is 1, then append the layer to layerlist
processing.runAndLoadResults("native:mergevectorlayers", {'LAYERS':layerlist,'CRS':None,'OUTPUT':'TEMPORARY_OUTPUT'})
And if you want to you can automate the merging by grouping the geometry types using collections.defaultdict(list):
from collections import defaultdict as dd
list_them = dd(list)
numtoname = {0:'points', 1:'lines', 2:'polygons'}
for lyr in QgsProject().instance().mapLayers().values():
list_them[numtoname[lyr.geometryType()]].append(lyr)
for geomtype, layerlist in list_them.items():
print(geomtype)
print(layerlist)
processing.runAndLoadResults("native:mergevectorlayers", {'LAYERS':layerlist,'CRS':None,'OUTPUT':'TEMPORARY_OUTPUT'})