Bug 45630

Summary: no way to raise / select / switch to a window programatically
Product: [Plasma] kwin Reporter: inverse
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description inverse 2002-07-23 01:38:28 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kwin
Version:           KDE 3.0.0 
Severity:          wishlist
Installed from:    Debian stable Packages
Compiler:          wishlist
OS:                Linux
OS/Compiler notes: wishlist

Please see http://groups.google.com/groups?as_umsgid=<8bc70ae9.0207211437.1e92ba25@posting.google.com> 

From: JoyInStruggle (JoyInStruggle@yahoo.com)
Subject: How can I switch / select / change windows programatically
Newsgroups: comp.windows.x.kde
Date: 2002-07-21 15:37:11 PST

I'd like to write a bash file that enables me to select a window by process-id then raise that window.  Can it be done?

I've looked at the kde documentation for kpanel and kwm.  I've found a number of kwmcom commands that manipulate the window manager.  For example:

kwmcom kpanel:system     // open the application starter
kwmcom desktop2          // switches to desktop 2
kwmcom deskcascade       // cascadethe windows on the current desktop
kwmcom winOperations     // open the op box on the current window
kwmcom taskManager       // opens the Current Session manager
kwmcom commandLine       // opens the "run" window
kwmcom logout            // logs out

None of these give me quite what I want.  It's ironic that I can switch to another desktop but not to another window!

I often have many maximized windows open simultaneously -- when programming for example I am frequently referencing many different files.  I use Run (Alt-F2) to start my first kwrite then use kwrite to open additional kwrite windows.  I then use Alt-Tab to switch between windows.  Alt-Tab (and even Ctrl-Esc) becomes time-consuming and tedious after a while when the number of windows is large so I'm looking for an alternative.

I'd like to create a bash file that would accept a two-character "class file id".  It would use "ps" output to determine whether the file is already open.  If open it would raise the kwrite window for that file.  If not open it would start kwrite in background.  The problem is I can't find a way to raise the window.  Is there a way?

Linux version ............. Linux localhost 2.2.16 #1 Tue J
Linux date and machine .... ul 18 16:07:55 EDT 2000 i586 unknown
Linux version from dmesg .. Linux version 2.2.16 (root@osbuild)
Hostname .................. localhost
libc6 version from dpkg ... Version: 2.1.3-10
libc5 version from dpkg ... Version: 5.4.46-3
xlib6g version from dpkg .. Version: 3.3.6-11potato32
XFree86 version ........... vendor release number:    3360
bash version .............. GNU bash version 2.01.1(1)-release (i486-pc-linux-gnu)
kde date ..................  Jul 17  2000
kde-Corel version (dpkg) .. Version: 1.1-1568
gcc version from dmesg .... (gcc version 2.7.2.3)
gcc version from dpkg ... Version: 1:2.95.2-13
g++ version from dpkg ... Version: 1:2.95.2-13

From: Moritz Moeller-Herrmann (mmh@gmx.net)
Subject: Re: How can I switch / select / change windows programatically
Newsgroups: comp.windows.x.kde
Date: 2002-07-22 06:41:02 PST

kwmcom is completely obsolete! :-) But the dcop interface to kwin still has
no funtion implemented to raise a single window. You should go to
http://bugs.kde.org and file a wishlist item. You need a dcop interface for
manipulating windows. --
Moritz Moeller-Herrmann ICQ #3585990
(wiss. Mitarbeiter IMGB Mannheim)

(Submitted via bugs.kde.org)
Comment 1 Lubos Lunak 2002-10-03 19:10:54 UTC

*** This bug has been marked as a duplicate of 34882 ***