konsole -e /path/to/script?ls > logfile.log will write the output of ls command to logfile.log
konsole -e function_namekonsole -e "bash -c $(comfyinit)" should work?$() is only used to get whatever something in bash prints to stdin#!/bin/bash
# activate the venv
source venv/bin/activate
# start comfyui
python3 main.py#!/bin/bash
exec konsole -e /path/to/script #!/bin/bash
comfyinit () {
# activate the venv
source venv/bin/activate
# start comfyui
python3 main.py
}
exec konsole -e $(comfyinit)$()