There's plenty way of doing this but I mostly add apps or scripts that I want to start before Window Manager, I add them to .xprofile
.
So create a magical file named .xprofile
in your home directory. /home/username/.xprofile
.
Add the following contents:
compton --backend glx --vsync opengl &
When you login it should start the apps or scripts you've provided. Alternatively if .xprofile
does not work. You can create the .xinitrc
and use it with the same content.
Extras:
- I highly suggest you to, update compton to picom if you haven't done it yet.
- Create a configuration file in
.config/picom/picom.conf
- Fill the config with sample config.
- After saving your config edit your
.xprofile
with:
picom &
For your screen tearing issue this might solve it as well; after installing proprietary NVIDIA drivers (370 or higher version). Edit: Seems your GPU supports NVIDIA 390, you can install it with this command: sudo apt install nvidia-driver-390
- You can try adding
nvidia-drm.modeset=1
kernel parameter in /etc/grub/default
to GRUB_CMDLINE_LINUX_DEFAULT
, dont forget to update your grub as well with; sudo update-grub
(Source)
If you need anything else feel free to reply :)
Edit 2: First try making .xprofile
and/or .xinitrc
executable with:
$ chmod +x .xprofile
$ chmod +x .xinitrc
If .xprofile
and .xinitrc
doesn't works let's create a configuration and directly start compton
with LXQt Autostart.
- Create a configuration in
/home/username/.config/compton.conf
- Add the following contents;
backend = "glx";
glx-no-stencil = true;
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
glx-no-rebind-pixmap = true;
# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesnât have the effect of --sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
# (Note some VSync methods may not be enabled at compile time.)
vsync = "opengl";
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;
With this you won't have to pass parameters to compton. You can Google it for detailed compton configurations.
I assume you are familiar with LXQt you can just add compton
to Autostart. Preferences
-> Default applications for LXSession
-> Autostart
-> Manual autostarted applications
-> Add
If it doesn't work either you can do something like this;
- Add this to line
~/.config/lxsession/Lubuntu/autostart
(if it doesn't exist create it and make it executable with chmod +x
)
@compton
or
@compton -b
-b
parameter deamonizes the compton.
- Hopefully compton will start with session.