Author Topic: tweaking i3  (Read 11888 times)

0 Members and 1 Guest are viewing this topic.

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
tweaking i3
« on: 26. September 2015, 11:53:36 »
@irenicus9 pointed out that this board should have a thread about customizing i3 to encourage people to come up and share with their own ideas and tweaks.
I would like to start out with the usage of Compton:
The current ISO comes with Compton preinstalled and configured only for the sake of real transparency and the reason for that is practically only because there is a Conky, too. Would there not be a Conky in the background urxvt's built in fake transparency would do the job just fine, but since it's not real transparency the Conky would disappear behind transparent windows and you will suddenly see an empty wallpaper there ...  ::)
In the config I had turned off shadows, blurring and fading completely.

Intrigued by the other Compton thread I have now come back to try the other functions of Compton again, too.
For a start I am using most of the settings of @irenicus9 's original config
  • the fading is really nice and cool, I like it but then - I like the snappiness of instantly opening windows and switching workspaces even better ;) :)
  • blurring is turned off in that one, too and I'm not changing it. I made the experience that it just slows down my machine a lot
  • now, the shadows are nice, too and I think it's especially funny that when I switch on a window title bar it's being rendered slightly in the background of its window - I think that's kind of funny! ;D But:
Unfortunately Compron's shadows are a real problem with Conky... ???
I have added
Code: [Select]
shadow-exclude = [ "class_g ?= 'Conky'" ]; In other environment that works fine, but it depends on the Conky config also. The only setting for own_window_type that works in i3 is 'override' because neither of the other options (normal, desktop, dock, panel) will make you happy, I promise! :o :P
Any ideas? If not, that means you will have to decide: Conky or shadows, or ... ... Conky with shadows ... ;) >:D
« Last Edit: 26. September 2015, 12:03:23 by oberon »
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline Airblader

  • Jr. Mitglied
  • **
  • Posts: 93
  • I'm new. Be nice!
  • Desktop: i3-gaps
  • Skill: Advanced
Re: tweaking i3
« Reply #1 on: 26. September 2015, 16:37:29 »
Here's my compton config: https://github.com/Airblader/dotfiles-manjaro/blob/master/.compton.conf

It contains a few tricks that I'll happily explain later on when I have time. :)

Offline Airblader

  • Jr. Mitglied
  • **
  • Posts: 93
  • I'm new. Be nice!
  • Desktop: i3-gaps
  • Skill: Advanced
Re: tweaking i3
« Reply #2 on: 26. September 2015, 20:02:34 »
Here it goes!

Code: [Select]
shadow-exclude = [ "class_g" = 'Dmenu'" ]
This is to suppress shadows on dmenu which can look pretty good depending on how you use it.

Code: [Select]
shadow-exclude = [ "class_g" = 'i3-frame'" ]
Disables shadows on i3 frame windows. For example, if you want the window decorations to not cast shadows. It's a matter of taste, but you have the option. Note that this won't work until you have i3 4.11 or later.

Code: [Select]
shadow-exclude = [ "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" ]
Disable shadows on hidden windows. Windows in i3 are hidden if they are in a stacked or tabbed container, but not currently the active one in that container. Setting this is really useful to prevent shadows "stacking up" in such containers – without this, the more tabs you have open, the stronger the shadow is (which is ugly).

Code: [Select]
shadow-exclude = [ "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'" ]
Disable shadows on sticky windows, which is only available with i3 4.11 or later. Also a matter of taste, but I like sticky windows to be more plain.

Code: [Select]
opacity-rule = [
  "93:class_g = 'URxvt' && !_NET_WM_STATE@:32a",
  "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
  "75:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'"
];

This does a few things at once. With this config, my urxvt terminals are slightly transparent, but only if they aren't fullscreened, sticky or hidden. Any hidden window is made completely transparent, which is *really* cool, again, for stacked/tabbed containers. Try opening a browser and a transparent terminal in a stacked container and without this, you notice that the browser is visible behind the terminal. With this, the browser will be invisible. Also for stacked terminals this is super useful as text from the other terminal "shining through" can be really confusing.

Lastly, it gives sticky windows some transparency. Just because I like it as this way I have some view on what is underneath that window.

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: tweaking i3
« Reply #3 on: 26. September 2015, 21:08:31 »
Cool! Thank you very much!
Would you by any chance also have an idea how to address Conky? It has its own window, but what is it (class? name?) Or how to find out? xprop doesn't work on conky... ???
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline Airblader

  • Jr. Mitglied
  • **
  • Posts: 93
  • I'm new. Be nice!
  • Desktop: i3-gaps
  • Skill: Advanced
Re: tweaking i3
« Reply #4 on: 26. September 2015, 23:48:26 »
xprop does work, but it seems that when using override redirect, conky doesn't set any window properties (which is why the xprop output is empty). I don't see why that makes sense. You should file a bug against conky and explain that window hints are useful even if the window isn't managed (for example for compton, xdotool, …).

There's the workaround to manually set the class on the conky windows, but I failed to find a way to automate this (and I tried going through /proc/…/environ as well) because conky just sets absolutely nothing, which is ridiculous and wrong. And having to do it by hand on every boot isn't exactly a great option.

conky is clearly to blame here because it operates under a wrong assumption.

Offline Airblader

  • Jr. Mitglied
  • **
  • Posts: 93
  • I'm new. Be nice!
  • Desktop: i3-gaps
  • Skill: Advanced
Re: tweaking i3
« Reply #5 on: 26. September 2015, 23:54:52 »

Offline Airblader

  • Jr. Mitglied
  • **
  • Posts: 93
  • I'm new. Be nice!
  • Desktop: i3-gaps
  • Skill: Advanced
Re: tweaking i3
« Reply #6 on: 27. September 2015, 00:07:14 »
One possible workaround in the meantime is to match

Code: [Select]
shadow-exclude = [ "override_redirect" = "true" ]
In fact you could also call this a solution. It can (and will) match more windows than just conky, but this could even be what a user wants.

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: tweaking i3
« Reply #7 on: 27. September 2015, 00:45:41 »
One possible workaround in the meantime is to match
Code: [Select]
shadow-exclude = [ "override_redirect" = "true" ]
Brilliant, thank you so much for this! :)
Just the quotes are not right like that. It needs to be:
Code: [Select]
[ "override_redirect = true" ]
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: tweaking i3
« Reply #8 on: 27. September 2015, 01:15:13 »
It can (and will) match more windows than just conky, but this could even be what a user wants.
Hm, in fact it seems to match all windows here ... ???
At least as soon as this is applied I don't get any shadows at all, while Compton does not throw any error about that line.
Also a strange thing happens: As soon as I do not exclude dmenu-shadows urxvt becomes a lot less transparent :o
« Last Edit: 27. September 2015, 01:22:47 by oberon »
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline Airblader

  • Jr. Mitglied
  • **
  • Posts: 93
  • I'm new. Be nice!
  • Desktop: i3-gaps
  • Skill: Advanced
Re: tweaking i3
« Reply #9 on: 27. September 2015, 13:26:34 »
Yeah. I have no idea why this happens, to be honest. Maybe a compton bug? Or maybe due to i3's weird ways of doing framing? This works for me, but of course matches differently:

Code: [Select]
"override_redirect = 1 && !WM_CLASS@:s"
Of course once conky resolves the bug, this stops working, though nothings stops you from already also matching on class_g = Conky.
« Last Edit: 27. September 2015, 13:28:19 by Airblader »

Offline irenicus09

  • Jr. Mitglied
  • **
  • Posts: 70
    • irenicus09
  • Desktop: i3
  • GPU Card: Ati Radeon HD 8750m
  • GPU driver: free
  • Kernel: 4.3
  • Skill: Intermediate
Re: tweaking i3
« Reply #10 on: 27. September 2015, 22:13:14 »
@oberon: I just saw your post, and I'm really happy to see that you took the initiative to get us going. I hope to contribute too from time to time and hopefully if we do well it might draw the attention of more i3 users.

 Thanks again oberon :)
« Last Edit: 27. September 2015, 23:33:22 by irenicus09 »

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: tweaking i3
« Reply #11 on: 27. September 2015, 23:38:41 »
Code: [Select]
"override_redirect = 1 && !WM_CLASS@:s"
Yes, that works! Brilliant, thanks! :)
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: tweaking i3
« Reply #12 on: 28. September 2015, 12:47:42 »
Cool thing is that when you use a little bit longer shadows they are even visible for the 2px windowframes 8)



Awesome! ;D
So since I finally know how to shadow-exclude Conky ::) this can be included in the 15.09 release which is being built right now and I have also preconfigured a tiny bit of fading but commented out by default. I just like to show off how snappy and lightning fast this i3 is on manjaro 8)
Here's the new compton.conf
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline Airblader

  • Jr. Mitglied
  • **
  • Posts: 93
  • I'm new. Be nice!
  • Desktop: i3-gaps
  • Skill: Advanced
Re: tweaking i3
« Reply #13 on: 28. September 2015, 13:02:48 »
Cool :) I'd really recommend putting my opacity rule for hidden windows in there as well. It's almost mandatory if you use shadows ;)

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: tweaking i3
« Reply #14 on: 28. September 2015, 13:04:43 »
Ah. Damn, I forgot that :o ::)
Yes, will add it :)
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin