[kde] Re: How to set up Menu items such that if an instance is already running, the running instance is brought to the foreground?



On Sun, Mar 06, 2011 at 03:16:34PM +0000, Duncan wrote:
kde posted on Sun, 06 Mar 2011 01:31:16 +0000 as excerpted:
Perhaps part of the problem for your seniors is kde's session management.
If they quit kde with several app instances running and kde restarts them
when it comes back up, but they don't understand that, they may be
starting a new instance each time, not thinking that kde might have
remembered what was running the last time and restarted it, so the
instances gradually build up...

Of course, you can make kde start with a clean session each time, if you
wish. That would cure that issue.

But what about going about it from the other angle? Have kde start all
the apps they need, then save that as their session, and hide the
launcher, so all they have is the taskbar. You could take the close
button off the title bar too, making it more difficult to close the apps,
and if they did, they'd only have to restart kde to have the pre-set
session come back with all their apps.

It may or may not work in practice, but it's certainly thinking about the
problem from "outside the box". Reverse the problem and it goes away. =:^)

Would this be a workable approach for the OP - wrap the app launch
in a generalized mechanism, let's call the mechanism Larry (as I
abhor the imprecision that comes with "it", and have no better name).
Larry handles each attempted application launch for the seniors.
Here's what I envision happening:

Larry looks at the proposed app, and if that app has one or more
running instances, display a dialog, with a suitably large font,
with a clickable list that distinguishes each running instance
of the app. At one end of the list, distinguished visually in
some way from other items in the list, is a "nope, none of
these, start a fresh new instance" list item. Clicking a list
item or using the arrow keys and the enter-key would switch to
that instance or launch a new instance of the app.

Larry should have a way to back-out of any action at all - "cancel".
And a Help button that has both an icon (I favor a question mark)
and a (largish) text label to go with it.

Larry could be assembled using bash, kdialog, and some tools
such as xmumble and grep, right? (Mumble is a place-holder for
an actual executable name. This isn't a fully worked example).

#!/bin/bash
itemlist=`xmumble | grep mumble | sort | ...`
myitem=$(kdialog --menu "Click what you want" $itemlist)
# activate the selection or launch new app
/usr/bin/mumble myitem ...

--
Charles Polisher

___________________________________________________
This message is from the kde mailing list.
Account management: https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.



Relevant Pages

  • [kde] Re: How to use Plasmoid shortcuts
    ... because of a bug I cannot launch some apps ... I believe part of the issue may be that krunner checks more than just the ... FWIW, kde, including krunner, gets my custom environment, including path, ... maintain as your app mix changes. ...
    (KDE)
  • [kde] Re: Application launch files
    ... Subject: [kde] Re: Application launch files ... Also note that it's still possible to launch kmenuedit, ... the same effect, by setting a kde hotkey to launch a custom launcher app, ... allow the creator to choose both the icon ...
    (KDE)
  • Ctrl key stuck? with every key press?
    ... I'm using Debian Etch on a laptop with KDE (everything is stable ... to re-enable the keyboard repeat or re-enable the screensaver. ... down the CTRL key. ... applications in the menu, I couldn't start an app via ALT-F2 because I ...
    (Debian-User)
  • Re: [opensuse] KDE 4.3.1 Desktop Errors
    ... KDE 4.3.0 worked ok without such any errors. ... first time after the upgrade that included the new desktop security ... click Continue it should not ask you again for that app and that user. ... Once you say that is OK to run that application, the icon will change and you ...
    (SuSE)
  • Re: [kde] Korganizer no longer opens from system tray
    ... Is this worth reporting to the KDE bug tracking system? ... icon allows you to visually see that it is running. ... You could run it with your kde session, minimize it to the tray, ... kde4, tho I did quite some time ago on kde3 for an app or two, and it ...
    (KDE)