Compton doesn't start automatically on XFCE

Hello guys,
I installed compton on XFCE on Fedora 25 to fix the X tearing issues.
I created the following autostart file to make it start with Fedora:

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Compton
Comment=Compton Compositor
Exec=compton -CG --config ~/.config/.compton.conf
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

However it doesn’t start.
Oddly enough the other autostart files that I created work.
Also if I start it from Terminal manually with the same command:
compton -CG --config ~/.config/.compton.conf

…it runs without problems.

What am I missing here?

Any particular reason you’re avoiding the auto startup tab in the settings?

Are you talking about this? It’s the same file and it’s enabled in here as well.

Yup, and is screen compositing disabled in the window tweaks settings?

Yes. It’s disabled.

Weird, does it autorun if you don’t use a cutom config?

If I remember correctly you have to go to that next tab, Session, and save the config for it to actually apply at start up.

I remember it from messing around with the idea from this link - KDE/XFCE hybrid

No.

The session tab is for saving your sessions e.g. like Hibernate. I think it’s useful if you want to launch with a particular set of applications. I did try it though, but it didn’t work for Compton.

Why are you pointing it to it’s default config with the --config flag?

Does the config contain any errors? Double check it.

Here’s a guide that should still be relevant:

Oh and make sure your checkbox for save session at logout is not ticked, next thing i’d do is log in as root and delete your home/you/.cache/sessions, see if it resolves the issue

I tried it without the --config option but it doesn’t use the settings from the config file without it.

You are correct, my bad it’s been too long since I last messed around with compton, xfce and such. Looked into it a bit though.

Remove the desktop file and edit the startup entry with the following exec: /usr/bin/compton -b --config ~/.config/compton.conf (-b flag is for starting it as a background daemon)

You had a typo in your desktop entry. You were adding “.compton.conf” instead of “compton.conf”. Happens to everyone at some point haha. That should work perfectly. The desktop entry is not needed as the command will run on startup.

If you have issues with the edges and such post back.

EDIT:

I should have added, if you want to use the desktop file use the following:

[Desktop Entry]
Name=Compton
Comment=Compton Compositor
Exec=compton -CGb --config ~/.config/compton.conf

Sorry my brain is fried at the moment haha.

If you don’t have this song playing …

then Compton won’t start automatically on XFCE.

Well actually my config file is named .compton.conf so it’s not a typo in the command, but rather in the file name.
Oddly enough compton did start this time when I tried it without the --config option.

Btw the desktop entry and the startup entry are the same thing - the startup entry creates a desktop entry when I save it.

So I removed the dot from the filename and corrected the startup entry, but it still wouldn’t start.

Solution: Finally I used the config file from the guide @KoalaAteMySnack provided, then I deleted the desktop entry.
Created a new startup entry in the settings without any additional options i.e. the command is just “compton” and now it runs smoothly. For some reason it wouldn’t start with options as a startup entry, only from terminal.
However it would appear that with that config file those options are unnecessary and since this is the default config file (with the dot removed), it doesn’t need pointing to anyway.

So thanks guys, now it works :slight_smile:

1 Like

Ok,
If I have to be completely honest, I didn’t test it thoroughly enough last time.
Compton does start and most of the tearing is gone, but I did notice that there is some tearing in YouTube videos now.
Any idea if I should change some of the settings in the config file to fix this?

~]$ compton --vsync opengl

Might do the trick

Does it happen specifically in fullscreen? The Arch Wiki says -

Flicker

Applies to fully maximized windows (in sessions without any panels) with the default compton.conf caused and resolved by the following option:

unredir-if-possible = false;

Fullscreen tearing

If you observe screen tearing of video playback only in fullscreen mode see above.

1 Like

This fixed the tearing completely.
There’s still some full screen flickering though.