You are not logged in.

#1 2012-02-18 21:29:08

devman
Member
Registered: 2012-02-18
Posts: 2

Running Dolphin from terminal.

I installed Arch Linux a couple days ago and love it. I was previously using Ubuntu 9.04. I've got everything the way I want it (Using KDE4 as my desktop environment) and could not be happier save for one issue. In Ubuntu whenever I would start nautilus from a terminal it would come up and my terminal prompt would immediately return to me. If I later exited that terminal the nautilus window I opened would not be closed with. I'm not really sure what is going on or what to search for to make this happen in Arch (with Dolphin preferably). I can say that Konsole behaves like this by default. If I open Konsole from a terminal it opens up and my terminal prompt returns immediately and If I close the original terminal Konsole does not close with it. So the question is how do make Dolphin (I would settle for using Nautilus again but I can't make it do this either on Arch) have the same behavior as Konsole and as Nautilus on Ubuntu?

Offline

#2 2012-02-18 21:32:54

Oxyd
Member
From: Czech Republic
Registered: 2008-01-17
Posts: 167

Re: Running Dolphin from terminal.

It's really a matter that both Konsole and Nautilus are programmed to detach from the parent process when started. Dolphin, apparantely, is not.

You can still make it detach by launching it as “nohup dolphin &” (assuming you're using Bash as your shell).

Offline

#3 2012-02-18 21:41:56

guelfi
Member
From: /home/guelfi
Registered: 2011-07-01
Posts: 111

Re: Running Dolphin from terminal.

Oxyd wrote:

It's really a matter that both Konsole and Nautilus are programmed to detach from the parent process when started. Dolphin, apparantely, is not.

You can still make it detach by launching it as “nohup dolphin &” (assuming you're using Bash as your shell).

I don't think that Nautilus detaches from the parent process, but that it is automatically started
if you start GNOME. If you then try to run it from the console, it first checks if the
daemon is already running, and requests the daemon to open a new window and exits if it does.

EDIT: I just tried it and if you already have an open instance of nautilus and run it again
from the terminal, a new window is created, but the process exits instantly.

Also, a (IMO) cleaner solution is

dolphin & disown

as it doesn't produce a nohup.out.

(Of course, if you do this, dolphin's stdin will still be the terminal, which may cause problems if
you want to run another program in this terminal and dolphin creates some output.)

Last edited by guelfi (2012-02-18 21:45:59)

Offline

#4 2012-02-18 23:46:04

devman
Member
Registered: 2012-02-18
Posts: 2

Re: Running Dolphin from terminal.

Thanks guelfi for mentioning the daemon thing.

That got me thinking that maybe I could use dbus to launch dolphin for me. I whipped up a script and threw it in my ~/bin and its working fine.

I have no idea if this is the "right way" but it seems to work fine and does not appear to break anything.

browse.sh

#!/bin/bash

FILE_BROWSER=/usr/bin/dolphin

if [[ -z $1 ]]; then
    BROWSE_PATH=`pwd`
else
    CURR_DIR=`pwd`
    cd $1
    if [ $? -ne 0 ]; then exit 1; fi
    BROWSE_PATH=`pwd`
    cd $CURR_DIR
fi
echo "Invoking $FILE_BROWSER on DBus with path $BROWSE_PATH";
qdbus org.kde.klauncher /KLauncher exec_blind $FILE_BROWSER "$BROWSE_PATH"

Last edited by devman (2012-02-19 00:19:12)

Offline

Board footer

Powered by FluxBB