Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Transparency Effect
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
stjepan
n00b
n00b


Joined: 02 Mar 2006
Posts: 56

PostPosted: Mon Mar 06, 2006 9:05 pm    Post subject: [HOWTO] Transparency Effect Reply with quote

HOWTO: A LITTLE BUT NICE TRANSPARENCY EFFECT

Description: This effect is supported by a little program, trans-inactive. With it you can define the of active and inactive windows.
Requirements: Python, XGL and Compiz/glxcompmgr (maybe it will work with xcomposite too; needed more info about that, pls report your experiences with it)

1. You do not have to do very much because I made a configuration script which does everything.
Save this as trans-inactive-config:
Code:
#!/usr/bin/env python
# Author: Stjepan Glavina
# Description: A script which will download, patch, configure and install trans-inactive.

import sys, os

print """
>>> Welcome to trans-inactive-config!
>>> Author of trans-inactive is Brian Tarricone.
>>> Copyright (c) 2006 Brian Tarricone <bjt23@cornell.edu>
"""

try:
  print ">>> Trying to kill already running trans-inactive daemon ..."
  os.system("killall trans-inactive")
  print ">>> Trying to remove /tmp/trans-inactive-config/ ..."
  os.system("rm -rfv /tmp/trans-inactive-config/")
  os.system("mkdir /tmp/trans-inactive-config/")
  print ">>> Downloading sources ..."
  os.system("wget -O /tmp/trans-inactive-config/trans-inactive.c " +
            "http://spuriousinterrupt.org/files/xfce4/trans-inactive.c")
  f = open("/tmp/trans-inactive-config/everything_transparent.patch", "w")
  f.write(
"""35c35,36
< #define INACTIVE_OPACITY (0.80 * 0xffffffff)
---
> #define INACTIVE_OPACITY (0.90 * 0xffffffff)
> #define ACTIVE_OPACITY (0.90 * 0xffffffff)
171c172
<                             0xffffffff);
---
>                             ACTIVE_OPACITY);
224c225
<                                         _NET_WM_WINDOW_OPACITY, 0xffffffff);
---
>                                         _NET_WM_WINDOW_OPACITY, ACTIVE_OPACITY);
""")
  f.close()
  f = open("/tmp/trans-inactive-config/trans-inactive.c", "r")
  content = f.readlines()
  f.close()
  found = False
  print ">>> Applying patch: everything_transparent.patch ..."
  os.system("patch -f -p0 /tmp/trans-inactive-config/trans-inactive.c " +
              "/tmp/trans-inactive-config/everything_transparent.patch")
  n = 0
  m = 0

  print ">>> Configuring ..."
  while (n > 100 or n < 1):
      n = input("Enter the opacity of inactive windows (1-100): ")
  while (m > 100 or m < 1):
      m = input("Enter the opacity of active windows (1-100): ")
  buff = ""
  f = open("/tmp/trans-inactive-config/trans-inactive.c", "r")
  while (True):
      line = f.readline()
      if (not line): break
      if ("#define INACTIVE_OPACITY" in line):
        line = "#define INACTIVE_OPACITY (" + str(float(n)/100) + " * 0xffffffff)\n"
      if ("#define ACTIVE_OPACITY" in line):
        line = "#define ACTIVE_OPACITY (" + str(float(m)/100) + " * 0xffffffff)\n"
      buff = buff + line
  f.close()
  f = open("/tmp/trans-inactive-config/trans-inactive.c", "w")
  f.write(buff)
  f.close()
  print ">>> Compiling trans-inactive.c ..."
  os.system("gcc -o /tmp/trans-inactive-config/trans-inactive " +
            "/tmp/trans-inactive-config/trans-inactive.c -L/usr/X11R6/lib -lX11")
  print ">>> Installing trans-inactive ..."
  if (os.getuid() != 0):
      while (os.system("su -c \"cp -vf /tmp/trans-inactive-config/trans-inactive " +
                       "/usr/bin/\"") != 0): pass
  else:
      os.system("cp -vf /tmp/trans-inactive-config/trans-inactive /usr/bin/")
  print ">>> Cleaning up ..."
  os.system("rm -rfv /tmp/trans-inactive-config/")
  print ">>> Done! Now you may run trans-inactive."
except:
  print "Unexpected error:", sys.exc_info()[0]
  print "Please report bugs to <stjepang AT gmail DOT com>."
  sys.exit(1)

2. Make trans-inactive-config executable:
Code:
chmod +x trans-inactive-config

3. Run it:
Code:
./trans-inactive-config

4.Run trans-inactive
Code:
trans-inactive &

If you want to configure it again, repeat steps 3 and 4. Very easy, isn't it?


Enjoy!


HOW DOES IT WORK?
Trans-inactive-config works very simply. Here are it's steps:
1. Trying to kill already running trans-inactive
2. Trying to remove existing temporary files
3. Downloading sources of trans-inactive
4. Making patch
5. Patching
6. Asking user about opacity
7. Applying configuration (which is got by user in step 6)
8. Compiling
9. If you are root: installing, if you are not root: asking for the root password and installing
10. Removing temporary files made by trans-effect-config

FAQ: Why a python script for patching a *.c file??
It's there because of simplicity. You don't have to manually patch trans-inactive.c, you don't have to manually configure it,
you don't have to manually compile and install it! You just have to run it.

BUGS: While changing workspaces (cube effect) windows will look a little less opaque. I think it is because of the behaviour of opengl lights. If anyone knows how to fix that, let me know. (it's a compiz's or opengl's thing and it ins't really a bug)
WORKAROUND: (works just with switching workspaces by a keyboard shortcut, not by mouse) With transparency-fading effect you will just forgot this bug! You will not notice it if (so you will notice the bug :)) you make opacity of inactive windows just a little higher or lower than opacity of the active window. For example, using 80% and 60% is quite bad because you will notice the bug. But if you use 80% and 30%, you won't notice it!! If you don't believe me, try it yourself!
Here are the settings which I personally use:
Code:
Enter the opacity of inactive windows (1-100): 37
Enter the opacity of active windows (1-100): 86


EDIT: Made configuration script, now installation and configuration are easier than ever!
Enhanced installing. Now you do not have to run trans-inactive-config as root!
Nicer output (added ">>>").
Now it puts all files in /tmp/trans-inactive-config so they are not lying in the current directory.
The config script renamed from "trans-effect-config" to "trans-inactive-config".
X.Y.Z versioning scheme instead of MMDDGGGG.
Made a bug workaround.
No need for putting the config script into a portage overlay (it's ridiculous).

Post some comments, please. How's it working?

Thanks to ElAngelo,CoffeeBuzz, Pijalu and Brian Tarricone!
Author of trans-inactive.c is Brian Tarricone.
Copyright (c) 2006 Brian Tarricone <bjt23@cornell.edu>


Last edited by stjepan on Thu Mar 09, 2006 8:10 am; edited 20 times in total
Back to top
View user's profile Send private message
stjepan
n00b
n00b


Joined: 02 Mar 2006
Posts: 56

PostPosted: Tue Mar 07, 2006 9:36 am    Post subject: Reply with quote

NEWS:
I made the configuration script.
To configure the transparency effect, now you just have to run trans-effect-config and start trans-inactive!
Installing part of trans-effect-config is better now. It will ask you for password if you are not running it as root.


Last edited by stjepan on Tue Mar 07, 2006 8:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
CoffeeBuzz
Apprentice
Apprentice


Joined: 15 Jun 2005
Posts: 269
Location: Canada Eh.

PostPosted: Tue Mar 07, 2006 3:29 pm    Post subject: Reply with quote

I made some small edits to it to place all files in /tmp instead of working directory. I know it cleans everything up but meh, in the event somethings goes wrong the cruft remains in /tmp


Revision 48 contains an ebuild, trans-inactive that installs trans-inactive-config.py

Then just run

Code:
trans-inactive-config.py


enter your preferred values and trans-inactive gets installed.
_________________
HP Pavilion zd7260us
Xgl Overlay: http://svn.xgl-coffee.org/xgl-coffee/trunk
Xgl Forums: http://forums.xgl-coffee.org
Back to top
View user's profile Send private message
stjepan
n00b
n00b


Joined: 02 Mar 2006
Posts: 56

PostPosted: Tue Mar 07, 2006 8:17 pm    Post subject: Reply with quote

CoffeeBuzz wrote:
I made some small edits to it to place all files in /tmp instead of working directory. I know it cleans everything up but meh, in the event somethings goes wrong the cruft remains in /tmp


Revision 48 contains an ebuild, trans-inactive that installs trans-inactive-config.py

Then just run

Code:
trans-inactive-config.py


enter your preferred values and trans-inactive gets installed.
I modified it. Please use my original trans-inactive-config. Note that it is now "trans-inactive-config", not "trans-inactive-config.py" and versioning scheme is now different.
Please put the latest version of trans-inactive-config into your overlay. When you put it there, I will put here the howto about installing it in the emerge way.
I saw your trans-inactive-0.0.1.ebuild. Please rename the ebuild of my config script to trans-inactive-config-0.0.2.ebuild (not trans-inactive-0.0.2.ebuild!). Use these variables:
Code:
DESCRIPTION="Wizard for configuring and installing trans-inactive, a program which makes inactive windows transparent"
KEYWORDS="~x86 ~amd64"
DEPEND="dev-lang/python"
HOMEPAGE="http://forums.gentoo.org/viewtopic-t-440763.html"

How should ebuild work?
* downloading trans-inactive-config
* copying trans-inactive-config into /usr/bin/
* at the end, showing information about it: "To configure transparency, run trans-inactive-config blah blah something like that.... blah blah"

NEWS:
Putting files into /tmp/trans-inactive-config instead of putting them into the current directory.
Output in emerge style (">>>").
Renamed from "trans-effect-config" to "trans-inactive-config".
X.Y.Z versioning scheme instead of MMDDGGGG. (current version is 0.0.2, not 07032006)
Made a bug workaround!
Back to top
View user's profile Send private message
CoffeeBuzz
Apprentice
Apprentice


Joined: 15 Jun 2005
Posts: 269
Location: Canada Eh.

PostPosted: Wed Mar 08, 2006 5:36 am    Post subject: Reply with quote

Commited, several times... slightly intoxicated tonight me thinks.

Revision 50-something should be working. Renamed to trans-inactive-config. Added ewarn's to run the python script before launching the daemon.
_________________
HP Pavilion zd7260us
Xgl Overlay: http://svn.xgl-coffee.org/xgl-coffee/trunk
Xgl Forums: http://forums.xgl-coffee.org
Back to top
View user's profile Send private message
stjepan
n00b
n00b


Joined: 02 Mar 2006
Posts: 56

PostPosted: Wed Mar 08, 2006 7:33 am    Post subject: Reply with quote

CoffeeBuzz wrote:
Commited, several times... slightly intoxicated tonight me thinks.

Revision 50-something should be working. Renamed to trans-inactive-config. Added ewarn's to run the python script before launching the daemon.

Much better, but I noticed something in the ebuild:
Code:
pkg_postinst(){
        ewarn ""
        ewarn "You must run trans-inactive-config.py to configure and" ### this line is not ok
        ewarn "install the trans-inactive binary."
        ewarn ""
        ewarn "Then run \"trans-inactive &\" as user to enable the effects."
        ewarn ""
}
There is not "trans-inactive-config.py". It is dead! There is just "trans-inactive.config". Also see that I changed the howto a bit. There is no *.py. Also please change /usr/bin/trans-inactive-config.py to /usr/bin/trans-inactive-config. It doesn't the ".py" because it contains the "#!/usr/bin/env python" line.
Everything else with it is great.
Back to top
View user's profile Send private message
CoffeeBuzz
Apprentice
Apprentice


Joined: 15 Jun 2005
Posts: 269
Location: Canada Eh.

PostPosted: Wed Mar 08, 2006 4:48 pm    Post subject: Reply with quote

stjepan wrote:
CoffeeBuzz wrote:
Commited, several times... slightly intoxicated tonight me thinks.

Revision 50-something should be working. Renamed to trans-inactive-config. Added ewarn's to run the python script before launching the daemon.

Much better, but I noticed something in the ebuild:
Code:
pkg_postinst(){
        ewarn ""
        ewarn "You must run trans-inactive-config.py to configure and" ### this line is not ok
        ewarn "install the trans-inactive binary."
        ewarn ""
        ewarn "Then run \"trans-inactive &\" as user to enable the effects."
        ewarn ""
}
There is not "trans-inactive-config.py". It is dead! There is just "trans-inactive.config". Also see that I changed the howto a bit. There is no *.py. Also please change /usr/bin/trans-inactive-config.py to /usr/bin/trans-inactive-config. It doesn't the ".py" because it contains the "#!/usr/bin/env python" line.
Everything else with it is great.


done and done.
_________________
HP Pavilion zd7260us
Xgl Overlay: http://svn.xgl-coffee.org/xgl-coffee/trunk
Xgl Forums: http://forums.xgl-coffee.org
Back to top
View user's profile Send private message
stjepan
n00b
n00b


Joined: 02 Mar 2006
Posts: 56

PostPosted: Wed Mar 08, 2006 5:57 pm    Post subject: Reply with quote

CoffeeBuzz wrote:
done and done.

Code:
genbox stjepan # ACCEPT_KEYWORDS="~amd64" emerge -va trans-inactive-config


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] x11-misc/trans-inactive-config-0.0.2  0 kB [1]

Total size of downloads: 0 kB
Portage overlays:
 [1] /usr/local/xgl-coffee

Do you want me to merge these packages? [Yes/No] yes
>>> Emerging (1 of 1) x11-misc/trans-inactive-config-0.0.2 to /
>>> checksums files   ;-) trans-inactive-config-0.0.2.ebuild
>>> checksums files   ;-) files/digest-trans-inactive-config-0.0.2

!!! Digest verification Failed:
!!!    /usr/portage/distfiles/trans-inactive-config-0.0.2.tar.bz2
!!! Reason: Filesize does not match recorded size
!!! Got:      1771
!!! Expected: 1768

genbox stjepan #

Heheheh :D ...
After doing "ebuild trans-inactive-config-0.0.2 digest" I get:
Code:
genbox stjepan # ACCEPT_KEYWORDS="~amd64" emerge -va trans-inactive-config


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] x11-misc/trans-inactive-config-0.0.2  0 kB [1]

Total size of downloads: 0 kB
Portage overlays:
 [1] /usr/local/xgl-coffee

Do you want me to merge these packages? [Yes/No] yes
>>> Emerging (1 of 1) x11-misc/trans-inactive-config-0.0.2 to /
>>> checksums files   ;-) trans-inactive-config-0.0.2.ebuild
>>> checksums files   ;-) files/digest-trans-inactive-config-0.0.2
>>> checksums src_uri ;-) trans-inactive-config-0.0.2.tar.bz2
>>> Unpacking source...
>>> Unpacking trans-inactive-config-0.0.2.tar.bz2 to /var/tmp/portage/trans-inactive-config-0.0.2/work
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/trans-inactive-config-0.0.2 ...
>>> Source compiled.
>>> Test phase [not enabled]: x11-misc/trans-inactive-config-0.0.2

>>> Install trans-inactive-config-0.0.2 into /var/tmp/portage/trans-inactive-config-0.0.2/image/ category x11-misc
!!! dobin: /var/tmp/portage/trans-inactive-config-0.0.2/work/trans-inactive-config does not exist
man:
prepallstrip:
>>> Completed installing trans-inactive-config-0.0.2 into /var/tmp/portage/trans-inactive-config-0.0.2/image/

>>> Merging x11-misc/trans-inactive-config-0.0.2 to /
--- /usr/
--- /usr/bin/
>>> Safely unmerging already-installed instance...
--- !empty dir /usr/bin
--- !empty dir /usr
>>> Original instance of package unmerged safely.
 *
 * You must run trans-inactive-config to configure and
 * install the trans-inactive binary.
 *
 * Then run "trans-inactive &" as user to enable the effects.
 *
>>> Regenerating /etc/ld.so.cache...
>>> x11-misc/trans-inactive-config-0.0.2 merged.

>>> No packages selected for removal by clean.

>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.


 * GNU info directory index is up-to-date.
 * IMPORTANT: 4 config files in /etc need updating.
 * Type emerge --help config to learn how to update config files.

genbox stjepan #

>>> Install trans-inactive-config-0.0.2 into /var/tmp/portage/trans-inactive-config-0.0.2/image/ category x11-misc
!!! dobin: /var/tmp/portage/trans-inactive-config-0.0.2/work/trans-inactive-config does not exist
* Whats this?

>>> Merging x11-misc/trans-inactive-config-0.0.2 to /
--- /usr/
--- /usr/bin/
* There is no /usr/bin/trans-inactive-config!

Please fix these bugs and I'll modify the howto.
Back to top
View user's profile Send private message
CoffeeBuzz
Apprentice
Apprentice


Joined: 15 Jun 2005
Posts: 269
Location: Canada Eh.

PostPosted: Wed Mar 08, 2006 7:40 pm    Post subject: Reply with quote

Interesting... I dont get that at all, what revision? I'm at 54 here.

OH OH OH ... remove the tarball from /usr/portage/distfiles and redownload it (above isnt using the right tarball).
_________________
HP Pavilion zd7260us
Xgl Overlay: http://svn.xgl-coffee.org/xgl-coffee/trunk
Xgl Forums: http://forums.xgl-coffee.org
Back to top
View user's profile Send private message
stjepan
n00b
n00b


Joined: 02 Mar 2006
Posts: 56

PostPosted: Wed Mar 08, 2006 9:09 pm    Post subject: Reply with quote

CoffeeBuzz wrote:
Interesting... I dont get that at all, what revision? I'm at 54 here.

OH OH OH ... remove the tarball from /usr/portage/distfiles and redownload it (above isnt using the right tarball).
I use revision 55.
Now I get this:
Code:
genbox stjepan # ACCEPT_KEYWORDS="~amd64" emerge -va trans-inactive-config


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] x11-misc/trans-inactive-config-0.0.2  1 kB [1]

Total size of downloads: 1 kB
Portage overlays:
 [1] /usr/local/xgl-coffee

Do you want me to merge these packages? [Yes/No] ye
>>> Emerging (1 of 1) x11-misc/trans-inactive-config-0.0.2 to /
>>> Downloading http://www.tripthelight.net/gentoo/trans-inactive-config-0.0.2.tar.bz2
--22:08:44--  http://www.tripthelight.net/gentoo/trans-inactive-config-0.0.2.tar.bz2
           => `/usr/portage/distfiles/trans-inactive-config-0.0.2.tar.bz2'
Resolving www.tripthelight.net... 208.97.133.30
Connecting to www.tripthelight.net[208.97.133.30]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,768 [application/x-tar]

100%[====================================>] 1,768         --.--K/s

22:08:45 (97.34 KB/s) - `/usr/portage/distfiles/trans-inactive-config-0.0.2.tar.bz2' saved [1,768/1,768]

>>> Resuming download...
>>> Downloading http://ftp.snt.utwente.nl/pub/os/linux/gentoo/distfiles/trans-inactive-config-0.0.2.tar.bz2
--22:08:45--  http://ftp.snt.utwente.nl/pub/os/linux/gentoo/distfiles/trans-inactive-config-0.0.2.tar.bz2
           => `/usr/portage/distfiles/trans-inactive-config-0.0.2.tar.bz2'
Resolving ftp.snt.utwente.nl... 130.89.175.1, 2001:610:1908:8000::175:1
Connecting to ftp.snt.utwente.nl[130.89.175.1]:80... connected.
HTTP request sent, awaiting response... 404 Not Found

    The file is already fully retrieved; nothing to do.

>>> Resuming download...
>>> Downloading http://gentoo.mirror.solnet.ch/distfiles/trans-inactive-config-0.0.2.tar.bz2
--22:08:47--  http://gentoo.mirror.solnet.ch/distfiles/trans-inactive-config-0.0.2.tar.bz2
           => `/usr/portage/distfiles/trans-inactive-config-0.0.2.tar.bz2'
Resolving gentoo.mirror.solnet.ch... 212.101.4.241
Connecting to gentoo.mirror.solnet.ch[212.101.4.241]:80... connected.
HTTP request sent, awaiting response... 404 Not Found

    The file is already fully retrieved; nothing to do.

!!! Couldn't download trans-inactive-config-0.0.2.tar.bz2. Aborting.
genbox stjepan #
Back to top
View user's profile Send private message
pijalu
Guru
Guru


Joined: 04 Oct 2004
Posts: 365

PostPosted: Thu Mar 09, 2006 12:06 am    Post subject: Reply with quote

Nice work... but using a python script to actually patch a c file to configure opacity is a little 8O
So, here comes a patch to the original trans inactive to add command line parameters
Code:

--- trans-inactive.c.ori   2006-03-09 00:11:18.000000000 +0100
+++ trans-inactive.c   2006-03-09 00:59:40.000000000 +0100
@@ -25,14 +25,20 @@
 #include <stdio.h>
 #include <limits.h>
 
+#include <getopt.h>
+
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
 
+
+float _inactive_opacity=0.8,_active_opacity=0.9;
+
 /* Set this to the desired opacity of inactive windows.  The example below
  * sets inactive windows 80% opaque (or, equivalently, 20% transparent).
  */
-#define INACTIVE_OPACITY (0.80 * 0xffffffff)
+#define INACTIVE_OPACITY (_inactive_opacity * 0xffffffff)
+#define ACTIVE_OPACITY (_active_opacity * 0xffffffff)
 
 static Atom
 get_window_type(Display *dpy,
@@ -124,6 +130,16 @@
     return 0;
 }
 
+void
+usage(char* name) {
+  printf("USAGE:\n");
+  printf("%s [options]\n",name);
+  printf("Options:\n");
+  printf("\t-h, --help :\tThis screen...\n");
+  printf("\t-a level, --active level:\t Set active trans. level\n");
+  printf("\t-i level, --inactive level:\t Set inactive trans. level\n");
+}
+
 int
 main(int argc,
      char **argv)
@@ -136,6 +152,59 @@
          _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, window_type;
     XEvent xev;
     
+    /* parse arg */
+    while (0 == 0)
+    {
+      int option_index = 0;
+      int next_option;
+      static struct option long_options[] = {
+   {"help", 0, NULL, 'h'},
+   {"active", 1, NULL, 'a'},
+   {"inactive", 1, NULL, 'i'},
+   {NULL, 0, NULL, 0}
+      };
+
+      next_option =
+   getopt_long (argc, argv, "ha:i:", long_options, &option_index);
+
+      if (next_option == -1)
+   {
+     break;
+   }
+
+      switch (next_option)
+   {
+   case 'a':
+     if (optarg) {
+       if (sscanf(optarg,"%f",&_active_opacity)==EOF) {
+         fprintf(stderr,"Wrong format for active opacity\n");
+         return -1;
+       }
+       if (_active_opacity>=1)
+         _active_opacity=0.999999; /* Xgl don't like 1... */
+     }
+     break;
+   case 'i':
+      if (optarg) {
+       if (sscanf(optarg,"%f",&_inactive_opacity)==EOF) {
+         fprintf(stderr,"Wrong format for inactive opacity\n");
+         return -1;
+       }
+       if (_inactive_opacity>=1)
+         _inactive_opacity=0.999999;
+      }
+      break;
+   default:
+     usage (argv[0]);
+     return -1;
+   }
+    }
+
+    printf("Using following trans. level:\n\t %f active\n\t %f inactive\n",
+      _active_opacity,
+      _inactive_opacity);
+
+   
     dpy = XOpenDisplay(NULL);
     if(!dpy) {
         fprintf(stderr, "Failed to open display\n");
@@ -168,7 +237,7 @@
         for(i = 0; i < ntoplevels; i++) {
             if(toplevels[i] == old_active_window) {
                 set_opacity(dpy, toplevels[i], _NET_WM_WINDOW_OPACITY,
-                            0xffffffff);
+                            ACTIVE_OPACITY);
                 continue;
             }
             
@@ -221,7 +290,7 @@
                         
                         if(active_window != None) {
                             set_opacity(dpy, active_window,
-                                        _NET_WM_WINDOW_OPACITY, 0xffffffff);
+                                        _NET_WM_WINDOW_OPACITY, ACTIVE_OPACITY);
                         }
                         
                         old_active_window = active_window;


With this, you can simply lauch it with needed parameters :
Code:

-a level, --active level : set "level" as "active" trans value
-i level,--inactive level: set "level" as "inactive" trans value


eg:
Code:

trans-inactive -a 0.9 -i 0.4


Have phun
Back to top
View user's profile Send private message
stjepan
n00b
n00b


Joined: 02 Mar 2006
Posts: 56

PostPosted: Thu Mar 09, 2006 7:32 am    Post subject: Reply with quote

pijalu wrote:
Nice work... but using a python script to actually patch a c file to configure opacity is a little 8O
Well, I made it because I wanted to make it to be easy to configure it. If you didn't know, before you had to manually patch it and modify.
But you did a great job, no doubt!
I personally don't like modifying foreign code too much.
Anyway, if you don't want to use my script, just use transd. If is much more powerfull than trans-inactive. I used here trans-inactive just because of simplicity :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum