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 2014-06-04 08:14:47 +0000

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

edit retag flag offensive close merge delete

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 ( 2014-06-14 07:09:33 +0000 )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 ( 2014-06-14 08:27:22 +0000 )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 ( 2014-06-15 03:33:04 +0000 )edit

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

tigrezno gravatar imagetigrezno ( 2014-07-21 19:04:40 +0000 )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 ( 2015-04-08 11:42:27 +0000 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2014-06-15 23:21:35 +0000

zolar gravatar image

updated 2014-07-21 16:26:43 +0000

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
edit flag offensive delete link more

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 ( 2014-06-21 08:38:20 +0000 )edit
1

answered 2014-06-09 17:33:58 +0000

phairland gravatar image

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

edit flag offensive delete link more

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 ( 2014-06-14 08:32:01 +0000 )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 ( 2014-07-11 20:55:38 +0000 )edit

Should work. I'm using the git version.

zolar gravatar imagezolar ( 2014-07-21 16:16:56 +0000 )edit

Question Tools

2 followers

Stats

Asked: 2014-06-04 08:14:47 +0000

Seen: 1,459 times

Last updated: Jul 21 '14