Hi, I'm using your widget in my awesomewm configuration but the presence of GTK3 and GTK4 is causing issues with this widget.
In line 23 you are accessing the get_default function of the class IconTheme. This is only available on GTK3 but I assume on my machine the GTK instance on lgi is loaded as GTK4 so this call fails as attempting to call a nil value.
local icon_theme = lgi.Gtk.IconTheme.get_default()
The fix is really simple. You just load a specific version of GTK beforehand by using the require function of lgi.
local Gtk = lgi.require('Gtk', '3.0')
local icon_theme = Gtk.IconTheme.get_default()
The Gtk table can also be used in the next line when accessing the IconLookupFlags attribute.
This is the diff.
23,24c23,25
< local icon_theme = lgi.Gtk.IconTheme.get_default()
< local IconLookupFlags = lgi.Gtk.IconLookupFlags
---
> local Gtk = lgi.require('Gtk', '3.0')
> local icon_theme = Gtk.IconTheme.get_default()
> local IconLookupFlags = Gtk.IconLookupFlags
Hi, I'm using your widget in my awesomewm configuration but the presence of GTK3 and GTK4 is causing issues with this widget.
In line 23 you are accessing the
get_default
function of the classIconTheme
. This is only available on GTK3 but I assume on my machine the GTK instance on lgi is loaded as GTK4 so this call fails as attempting to call a nil value.The fix is really simple. You just load a specific version of GTK beforehand by using the
require
function of lgi.The Gtk table can also be used in the next line when accessing the
IconLookupFlags
attribute.This is the diff.
Please consider including this patch.
Thanks for creating this widget. JMH