Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Opening KDE konsole from the command line

  1. #1

    Default Opening KDE konsole from the command line

    Hi,

    I need to open Konsole from the command line, because I need to write a script to open four Konsole terminals.
    when I do :
    Code:
    linux-gn77:/home/harbir # konsole -e konsole
    I get the following message:
    Code:
    unnamed app(4332): KUniqueApplication: Cannot find the D-Bus session server:  "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken." 
    
    unnamed app(4331): KUniqueApplication: Pipe closed unexpectedly.
    I am trying the above command as a root user.
    I am also not sure if I am doing it correctly.

  2. #2

    Default Re: Opening KDE konsole from the command line

    Quote Originally Posted by harbir_linuxuser View Post
    I am trying the above command as a root user.
    I am also not sure if I am doing it correctly.
    A program run as root user won't find your user's X and D-BUS session. And KDE applications need both.

    Why do you have to run that as root?
    What do you want to achieve?


    And what exactly do you mean with "command line"?
    Try "su -" instead of "su". Or try "dbus-launch konsole".
    In text mode you would have to set the DISPLAY and DBUS_SESSION_BUS_ADDRESS variables accordingly and probably more.


    And just "konsole" should be enough. No need to run "konsole -e konsole".
    Last edited by wolfi323; 18-Jun-2014 at 13:15.

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,253

    Default Re: Opening KDE konsole from the command line

    I do not understand you. From where are you (as root) doing this? And where do you think that the konsole window must be shown?

    Also, I do not understand what you try to achieve with the command
    Code:
    konsole -e konsole
    That is starting konsole and then on the konsole executing konsole. Is it me that is stupid that I do not quite understand what konsole inside konsole is giving you?

    Maybe you should try to explain in more detail what your goal is so that people can help you to reach that.
    Henk van Velden

  4. #4

    Default Re: Opening KDE konsole from the command line

    Wolfi23

    Thank you for the reply, I do not need to run the command as a root user, so ones I ran "Konsole" as a normal user it opened up the new terminal, which is correct.

    This is what I am trying to achieve:
    To run the script that opens up four different terminals, each with the different directory location and each terminal has a different title.

    Thanks

  5. #5

    Default Re: Opening KDE konsole from the command line

    Quote Originally Posted by harbir_linuxuser View Post
    This is what I am trying to achieve:
    To run the script that opens up four different terminals, each with the different directory location and each terminal has a different title.
    Well, you could create four different profiles for that and set them with the --profile option, i.e.:
    Code:
    konsole --profile profile1
    and so on.

    You can set the working directory with the --workdir option.
    The window's (or rather tab's) title can only be set in the profile, you can override this with the -p option (you can also override the working directory in that way). So either of those should work:
    Code:
    konsole --workdir /usr/share -p "tabtitle=My Konsole"
    or
    Code:
    konsole -p "tabtitle=My Konsole;Directory=/usr/share"

  6. #6

    Default Re: Opening KDE konsole from the command line

    Hi wolfi323,
    Thanks for the reply.
    Please pardon me, I am new to linux.

    I like the sound of the creating different profiles, but please may I know what are these profiles and how can they be created?

    Thanks

  7. #7
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,755
    Blog Entries
    3

    Default Re: Opening KDE konsole from the command line

    Quote Originally Posted by harbir_linuxuser View Post
    To run the script that opens up four different terminals, each with the different directory location and each terminal has a different title.
    I would normally use "xterm" rather than "konsole" for that:

    Code:
    for dir in dirpath1 dirpath2 dirpath3 dirpath4 ## substitute actual directories
    do
       ( cd $dir && xterm -title "$dir" & )
    done
    That should work the same with "konsole" instead of "xterm" -- except that I haven't checked whether "-title" works for "konsole".
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  8. #8

    Default Re: Opening KDE konsole from the command line

    Hi nrickert,

    what is the advantage of using xterm rather than konsole?

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,253

    Default Re: Opening KDE konsole from the command line

    Quote Originally Posted by harbir_linuxuser View Post
    Hi wolfi323,
    Thanks for the reply.
    Please pardon me, I am new to linux.

    I like the sound of the creating different profiles, but please may I know what are these profiles and how can they be created?

    Thanks
    Start konsole and look in the menus. There are menu items for managing profiles in Settings. A bit of exploration please.
    Henk van Velden

  10. #10

    Default Re: Opening KDE konsole from the command line

    Quote Originally Posted by harbir_linuxuser View Post
    I like the sound of the creating different profiles, but please may I know what are these profiles and how can they be created?
    In Konsole's menu: Settings->Manage Profiles...

    Quote Originally Posted by harbir_linuxuser View Post
    Hi nrickert,

    what is the advantage of using xterm rather than konsole?
    Well, xterm is no KDE application, but a basic X application. So it should be available anywhere (if running on X at least) no matter which Desktop Environment is used, and should use less resources.

    But of course it will look a bit out-of-place in KDE, and doesn't have all features of Konsole.
    It all depends on your use-case and intentions I suppose.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •