As part of a script I need something that will change to a specific directory, Launch Konsole, then issue a command.
git clone https://github.com/endeavouros-team/PKGBUILDS.git
konsole --noclose -e ls -l
This changes directories, downloads the files, opens a konsole window, and does perform the ls -l command, but it does not give me a prompt or cursor. The window is useless at this point and I have to close the window. I need the konsole window left operational for more commands. namely makepkg.
One site I visited suggested putting a & and the end of the konsole command. It didn’t help.
Have you tried this:
konsole -e /bin/bash --rcfile <(echo "ls -l")
If you also want .bashrc file to be loaded,
cat it before using your command in
konsole -e /bin/bash --rcfile <(cat ~/.bashrc; echo "ls -l")
can use dbus
qdbus org.kde.Klauncher5 /kLauncher exec_blind "/usr/bin/konsole" ""
ID=$(qdbus | grep org.kde.konsole -m1)
qdbus $ID /Sessions/1 sendText "#hello
Deep in my memory, something is saying you cannot cd in a script.
Works fine, but returns to the original directory.
I may have got this wrong - but it sounds like you just want to open a Konsole in a particular location and then want to type in commands in that Konsole. I would lose the
This works for me
[daab@ryzen7 ~]$ (cd /tmp; konsole --noclose) >& /dev/null &
What I understand from original post is that they want to open Konsole, run a command and then have Konsole open interactively.
-e is calling to run
/bin/bash, which is using a customized rcfile that has the command they want to run on Konsole startup.
Just having Konsole open at a particular location is pretty simple and intuitive indeed. Let’s see what @Pudge wanted
That is exactly correct in what I wanted. However, there doesn’t seem to be a simple straight forward way to do this. In favor of KISS I have done things a little differently.
Thanks to all who replied.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.