You are not logged in.
Pages: 1
Hello,
With multiples windows on multiples workspaces, a click on "hide windows and show desktop" applet (in french : "Réduire toutes les fenêtres et afficher le bureau"), hide all windows on all wokspaces.
Is it possible to make this applet only minimize windows on the active workspace ?
Cheers
Offline
No, it is a screen property (_NET_SHOWING_DESKTOP) that is emitted, not a per-workspace setting.
Offline
Thanks for your answer.
Maybee there is a way with wmctrl ?
http://tomas.styblo.name/wmctrl/
But it's probably more complicated than i thought.
Offline
Hello,
I code a (dirty) workaround : a script using wmctrl and xdotool.
Here is a PHP script, but it could be a perl or python...
<?
// active desktop
$result = shell_exec("wmctrl -d");
$t = explode("\n", $result);
$active_desktop = "";
foreach ($t as $l) {
$tl = explode(" ", $l);
if ($tl[2] == "*") {
$active_desktop = (int) $tl[0];
break;
}
}
if ($active_desktop != "") {
// search for window on this desktop
$result = shell_exec("wmctrl -l");
$t = explode("\n", $result);
foreach ($t as $l) {
$id = substr($l, 0, 10);
$desktop = (int) trim(substr($l, 10, 3));
if ($desktop == $active_desktop) {
// minimize window
$result = shell_exec("xdotool key $id alt+F9");
}
}
}
?>
Offline
Hello,
xulops script works great, only line:
$result = shell_exec("xdotool key $id alt+F9");
should be replaced by:
$result = shell_exec("xdotool windowminimize $id");
Regards,
Martin
Offline
Thanks Semik, i'll test that.
Just another bug : in PHP $active_desktop = "" and $active_desktop = 0 is the same thing and could cause trouble one the first workspace (id 0).
$active_desktop must be initialized with another value (-1 for example) and the if must become if ($active_desktop > -1) < ...
Offline
Pages: 1
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 533.7 KiB (Peak: 534.55 KiB) ]