Using Konsole, how to open a folder in Dolphin, then, automatically, Konsole returns to its command line?

ok, wow - I don’t understand why you’d use KDE and have Dolphin as a flatpak - sorry; missed that part.

The following script will open my Konsole, run the command, and if I don’t ‘hold’ it open, the konsole closes when done with a slight 10 sec delay whilst also launching Marktext.

#!/bin/bash

commands() {

    date +"It's now %R" | cowthink
    echo "How's it going?"
    read HOW && sleep 3
    echo 'Youre' $HOW ' - and Im' $HOW | cowsay
    sleep 2
    clear
    cowsay 'Goodbye then!'
flatpak run com.github.marktext.marktext
}

export -f commands

konsole -e "bash -c 'commands'"
sleep 10

Why make life so complicated?

konsole -e /bin/bash -c 'flatpak run org.kde.dolphin & exec /usr/bin/zsh'

How’s that one?

1 Like

@ben2talk I enjoyed your humour in this shebang script. LOL :slight_smile: Unfortunately, this flies 37,000 feet above my present skills. For information, I’m a Dolphin and Konsole end-user. Not a software engineer.


konsole -e /bin/bash -c 'flatpak run org.kde.dolphin & exec /usr/bin/zsh'

How’s that one?

I tried just now. This happened:

  1. Konsole succesfully opens
  2. Konsole displays this:

    kf.config.core: Watching absolute paths is not supported “/usr/share/color-schemes/BreezeDark.colors”

  3. Dolphin does not open
  4. End

I’m assuming that you meant this in my case:

#!/bin/bash
flatpak run org.kde.konsole -e /bin/bash -c 'flatpak run org.kde.dolphin & exec <ABSOLUTE PATH TO FOLDER>'

Reminder that the device I need this for is GNOME with Wayland, with both Dolphin and Konsole installed and used as Flatpak.

In other words, using:

Details about this in my original post above at https://discuss.kde.org/t/using-konsole-how-to-open-a-folder-in-dolphin-then-automatically-konsole-returns-to-its-command-line/28830#p-82055-steps-to-reproduce-2

If I execute konsole -e /bin/bash -c 'flatpak run org.kde.dolphin & exec /usr/bin/zsh' as is. It displays this error message:

bash: konsole : commande introuvable

Which translates to it can’t find the command konsole

Obviously not - but you’ll find everyone here uses KDE Plasma, so doing this stuff on a Gnome desktop is gonna be completely different.

I’m not sure that Konsole is the best fit for a Gnome environment, any more than Dolphin is.

On KDE

kstart dolphin <your directory>

Opens dolphin as a child of the desktop (and not of your console process, so closing the terminal window won’t close it).
Isn’t there a similar command for Gnome?

1 Like

I’ve checked your updated post but it does not include any new info on why the Konsole is needed.

However, it still has

Konsole either returns to its command prompt or Konsole automatically closes itself. Either way would be success for me

If “automatically closes” is a success, why open it in the first place and just run the script as a program?

1 Like

Maybe it doesn’t meet your security requirements, but I like Krusader.
Aside from the dual folder panes, which I often find helpful, it can provide you with a console window at the bottom of each pane that automatically changes directory in sync with the director selected for display in the pane above.
This would effective turn your use case on its head, i.e. accessing the command line from the GUI file manager instead of the other way around.

Aside from the dual folder panes, which I often find helpful, it can provide you with a console window at the bottom of each pane that automatically changes directory in sync with the director selected for display in the pane above.

Dolphin has been doing this for ages, too (ok, it’s a single terminal window, that tracks the folder in the active pane+tab… )

bit late to the party …

from what i have seen here (not dolphin running as flatpak), the cause of your trouble might be the way, dolphin runs konsole, which is:

/usr/bin/konsole --hold -e /some/path/to/my-bash-script.sh

doing the same on a command line, konsole will stay open with literally all scripts, even
with just an exit command init.

if you remove the ‘–hold’ part, konsole closes after running the script.

one approach … add something to the script, that figures the current konsole window (eventualy from process is) and send dbus command to it to close.

next approach: create a service menu on your own that that basicly does the same but without the --hold part (also known as --noclose)

i would go with the second, as it might add some flexibility to your needs.

1 Like

Yup, you’re late - you didn’t notice that OP isn’t running Plasma, so all these apps are installed as Flatpaks on a Gnome desktop.

Yup, it’s weird.

i did. that’s why i mentioned this in my comment. in fact i was able to reproduce OPs observings with a regular kde neon install and a flatpak installation of dolphin and konsole in a current ubuntu (gnome) desktop.

anyhow . i’ve played around with my second and recommended approach and this is, what i came along and worked for me:

also here (but failes to install in flatpak variant)

1 Like