Script to launch a KDE Konsole window with multiple tabs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to launch a KDE Konsole window with multiple tabs
# 1  
Old 02-14-2015
Script to launch a KDE Konsole window with multiple tabs

Gents,

I found this script to to launch a KDE Konsole window with multiple tabs..

Code:
#!/bin/bash
#
# Create my standard konsole windows.

if [[ ! "$profile" ]]; then
    profile=Shell
fi

sessions=(
    sh1   $profile   'clear; bash'
    sh1   $profile   'clear; bash'
    su1   $profile   'clear; su'
    ssh1  $profile   'clear; ssh 127.0.0.1'
    )

nsessions=0

#####################################################################
# Start sessions in konsole.
function start_sessions()
{
    local session_count=${#sessions[*]}
    local i=0

    while [[ $i -lt $session_count ]]
    do
        local name=${sessions[$i]}
        let i++
        local profile=${sessions[$i]}
        let i++
        local command=${sessions[$i]}
        let i++

        echo "Creating $name: $command"
        # Starting with a specific profile appears to be broken.
        #local session_num=$(qdbus org.kde.konsole /Konsole newSession $profile $HOME)
        local session_num=$(qdbus org.kde.konsole /Konsole newSession)
        sleep 0.1
        qdbus org.kde.konsole /Sessions/$session_num setTitle 0 $name
        sleep 0.1
        qdbus org.kde.konsole /Sessions/$session_num setTitle 1 $name
        sleep 0.1
        qdbus org.kde.konsole /Sessions/$session_num sendText "$command"
        sleep 0.1
        qdbus org.kde.konsole /Sessions/$session_num sendText $'\n'
        sleep 0.1

        let nsessions++
    done
}

read -p "Create konsoles? " ans
if [[ "${ans:0:1}" == 'y' ]]; then
    start_sessions

    # Activate first session.
    while [[ $nsessions -gt 1 ]]
    do
        qdbus org.kde.konsole /Konsole prevSession
        let nsessions--
    done
fi

But I got the msg
Code:
qdbus: command not foud

How to solve this problem to be able to use this script?

I am using

Code:
KDE: 3.5.4-18.el5 Red Hat

Thanks for your help
# 2  
Old 02-14-2015
You may need to install another module/package. When I enter qdbus, I get
Code:
The program 'qdbus' is currently not installed. You can install it by typing:
sudo apt-get install qtchooser

Of course, your red hat will need an rpm- installer.
This User Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to check string contain multiple tabs or spaces?

str contains tabs and multiple spaces str="hello world. How are you?" I want to check string start with hello world, and my code is: if ]world"* ]]; then echo "found" else echo "not found" fi Not work Other solution may work is to replace all tabs and... (4 Replies)
Discussion started by: cmdcmd
4 Replies

2. UNIX for Dummies Questions & Answers

How to regain the focus back to the launch window?

Consider this code snippet below:- char=`which afplay` if then xterm -e 'while true; do clear; echo "Press Ctrl-C to Quit..."; afplay /tmp/pulse.wav; done' & > /dev/null 2>&1 fi This launches a second terminal window that generates a specific waveform for the next calibration of... (4 Replies)
Discussion started by: wisecracker
4 Replies

3. Emergency UNIX and Linux Support

Dealing with XLS file with multiple tabs

Hey Guys , Recently working on a requirement , i had to deal with XLS file with multiple tabs and the requirement was as below : 1. Convert one XLS file with multiple tabs to multiple CSV files. -- As i was working on MAC , so it was quite easy through APPLESCRIPT to deal with this.But... (6 Replies)
Discussion started by: himanshu sood
6 Replies

4. UNIX for Advanced & Expert Users

Shell script for dealing with XLS file with multiple tabs/worksheets

Hey Guys , Recently working on a requirement , i had to deal with XLS file with multiple tabs and the requirement was as below : 1. Convert one XLS file with multiple tabs to multiple CSV files. -- As i was working on MAC , so it was quite easy through APPLESCRIPT to deal with this.But... (2 Replies)
Discussion started by: himanshu sood
2 Replies

5. Shell Programming and Scripting

Launch a text program inside a konsole at startup

Hi ULFers, I am trying to setup a (very) simple startup script on a centos 6.4 computer and it kind of failed.... Here are the details : As said just above the computer setup is running a CentOS 6.4 x64, on this computer a vncserver is automatically started (by a chkconfig vncserver on), i... (1 Reply)
Discussion started by: pierpier
1 Replies

6. UNIX for Dummies Questions & Answers

Can't get KDE to automatically launch...only manually

For work I use VNC Viewer to remote login into a Solaris machine. I have been using CDE for some time before some other guys in my working group introduced me to KDE, which I really like. The problem is that I can only get KDE to start by manually typing "startkde" from the unix command line,... (0 Replies)
Discussion started by: dvd7e
0 Replies

7. UNIX Desktop Questions & Answers

KDE Konsole crashes (solved)

Hello The KDE konsole crashed after I changed the font size to 64. And It crashes every time when started. How can I get it back? Thanks. ---------- Post updated at 08:23 AM ---------- Previous update was at 07:48 AM ---------- solved, I finally find the config file called consolerc. (0 Replies)
Discussion started by: vic005
0 Replies

8. UNIX for Dummies Questions & Answers

How do you close and launch X Window in the Bash shell?

What is the Unix command(s) to close the X Window in the Bash shell to get me into text mode. Also need the command to relaunch it from the text mode. Thanks. (1 Reply)
Discussion started by: jacatone
1 Replies

9. Solaris

Script to launch terminal window?

Hi, I am a newbie here. Trying to find a way of writing a script to launch multiple terminal or console windows on solaris 9. I used to be able to do this using cmdtool on older versions of solaris and it was even possible to configure the size and screen position of the window and the title. ... (5 Replies)
Discussion started by: omerta
5 Replies

10. SuSE

KDE 3.1.1 - Disabling Window Decorations

Hi, I am currently running KDE 3.1.1 under SuSE Linux 8.2 pro. I am trying to run an aterm with all window decorations disabled. Is there a way to anyones knowledge of disabling window decorations for a *single* window - i.e. not have the settings apply to all windows. I've googled and... (5 Replies)
Discussion started by: zazzybob
5 Replies
Login or Register to Ask a Question