3 # Copyright (C) 2000-2004 Carsten Haitzler, Geoff Harrison and various contributors
5 # Permission is hereby granted, free of charge, to any person obtaining a copy
6 # of this software and associated documentation files (the "Software"), to
7 # deal in the Software without restriction, including without limitation the
8 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 # sell copies of the Software, and to permit persons to whom the Software is
10 # furnished to do so, subject to the following conditions:
12 # The above copyright notice and this permission notice shall be included in
13 # all copies of the Software, its documentation and marketing & publicity
14 # materials, and acknowledgment shall be given in the documentation, materials
15 # and software packages that this Software was used.
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 # THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 # This script is still VERY VERY VERY early on in development
25 # but I wanted to give you folks an idea of why the IPC was being
26 # set up the way it was. this is just a quick hack. expect better
27 # samples in the near future.
28 # This app will take the parameters "on" and "off", and will basically
29 # shade all the windows on the current desktop and area. (or unshade)
33 # here we're going to test to see whether we are shading or unshading
36 if($ARGV[0] eq "on") {
42 # here we'll retreive the current desk we're on
45 @stuff = split(/\s*:\s*/);
46 @stuff = split(/\s*\/\s*/, $stuff[1]);
47 $current_desk = $stuff[0];
49 # here we'll retreive the current area we're on
52 @stuff = split(/\s*\n\s*/);
53 @stuff = split(/\s*:\s*/, $stuff[0]);
54 $current_area = $stuff[1];
55 $current_area =~ s/\n//g;
58 # get the old shadespeed so that we can set it back later
59 # because we want this to happen fairly quickly, we'll set
60 # the speed to something really high
62 $_ = `eesh show misc.shading.speed`;
63 @stuff = split(/\s*\n\s*/);
64 @stuff = split(/\s*=\s*/, $stuff[0]);
65 $shadespeed = $stuff[1];
67 open IPCPIPE,"| eesh";
68 print IPCPIPE "set misc.shading.speed 10000000\n";
70 # now we're going to walk through each of these windows and
73 @winlist = `eesh window_list a`;
75 if (/\s*(\w+)\s* : .* :: \s*(-*\d+)\s* : (.*) : (.*)$/) {
81 # Skip pagers, iconboxes, systrays, and epplets
82 next if ($name =~ /^Pager-|Iconbox|Systray|E-/);
83 # next unless (($desk == -1) and ($desk eq $current_desk));
84 next unless ($desk eq $current_desk);
85 next unless ($area eq $current_area);
87 print IPCPIPE "win_op $window shade on\n";
89 print IPCPIPE "win_op $window shade off\n";
94 # now we're going to set the shade speed back to what it was originally
96 print IPCPIPE "set misc.shading.speed $shadespeed\n";