The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
4

Compton shadows on floating windows *only*

asked Jun 4 '14

wuxmedia gravatar image

Hi, Long time user, always found my answers on here, or just worked it out.

So the title says it all really, as a previous post says shadows are a bit pointless on a tiler. But... on a floating window, that would look great, and help pick the window out from the existing tiles (I have just colour for a wall, right now) I don't always float, but when I do I'd like shadows!

Compton allows exclusions on WM_class, so: I have tried xprop and xwininfo to see if there is a difference between floaters as far as X is concerned. None that I can see.

Compton allows wintypes exclusions: No idea where the wintype info is, the above apps seem not to show them.

Tried googling for that but not much luck.

I have tried entering into the compton conf some guesses (float/ing/ed) for wintypes. No Joy. This maybe more of a compton question, but it does relate to i3, I think as I'm not sure if compton can pick out the floats, I can't be the only person to wish this, can I?

Anyway, thanks for listening.

If it's impossible, I'll just not bother with compton. Cheers, WuX

Comments

There is no such thing as a "floating" wintype in any spec. Your options would be to request a feature for the property in core (and try to be persuasive) or amend the ipc (add-on) interface for a "floating" event and write your own extension.

TonyC gravatar imageTonyC (Jun 14 '14)edit

Thanks TonyC - I was hoping you'd answer this one. I had the feeling that it wouldn't be an easy fix. I might have a look at the ipc thing - see if i can work out how to do it. I'm really enjoying compton.

wuxmedia gravatar imagewuxmedia (Jun 14 '14)edit

It's definitely possible to do, but it might take some understanding of X11. Improving compatibility with compton is definitely something I would like to work on in the future.

TonyC gravatar imageTonyC (Jun 15 '14)edit

I also asked for this, a way to select windows by its state: "for_window [state='floating'] move to .....".

tigrezno gravatar imagetigrezno (Jul 21 '14)edit

well - In the end I just disabled the shadow on my terminal windows, then it didn't look so weird but the notifications etc look nice and shadowy :)

wuxmedia gravatar imagewuxmedia (Apr 8 '15)edit

2 answers

Sort by » oldest newest most voted
2

answered Jun 15 '14

zolar gravatar image

updated Jul 21 '14

In compton.conf, add

"! \_COMPTON_SHADOW@:32c = 1 && ! name ^= '[i3 con] floatingcon around'"

to the "shadow-exclude" line

Then we need an "ugly_workaround_script.sh" (I use busybox here)

#!/bin/bb

ombra() {    
    local active=$(xprop -notype -root _NET_ACTIVE_WINDOW)
    local status=$(xprop -notype -id ${active##*\ } _COMPTON_SHADOW)
    if [ "$status" = "_COMPTON_SHADOW = 1" ]; then
        xprop -id ${active##*\ } -remove _COMPTON_SHADOW
    else
        xprop -id ${active##*\ } -f _COMPTON_SHADOW 32c -set _COMPTON_SHADOW 1
    fi
}

ombra

exit 0

In i3/config add

set $float exec --no-startup-id path_to/ugly_workaround_script.sh, floating toggle

and replace all "floating toggle" with $float, e.g.

bindsym $mod+space $float
for_window [instance="^mpv$"] $float, workspace video

Comments

Excellent work Zolar! muchas gracias I will try this out as soon as I can, (X) Props for finding a workaround!

wuxmedia gravatar imagewuxmedia (Jun 21 '14)edit
1

answered Jun 9 '14

phairland gravatar image

The only thing you can do in i3 is changing the thickness of the window border.

Comments

Thanks for the workaround phairland, in a similar move, I just made the shadows really tight and the same colour as the borders, so it kinda blends in.

wuxmedia gravatar imagewuxmedia (Jun 14 '14)edit

Cool hack! But I'm getting an error when starting Compton: Pattern "! _COMPTON_SHADOW@:32c = 1 && ! name ^= '[i3 con] floatingcon around'" pos 2: Empty target. Here is the line from my compton.conf shadow-exclude = [ "! \_COMPTON_SHADOW@:32c = 1 && ! name ^= '[i3 con] floatingcon around'" ];

ViktorNova gravatar imageViktorNova (Jul 11 '14)edit

Should work. I'm using the git version.

zolar gravatar imagezolar (Jul 21 '14)edit

Question Tools

2 followers

Stats

Asked: Jun 4 '14

Seen: 1,459 times

Last updated: Jul 21 '14