You are not logged in.

#1 2009-04-13 06:36:47

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Getting window transparency on startup

Hi all,
I'm sure there's been hundreds of threads about transparency but I haven't been able to find one that addresses my situation. I downloaded xcompmgr and transset-df. So far I've been able to get the shadows the way I want with xcompmgr but I can't seem to get Window Transparency as default. What I mean is that when I startx I get my blank screen (using ScrotWM with only bare basics installed onto system) and then I open a program, say Swiftweasel (see screenshot), it appears non-transparent until I manually type:  transset-df 0.7  hit enter and select the window. I'm using Lilyterm as my terminal but it has it's own Transparency settings, in case you're wondering about the screenshot.

Anyway, I was just wondering if there was a way I could configure xcompmgr to get Transparent Windows on startup or use transset-df to do it or create some sort of shell script (using zsh). To clarify, I was wanting ALL windows to be Transparent (to specified degree) by default, without having to manually type, set and select each and every new window as it opens. If I missed something in the --help files for each of these programs then I'm sorry. Any help is appreciated. Thanks.

http://i60.photobucket.com/albums/h3/bu … 0_arch.png

Last edited by milomouse (2009-04-13 06:41:55)

Offline

#2 2009-04-13 07:27:20

Wra!th
Member
Registered: 2009-03-31
Posts: 342

Re: Getting window transparency on startup

What you want is not possible using a window manager like ScrotWM, unless:
1. You write a script that checks all windows open and sets transparency with transset-df (using the --id switch).To get IDs use `xwininfo -all -root` (will output A LOT of crap among which all open clients and their window IDs. That script will need to rescan like every max 1 second since you can't (by default) tell it when you open a new window. It just has to be prepared...
2. Hack the source Luke...Make the wm itself issue transset-df on every new client

The latter would of course be a bit harder, but will be faster...
What I'm puzzled about it why would you use such a lightweight wm and burden it so? sad

P.S. If you're up for change, I do believe someone made xmonad have all (but the selected window) transparent, and he's quite content with the result.

Last edited by Wra!th (2009-04-13 07:31:14)


MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Offline

#3 2009-04-13 20:07:36

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Getting window transparency on startup

Ah, I see, I see. As far as Xmonad goes, I'm not too familiar with Haskell and ended up moving on to other twm's. I know you're a ratpoison user yourself and have -wanted- to use ratpoison as my main WM for some time but (despite it's name) I wanted better mouse support as I move so swiftly with it (usually just browse the web and such and am an avid user of mouse gestures, so I miss that sort of functionality in WM's - also why I used awesome3 for a while, which I may reconsider). In ratpoison I can only seem to focus a window with hit the H+T Tab command (or directional arrow). The only time I can select a window with the mouse is when it's a web browser or a file manager (can't click and focus a terminal, for example).

Anyway, sorry to go off on ratpoison nostalgia but what I'm getting at is that I have such a fast system that I -want- the lightweight WM so that the transparency function is less latent. If that makes sense. I enjoy the distinct fade that allows every window to have a similar texture; for me it's about having less eye-strain, as well, as I usually use the computer after dark.

Sooo, upon reassessing the situation, I may take your [insinuated] advice and dump transparency all together, or I may tamper with the source (depends on how ambitious I feel), but most likely I may just stick with minimal transparency and not 100% of open windows. Depends, I guess. I was mainly just seeing if it was possible with a WM like this, and lo and behold; the answer! I thank you, friend. Sorry for just throwing these questions out there but I couldn't find an answer on my own.

Last edited by milomouse (2009-04-13 20:08:57)

Offline

#4 2009-04-13 22:29:53

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: Getting window transparency on startup

Apparently devilspie supports opacity setting, although I never got it to work, so I did this:
1. Install devilspie
2. Create a the ~/.devilspie folder, and inside this create a file named opacity.ds with the following:
(spawn_async (str "transset-df -i " (window_xid) " .80"))
3. Put "devilspie -a &" in your .xinitrc

This has worked wonderfully for me, and appears to be fast enough that I'd forgotten I was even using an external program to do it.

Last edited by HashBox (2009-04-14 00:54:32)

Offline

#5 2009-04-14 00:12:37

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Getting window transparency on startup

HashBox,
I can't seem to get devilspie to work for transparency. hmm I installed the package and made sure by:

[19:39:35][milo@neverland][~]: Qi devilspie
Name           : devilspie
Version        : 0.22-3
URL            : http://www.burtonini.com/blog/computers/devilspie
Licenses       : GPL  
Groups         : None
Provides       : None
Depends On     : libwnck>=2.24  
Optional Deps  : None
Required By    : None
Conflicts With : None
Replaces       : None
Installed Size : 116.00 K
Packager       : Aaron Griffin <aaron@archlinux.org>
Architecture   : x86_64
Build Date     : Mon 15 Dec 2008 12:38:12 PM EST
Install Date   : Mon 13 Apr 2009 07:17:51 PM EDT
Install Reason : Explicitly installed
Install Script : No
Description    : x11 window matching utility

Created directory, checked to see if it was successfully made:
(Tried ~/devilspie  first, but googled and saw others with ~/.devilspie instead, so tried that next. No effect)

[19:49:16][milo@neverland][~]: mkd ~/.devilspie
[19:49:23][milo@neverland][~]: la
.Xauthority  .dmenu_cache  .gtk-bookmarks  .mozilla/        .vimperator/   installed.txt
.adobe/      .fehbg       .gtkrc-2.0       .mplayer/        .xinitrc       installed_less.txt
.aurvote     .fehrc       .histfile       .recently-used.xbel    .xinitrc.save  muzak/
.cache/      .fontconfig/  .ivman/       .serverauth.4339    .zcompdump     vide/
.config/     .gconf/       .links/       .sw3/        .zshrc
.dbus/         .gconfd/       .local/       .thumbnails/        Desktop/
.devilspie/  .gnome2/       .macromedia/    .viminfo        foto/

Changed to directory and created file called: opacity.ds     , checked to see if it was successfully made:

[19:49:26][milo@neverland][~]: cd ~/.devilspie 
[19:51:07][milo@neverland][~/.devilspie]: nano opacity.ds
(spawn_async (str "transset-df -i " (window_xid) " .80"))
##### saved #####
[19:51:44][milo@neverland][~/.devilspie]: la 
opacity.ds

CD back to ~ and edited .xinitrc:

[19:54:33][milo@neverland][~/.devilspie]: cd ; nano .xinitrc

##############################
##  .xinitrc configuration  ##
##                          ##
##"    you were pretty      ##
##     before you knew    " ##
##############################

# bait the trap
xcompmgr -cC -t-3 -l-5 -r5 -I0.02 -O0.03 -D4 -fF -o.25 &
devilspie -a &
eval `cat $HOME/.fehbg`
# kill the squeak
xset -b
# and execute
exec scrotwm

Restarted X (no effect), then restarted computer, and still there didn't appear be any difference in opacity. hmm Made sure it was 'running' by:

[19:56:14][milo@neverland][~]: ps 
UID        PID  PPID  C STIME TTY          TIME CMD
milo      4255  4254  0 19:35 tty1     00:00:00 -zsh
milo      4339  4255  0 19:38 tty1     00:00:00 /bin/sh /usr/bin/startx
milo      4355  4339  0 19:38 tty1     00:00:00 xinit /home/milo/.xinitrc -- /etc/X11/xinit/xserverrc
milo      4364  4355  0 19:38 tty1     00:00:00 scrotwm
milo      4365  4364  0 19:38 tty1     00:00:00 devilspie -a
milo      4366  4364  0 19:38 tty1     00:00:00 xcompmgr -cC -t-3 -l-5 -r5 -I0.02 -O0.03 -D4 -fF -o.25
milo      4488  4394  0 19:40 pts/1    00:00:00 nano .xinitrc
milo      4648  4388  0 19:56 pts/0    00:00:00 ps -fa

Any ideas? I may have misunderstood your directions or something, I don't know. Unless I'm missing something?

Offline

#6 2009-04-14 00:37:33

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: Getting window transparency on startup

I use transparency just for urxvt in xmonad using this in my xmonad.hs. The setOpacity function is taken from Xmonad.Hooks.fadeInactive. This is the module that Wra!th is referring to I believe.

setOpacity :: Window -> Integer -> X ()
setOpacity w t = withDisplay $ \dpy -> do
    a <- getAtom "_NET_WM_WINDOW_OPACITY"
    c <- getAtom "CARDINAL"
    io $ changeProperty32 dpy w a c propModeReplace [fromIntegral t]

and in my manage hook I have:

    , [ className =? "URxvt" --> (ask >>= \w -> liftX (setOpacity w 0xd9999998) >> idHook)]

This makes it easy to set the transparency based on window class or title. At the moment I only use it for urxvt transparency. I'm not overly confident with Haskell yet myself.To come up with that I recieved assistance on the XMonad mailing list. The list is quite active at the moment and the people very helpful.

Offline

#7 2009-04-14 01:03:27

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: Getting window transparency on startup

Sorry milomouse I did indeed mean ~/.devilspie, but since you used that I'm not sure why it isn't working, I see you have started xcompmgr and everything. My .xinitrc basically has a section with:

wmaker)
 xcompmgr -c -f &
 devilspie -a &
 wmaker
 ;;

So that isn't the issue. I also have the opacity.ds named as all.ds, but I'm pretty sure that doesn't make a difference either.
An idea, try running devilspie -a from a terminal once you have a few windows open, for me I see:

[~/.devilspie 0] devilspie -a
Set Property to 0.8
Set Property to 0.8
Set Property to 0.8
Set Property to 0.8
Set Property to 0.8
Set Property to 0.8
Set Property to 0.8
Set Property to 0.8
Set Property to 0.8
Set Property to 0.8
^C
[~/.devilspie 0]

So devilspie is working correctly and transset-df is obviously setting opacity for all windows I have open.
I'm not too sure what else to suggest at this point, I'm pretty sure I've covered everything :\

Offline

#8 2009-04-14 01:23:58

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Getting window transparency on startup

Hashbox,
I tried my .xinitrc exactly as yours (except with scrotwm instead of wmaker, of course) and it still does nothing. I open about 5 windows, usually a couple terminals, web browser, file manager and cd burning software. I tried removing devilspie -a & from my .xinitrc and restarting, then manually typing devilspie -a into a terminal but it just goes down a space and sits there without doing anymore output (same as when I had it on startup and manually tried it). I end up stopped it with CTRL+C (note that I waited 4 minutes until I stopped it) :

[21:16:02][milo@neverland][~]: devilspie -a
^C
zsh: suspended  devilspie -a
[21:20:51][milo@neverland][~]:

I don't know what I'm doing wrong. hmm I tried renaming it to all.ds as well, just to see if that did make a difference. Nay. I'm either missing some listless dependency or my video card doesn't cut it, I don't know. It should, though. I'll investigate some more to see if I can find someone else with this problem on the web. Thank you though, at least this is another option I can consider and hopefully it will work out. If I find anything I'll post it here.


@mikesd,
That indeed looks nice. I may give xmonad another go.

Last edited by milomouse (2009-04-14 01:27:09)

Offline

#9 2009-04-14 04:33:57

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: Getting window transparency on startup

milomouse wrote:

@mikesd,
That indeed looks nice. I may give xmonad another go.

Well I don't call it nice as I don't fully understand the syntax but it works for me. Hopefully one day I will. smile

Most of the tiling window managers are fairly low level. I'm sure most can do something similar.

Offline

#10 2009-04-14 06:28:40

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: Getting window transparency on startup

I think the only other thing to consider with my solution is that the window manager is missing some form of required functionality, whether this is EWHM hints or something else I'm not sure, but it is another possibility.

Offline

#11 2009-04-14 06:38:06

Wra!th
Member
Registered: 2009-03-31
Posts: 342

Re: Getting window transparency on startup

milomouse wrote:

Ah, I see, I see. As far as Xmonad goes, I'm not too familiar with Haskell and ended up moving on to other twm's. I know you're a ratpoison user yourself and have -wanted- to use ratpoison as my main WM for some time but (despite it's name) I wanted better mouse support as I move so swiftly with it (usually just browse the web and such and am an avid user of mouse gestures, so I miss that sort of functionality in WM's - also why I used awesome3 for a while, which I may reconsider). In ratpoison I can only seem to focus a window with hit the H+T Tab command (or directional arrow). The only time I can select a window with the mouse is when it's a web browser or a file manager (can't click and focus a terminal, for example).

Anyway, sorry to go off on ratpoison nostalgia but what I'm getting at is that I have such a fast system that I -want- the lightweight WM so that the transparency function is less latent. If that makes sense. I enjoy the distinct fade that allows every window to have a similar texture; for me it's about having less eye-strain, as well, as I usually use the computer after dark.

Sooo, upon reassessing the situation, I may take your [insinuated] advice and dump transparency all together, or I may tamper with the source (depends on how ambitious I feel), but most likely I may just stick with minimal transparency and not 100% of open windows. Depends, I guess. I was mainly just seeing if it was possible with a WM like this, and lo and behold; the answer! I thank you, friend. Sorry for just throwing these questions out there but I couldn't find an answer on my own.

Xmonad is not THAT hard to setup once you get a config going.
If you want a ratpoison-like wm but with click to focus, try stumpwm. it's almost a ratpoison clone (with added features) written and configured entirely with Common Lisp. That too is not too hard to configure

P.S. I can't believe I forgot about devilspie big_smile


MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Offline

#12 2009-04-14 06:50:38

dunz0r
Member
From: Sweden
Registered: 2009-03-30
Posts: 258
Website

Re: Getting window transparency on startup

I suggest Awesome. You can quite easily make it change the transparency on focus switch. It's also a damn good WM smile


RTFM or GTFO
hax0r.se

Offline

#13 2009-06-09 19:41:22

m3tr0g33k
Member
From: Staffordshire, UK
Registered: 2008-05-04
Posts: 22
Website

Re: Getting window transparency on startup

I feel your pain, milomouse.
Wrote some long complex stuff to get transparent windows for openbox, back in the day:

http://wiki.archlinux.org/index.php/Xte … ansparency

and then fiddled with all sorts of things to get what I wanted.

Then I thought: lightweight? lightweight? with my 64bit dual core laptop never even warming up properly even recompiling the kernel?
Compared to _other_ OS's we're already Arch-lightweight SO I got compiz, emerald and AWN (I still use conky for all my system reporting).

I am now happy, get per-app trans when I want it and LOTS more options than I would ever need, but still play with sometimes. Sometimes I see compiz  in the 'top' listing - sometimes with as much as 2% cpu when spinning a 3D cube of 4 desktops.

I think this is money well spent. Of course, my 333MHZ Pentium II Sony N505 is still set up with openbox and no compositing...

Sorry all you super frugals - once I was like you smile

PS emerald can be fussy YMMV, but there is always gtk-window-decorator and lxappearance for the simpler things in life.


___
Change is inevitable; progress less so.

Offline

#14 2009-06-09 20:08:45

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Getting window transparency on startup

mikesd: Thanks for sharing that! I guess I won't need to use xcompmgr anymore, right?

Offline

#15 2009-06-10 07:24:57

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: Getting window transparency on startup

Ashren wrote:

mikesd: Thanks for sharing that! I guess I won't need to use xcompmgr anymore, right?

No. You still need xcompmgr as xmonad doesn't have built in support for compositing. Not unless it has snuck into the latest darcs version?

Offline

#16 2009-06-10 07:53:02

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Getting window transparency on startup

mikesd: Alright, I don't think XMonad will get built in support for compositing anytime soon. Why use the above code when urxvt can handle real transparency itself?

Offline

#17 2009-06-10 12:14:33

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: Getting window transparency on startup

Ashren wrote:

mikesd: Alright, I don't think XMonad will get built in support for compositing anytime soon. Why use the above code when urxvt can handle real transparency itself?

Yeah, good point. urxvt can handle transparency itself and also allows you to set the foreground/background transparency separately. When using urxvt's built in transparency the window border is not transparent. I think most people prefer to set the background transparency and leave the foreground opaque. Using urxvt's transparency settings works well in these cases.

I like the entire window, including, border, transparent as it looks better to me on my setup. Therefore I use this method. I'm also playing with fadeInactive. I saw someone, maybe on the screenshots thread... not sure, disable borders altogether and use a slight change in either terminal colors or transparency to indicate the focused window. This looked cool to me. I guess doing it in xmonad just gives you more options to play with. YMMV. smile

Offline

#18 2009-06-10 13:46:40

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: Getting window transparency on startup

http://en.gentoo-wiki.com/wiki/X.Org/Transparency

This could be a valuable read, it was when I was setting up a similar desktop.

The xbindkeys section could be especially valuable to you

Offline

#19 2009-06-11 05:49:54

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Getting window transparency on startup

mikesd: Thanks for clarifying. I'm also using fadeInactive, but I think I'll try use your code as well, because it looks interesting and of course it also gives me an excuse to tinker with xmonad.hs. smile

Offline

Board footer

Powered by FluxBB