Rof - a script to avoid launching multiple instances of the same window


#1

While playing with my collection of Tint2 executors (which I have not yet formally introduced here), one of things I hated most was that commands assigned to mouse events used to execute again and again after each click, even if previous instances were already running. For instance: the volume icon left- and right-clicked thee times would give me something like this:

The behavior I expected was: launch the command if not yet running, else just bring focus to the command window. Having no idea on how to achieve this with existing bash commands, today I wrote a short launcher script, called rof (Run Or set Focus). Now the commands open their windows once, no matter how many times you click:

You may find the script here. Preferably it should be marked executable and placed in /usr/bin. For lazy people I prepared PKGBUILD in the rof_pkg folder. Or you can just download and install the package from the same location in AUR.

Type rof -h for info on how to use.

Questions:

  1. Haven’t I reinvented the wheel? Possibly this could have been achieved in another, simple way?
  2. If not: does the script work well enough for you? No bugs?
  3. If so: should it be published in AUR?

#2

Top job again @nwg . Thx for sharing.


#3

Finally I published the script in AUR, as rof-git. Thanks in advance for your votes. Even more for feedback. :slight_smile:


#4

Look forward to that man, love tint2 w/polbar.


#5

I intended to publish them all as a single package, but it seems to make no sense. One will always need to add Tint2 executors and adjust them to their taste. Surely I could add an ‘autoconfig’ script, as I did in obhud, but newbies are likely to understand nothing, and more advanced users don’t need it. These scripts should either come pre-installed, or be aimed at advanced users.

It seems the only I can do (and actually I’m doing right now) is to provide a “dummy” package, which will install all dependencies in one step.


#6

Top job in there @nwg


#7

@nwg I wouldn’t be shy about it man, you can’t share enough. I’ve been around since the beginning of #! but still and always will consider myself a noob. If someone thinks they’re not a noob… More power to them & perhaps they should be lookin’ for a more challenging hobby. :slight_smile:


#8

No idea what could be more a challenge than tweaking a niche WM on a niche distribution of a niche OS. :smiley: However, being still and forever a greenhorn, I understand that people coming from Windows have no idea on how to customize Tint2, and don’t really care. If they want such extensions, the should be able to turn then on in one simple step.


#9

Tint2 is tint2, doesn’t really matter unless the call is specific but that’s easy enough to change.


#10

Well, having installed AL on the netbook, I added all my executors in about 10 minutes, just following my own Wiki. :slight_smile:


#11

That s what I call a fast install in there, congrats @nwg