[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Switching in and out of fullscreen dosemu session? - more re wmctrl
- Subject: Re: Switching in and out of fullscreen dosemu session? - more re wmctrl
- From: Paul Lagasse pglagasse@xxxxxxxx
- Date: Thu, 03 Dec 2009 16:38:30 -0500
Rafe, I've figured out how to make one shortcut key do double duty, so
that it will switch to a program's window if the program is open or
launch the program if it isn't open. Examples:
sh -c '(wmctrl -a "XyWrite--Dosemu") || (xdosemu xy)'
is the Keyboard Shortcut "Command" that will switch to XyWrite if open,
otherwise it launches XyWrite;
sh -c '(wmctrl -a "pgl - File Browser") || (nautilus /home/pgl/)'
will switch to my home directory if it's open in Nautilus, otherwise it
will launch Nautilus with my home directory open;
and
sh -c '(wmctrl -a "Compose:") || (thunderbird -compose)'
will switch to a Thunderbird "compose mail" window if one is open,
otherwise it launches a "compose mail" window.
The Command string runs the shell ("sh"), which runs the command in
single quotes following "-c"; if the first command in parens fails, then
the second command is run. The same string also can be used as the
Command run by a Launcher, so the Home icon on my panel can also be a
hot button for finding an open Nautilus window. So far, all seems well.
Paul
Raphael Tennenbaum wrote:
If you install wmctrl, go to Keyboard shortcuts, then click the Add
button.
> Give your shortcut a name, "Switch to Thunderbird", then specify the
command
>"wmctrl -a Thunderbird", then OK it and find it under the Custom
Shortcuts
> section and assign a key combo.
swell, just what I had been seeking. & since I usually have two Xy
windows running,
$_X_title = "XXXXX"
along with
$_X_title_show_appname = (off)
in the dosemu configuration file for each session works nicely to
distinguish them. thanks, Paul.
-rafe