A day with compton

in #linux8 years ago

Recently I discovered a pretty piece of software – something that bumps my productivity when using Linux – a launcher named Albert. It’s pretty wonderful, install it, set it to run on startup, configure a proper hotkey, and there you go. Summon it whenever you need to do calculation, web search, open a file, run some commands, or even tell your machine to reboot itself. It is like a more powerful version of the Windows start menu but with less resource consumption as well as more customizability, a dream come true? I guess so.

The only catch is, on Arch Linux, you need to compile it from source. Nothing big, they provided you a script, and all you have to do is to not run it on battery power because why on earth would you do something like that on battery power?

After installing, let’s summon it up using my designated hotkey (Ctrl + Space)…

image.png

...ew.


The black box indeed looks ugly.

I’m not too unfamiliar with it – it is actually something that happen pretty commonly on Linux. If you are not using a complete desktop environment such as GNOME or KDE (yes, on Linux it is possible to strip down anything you don’t want and using an incomplete desktop is totally fine, just imagine using Windows with only explorer.exe and no other desktop services?), you might see this too. It is caused by the fact that the windowing system on Linux is pretty much barebone, it does nothing more than providing access to your mouse, showing some windows, allowing you to drag them around, probably stretch and squeeze them, then at last you can kill them by clicking on the X button. That’s part of the reason why Linux can be as lightweight as you need it to be, it comes with basically nothing and you put those extras into it on your own.

Let’s get to topic – what caused it? The answer is pretty simple – I don’t have a compositing manager.

The compositing manager is something like a piece of software that helps to handle all those transparency effects on your windows, as the name states, allows a part of your desktop to be made up of distinct components. As I mentioned, it is totally okay to strip this thing down because I don’t need it, but not anymore, since I think I need it now. Let’s try to get one.

If you still remember my very old post on why I love Linux, I mentioned about compiz, a window manager that allows you to turn your desktop into a Christmas tree. If you missed it or you wonder how Christmas-tree-like it can go, just do a Google search on “compiz”. Basically rotating your workspaces like a cube, have a bunch of stars trailing your cursor, etc. If you are smart, you will have noticed – since compiz can show a bunch of stars trailing the cursor, it should also be a compositing manager, right? Yes, it is, but I am now using a barebone setup which involves using another window manager, and two window mangers cannot coexist. So we need another solution.

Actually I knew the solution for a long time :P It’s compton.


Basically, it is the best no-crap compositing manager you can get on Linux. A tiny installation size combined with the amount of options and flexibility, there is literally nothing to complain. Well, there is, it comes with some bugs but it doesn’t affect me that adversely so I’ll just overlook it. Plus, it gives some nice fading animation for literally everything, so it can be considered as a lightweight eye candy :) I would appreciate that.

2018-07-17-20-18-05.gif

Let’s get it like this.

sudo pacman -Syu compton

Then, run it up.

compton

image.png

A little better, at least some transparency now. But the borders are still pretty ugly, let’s try to get rid of it.

At first, I thought that I will need to dig through the manual to learn how to edit configuration files to make it happen, but apparently no. Compton allows you to pass arguments to it pretty much directly and there is no need for fancy config files. Happy for me!

To get rid of that ugly boxes, just tell compton that I don’t want shadows on transparent windows. Then, I want to reduce the time it spends on fading, then some miscallenous tweaks that I don’t remember why I applied (probably the manual convinced me that by applying these I can solve a few bugs and improve performance for fullscreen apps, if I am not mistaken uh).

-D is for the time in milliseconds used for fading, and --shadow-exclude ‘argb’ just tells it to not put shadows on transparent windows, in which Albert is one. So this line is included in my list of auto-starting applications.

compton -D 3 --unredir-if-possible --paint-on-overlay --shadow-exclude 'argb' &

& is just there because of syntax. I have other applications to run after this so it must be there.

Now, everything looks perfect!

A little better, at least some transparency now. But the borders are still pretty ugly, let’s try to get rid of it.

At first, I thought that I will need to dig through the manual to learn how to edit configuration files to make it happen, but apparently no. Compton allows you to pass arguments to it pretty much directly and there is no need for fancy config files. Happy for me!

To get rid of that ugly boxes, just tell compton that I don’t want shadows on transparent windows. Then, I want to reduce the time it spends on fading, then some miscallenous tweaks that I don’t remember why I applied (probably the manual convinced me that by applying these I can solve a few bugs and improve performance for fullscreen apps, if I am not mistaken uh).

-D is for the time in milliseconds used for fading, and --shadow-exclude ‘argb’ just tells it to not put shadows on transparent windows, in which Albert is one. So this line is included in my list of auto-starting applications.

compton -D 3 --unredir-if-possible --paint-on-overlay --shadow-exclude 'argb' &

& is just there because of syntax. I have other applications to run after this so it must be there.

Now, everything looks perfect!

image.png

And yes, sin(Pi) is really 0.


Again, this is one of the good parts of Linux systems, you get to tweak almost everything, and have cute useful stuff like Albert :) it might be a little daunting to newbies anyway. It’s okay, you can always fall back and use something newbie friendly like Ubuntu.

Now, time to tweak window opacity for non-focused windows for the sake of aesthetics...not putting it here then, see you next time :D

--Lilacse

Sort:  

Hello @lilacse, thank you for sharing this creative work! We just stopped by to say that you've been upvoted by the @creativecrypto magazine. The Creative Crypto is all about art on the blockchain and learning from creatives like you. Looking forward to crossing paths again soon. Steem on!

Not good enough to post it there I guess :P

I still have some other things to tweak (my to-do list is pretty long), so probably I will write on them sooner or later...lol.

Thanks for stopping by~

Btw try adding this to your .bashrc or .bash_profile:

export PS1="\[\033[1;36m\]\u\[\033[01;37m\]@\[\033[01;34m\]\h\[\033[01;30m\][\[\033[01;37m\]\w\[\033[01;30m\]]\[\033[01;32m\]\[\033[00m\]+ "

image.png

I just wanted to do something like that and you gave me the solution! Thanks :D And I love the [ ] around my directory, that makes things significantly clearer!

Haha cool, glad you like it. I got it from a free shell server that I used to be part of anapnea.net. Here is it is for future reference: https://github.com/kurtcoke/bashscripts/blob/master/.bashrc#L4
You can also check my wiki: https://yoirtuts.com/index.php?title=Main_Page

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.083
BTC 64414.57
ETH 1751.02
USDT 1.00
SBD 0.44