Project

General

Profile

Actions

Bug #543

closed

Force only one instance of application

Added by Gérald Kerma about 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Category:
Development
Start date:
04/07/2012
Due date:
04/23/2012
% Done:

100%

Estimated time:
10:00 h
Spent time:

Description

For the impatients childs, we need to block the multi instances of applications.

Actions #1

Updated by Jean-Michel Philippe about 12 years ago

Basically, this is not that complicated. We just need to wrap all applications into a script that tests if the application is already running or being launched. This can be done using package divertions: applications launchers are replaced with a modified version coming from a custom Debian package.

Actions #2

Updated by Jean-Michel Philippe about 12 years ago

The classical command ps can tell if the program is already running for the user:

$ ps -u $(whoami) | grep lxpanel
2446 ? 00:00:07 lxpanel

The command xwininfo from the package x11-utils can be used to find an existing window of a given application. This way the wrapper script can wait until the application is actually launched:

$ xwininfo -name gedit
xwininfo: error: No window with name gedit exists!
$ xwininfo -name lxterminal
xwininfo: Window id: 0x1a00001 "lxterminal"
[…]

The wrapper script could also show a small image to tell the application is being launched, or play a sound for the same purpose.

Actions #3

Updated by Jean-Michel Philippe about 12 years ago

  • Due date set to 04/23/2012
  • Category changed from Configuring to Development
  • Status changed from New to In Progress
  • Assignee set to Jean-Michel Philippe
  • Target version set to 2012-05
  • % Done changed from 0 to 50
  • Estimated time set to 4:00 h

The script is written, I now need to add the on screen notification of application launch.

Actions #4

Updated by Jean-Michel Philippe about 12 years ago

  • % Done changed from 50 to 80
  • Estimated time changed from 4:00 h to 10:00 h

Finally I wrote a more general script that can be tuned in /etc/default/unique-launch. The script brings several features:

  • of course one instance of a given application only
  • splash box to tell users to wait
  • sound played to tell users applications are being launched (may not be heard if the audio card is sleeping)
  • tries to add the fullscreen command line option whenever available (does a guess based on man pages and --help option)

The script is packaged into unique-launch, a new sub-package of doudoulinux-icons. Note that there is still an issue with some applications while trying to detect the application window. We may have to look into window tree hierarchy to find the actual application window.

Actions #5

Updated by Jean-Michel Philippe about 12 years ago

  • Status changed from In Progress to Ready for test
  • % Done changed from 80 to 100

The latest issues have been solved and unique-launch has shown to work on all the applications tested in DDL (about 20). The source code will be soon available on SVN and the Debian package on our Debian repository. Note that the --fullscreen option is not widely used across applications, we then need to use Maximus to do the job.

Actions #6

Updated by Jean-Michel Philippe almost 12 years ago

  • Status changed from Ready for test to Closed
Actions

Also available in: Atom PDF