How to launch a KDE konsole with multiple tabs running various progs?

后端 未结 4 1636
别那么骄傲
别那么骄傲 2021-02-13 05:24

I know how to start a Konsole with one executable running in it, and leave the Konsole open after the program ends. I can do this using a .desktop file and change s

4条回答
  •  死守一世寂寞
    2021-02-13 06:09

    I did some more digging and found and even more "subjectively" beautiful answer. Goal: start empty shell, music player and screen session running irssi in 3 different tabs in konsole:

    1. Create a simple, executable script file with:

    #!/bin/bash konsole --hold --new-tab & konsole --hold --new-tab -e $SHELL -c "/usr/bin/screen -DRS irssi-in-screen irssi" & konsole --hold --new-tab -e $SHELL -c "/usr/bin/ncmpcpp" &

    The clue is not to execute the the command directly but to call a shell, that can take in all arguments passed. $SHELL is set to /bin/bash. This "issue" is documented here:

    https://docs.kde.org/stable5/en/applications/konsole/commonissues.html

    Quote: " Konsole treats arguments after the -e option as one command and runs it directly, instead of parsing it and possibly dividing it into sub-commands for execution. This is different from xterm.

    konsole -e "command1 ; command2" does not work
    
    konsole -e $SHELL -c "command1 ; command2" works
    

提交回复
热议问题