From 23581a2bcd065e200a77bfde84ec4d26fdf18cc1 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 28 Jul 2018 10:28:27 +0200 Subject: [PATCH] xsession: make compton settings depend on GLX driver --- rc/start.lua | 3 --- xsession | 11 +++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/rc/start.lua b/rc/start.lua index 9178086..7e9b5bd 100644 --- a/rc/start.lua +++ b/rc/start.lua @@ -1,6 +1,3 @@ --- Spawn a composoting manager -awful.util.spawn("compton --backend glx --xrender-sync --xrender-sync-fence --vsync opengl-swc --paint-on-overlay", false) - -- Start idempotent commands local execute = { -- Kill any running nm-applet diff --git a/xsession b/xsession index ba29773..e3baed2 100644 --- a/xsession +++ b/xsession @@ -51,4 +51,15 @@ rfkill block all 2> /dev/null redshift -l 6.666:46.533 -t 6500:3900 2> /dev/null & systemd-run -q --scope --user tmux start-server +case $(glxinfo | awk -F': ' '($1 == "OpenGL vendor string") {print $2}') in + "NVIDIA Corporation") + compton --daemon --backend glx --refresh-rate 60 --vsync opengl-swc --glx-no-stencil --glx-swap-method 4 + ;; + *) + compton --daemon --backend glx --xrender-sync --xrender-sync-fence --vsync opengl-swc --paint-on-overlay + ;; +esac + + + exec awesome