From e833da0303582f3e249f9b211dbb9f7b618b397f Mon Sep 17 00:00:00 2001
From: actionless <actionless.loveless@gmail.com>
Date: Thu, 25 Mar 2021 00:21:04 +0100
Subject: [PATCH] fix(beautiful: gtk): don't crash when both gtk3 and gtk4 are
 installed

---
 lib/beautiful/gtk.lua | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/beautiful/gtk.lua b/lib/beautiful/gtk.lua
index 1ff793838f..7518417fff 100644
--- a/lib/beautiful/gtk.lua
+++ b/lib/beautiful/gtk.lua
@@ -70,7 +70,8 @@ function gtk.get_theme_variables()
 
     local result = {}
     local _gtk_status, Gtk = pcall(function()
-        return require('lgi').Gtk
+        local lgi = require('lgi')
+        return lgi.require('Gtk', '3.0')
     end)
     if not _gtk_status or not Gtk then
         gears_debug.print_warning(
