#Lua #dbus #lgi #gobjectintrospection
Я, Матье Бал.
Короче, что я сделал, чтобы заработало это говно?
Пообщался вновь с ИИ. Она дала идею выбросить йухан ваш vtable, ибо он не нужон.
А ещё и понадабавил парочку хуйни.
ссылка

Итог:

(luajjit:<pid>): Lgi-WARNING **: <HH:MM:SS.ms>: Error raised while calling 'lgi.cbk (function: 0x7fdb3946c940): GObject': /usr/share/lua/5.1/lgi/override/GLib-Variant.lua:97: bad argument #2 to '?' (string expected, got nil)
Помогло добавление фигурных скобок...

Завелось блять!!!

Но а что мне теперь делать с
vtable ?

#Lua #D-Bus #dbus #GTK #gobjectintrospection
@rur @rf

Ребят, нужна помощь с написанием кода.
Задача: Хочу написать на Lua простой скрипт, создающий D-Bus службу (В идеале org.kde.StatusNotifierWatcher) , к которой можно достучаться через dbus-send или gdbus. Пробовал через ИИ, который даже написал, но... Сталкиваюсь с нккоторыми ошибками, а именно:
1)

luajit: ./proxyserver.lua:62: bad argument #5 to 'bus_own_name' (GObject.Closure expected, got function) stack traceback: [C]: in function 'bus_own_name' ./proxyserver.lua:62: in function 'start' main.lua:25: in main chunk [C]: at 0x55b22012ed70Вызывается здесь: Gio.bus_own_name( Gio.BusType.SESSION, interface_name, Gio.BusNameOwnerFlags.NONE, on_bus_acquired, on_name_acquired, on_name_lostИз ошибки ясно, что bus_own_name ожидал GObject.Closure, а получил функцию(-и). Спросил у ИИ, стоит ли заворачивать в GObject функцию, на что получил отказ по причине "GObject умеет сам заворачивать, если делать автоматически" и прилагает Вариант 1 (ссылка) (который у меня ± в коде). Ладно, обернул сам...

Но теперь сталкиваюсь со второй ошибкой:
(luajit:30598): Lgi-WARNING **: 00:28:04.678: Error raised while calling 'lgi.cbk (function: 0x7f4efadd87c0): GObject': ./proxyserver.lua:51: bad argument #4 to 'register_object' (GObject.Closure expected, got userdata)
Вызывается здесь:
local on_bus_acquired = function(connection, name) connection:register_object('/org/example/MyObject', iface, vtable) end
Та же ошибка, но теперь получает не функцию, а userdata. На этот раз предлагает два варианта
(ссылка): Обернуть в GObject.Closure или преобразовать vtable в Gio.DBusInterfaceVTable (Что у меня это УЖЕ есть). Ладно, обернём в GObject.Closure ещё раз.

Ещё один запуск... Запустился без ошибок. Звучит неплохо, но а теперь самая мякотка...

Отправить сигнал:
dbus-send --session --print-reply \ --dest=org.example.MyInterface \ /org/example/MyObject \ org.example.MyInterface.SayHelloилиgdbus call --session \ --dest org.example.MyInterface \ --object-path /org/example/MyObject \ --method org.example.MyInterface.SayHello
И вот тут ловим ошибку:
(luajit:25911): Lgi-WARNING **: HH:MM:SS.ms : Error raised while calling 'lgi.cbk (function :0x7f5b60662de0): GObject': /usr/share/lua/5.1/lgi/override/GObject-Closure.lua:286: attempt to call upvalue 'target' (a userdata value) И вот тут я встал. Вроде всё запустилось, но сигнал принимает с ошибкой. ЧЯДНТ (Кроме того, что я использовал ИИ для решения этой задачи)?

На всякий случай:

OS: Artix Linux / Void Linux
Packages (Artix):
dbus-glib 0.114-1 dbus 1.16.2-1.1 lua-lgi 0.9.2-14 lua51-lgi 0.9.2-14 glib2 2.88.0-1 gobject-introspection 1.86.0-2
Packages (Void):
dbus 1.16.2_2 lua51-lgi 0.9.2_6 glib2 2.88.0_1 gobject-introspection 1.86.0_2

dbus is less terrible than I'd thought. libnotify however...

#linux #dbus

So, this is now working (small protocol change), but I'm missing the rather important functionality of sending notifications.
The issue seems to be with watching the `org.freedesktop.Notifications` dbus interface, as it's not notifying me.

Specifically, `dbus_watch_get_enabled` returns `false`, which seems wrong… been debugging for a few hours and no luck yet. Do I know anyone who might have a clue about this?

#DBus #Pebble
https://git.allpurposem.at/mat/rockwork/src/branch/mat/qt6/rockworkd/platformintegration/desktop/notificationmonitor.cpp#L293

rockwork/rockworkd/platformintegration/desktop/notificationmonitor.cpp at mat/qt6

rockwork - postmarketOS port of RockWork: https://gitlab.com/muhammad23012009/rockwork

Gitcoffee: Git with a mug of coffee

For anyone interested in #Linux security, a good explanation of a way to escape from the #Flatpak sandbox has been posted to the oss-security mailing list today: https://www.openwall.com/lists/oss-security/2026/05/19/1

You might also want to read this article from last year: https://www.linuxjournal.com/content/when-flatpaks-sandbox-cracks-real-life-security-issues-beyond-ideal

cc @Seg

#sandboxing #dbus #xdg #freedesktop #wine

oss-security - On the issue of MIME handlers that execute arbitrary code (e.g. Wine)

Age verification laws force a terrible choice: hand over your ID or submit to a facial scan.

I built vrpd (Null ID Initiative) in Go—a local D-Bus interceptor for Linux. It allows voluntary restriction without surveillance. It’s a negative tool: it requests not to be admitted, rather than proving age or identity.

Parents could protect children easily, with zero surveillance.

Code:
https://github.com/ni-initiative/ni-initiative

#linux #golang #privacy #dbus #AgeVerification #DigitalRights #OnlineSafety

GitHub - ni-initiative/ni-initiative: The Null ID initiative. A voluntary restriction provider.

The Null ID initiative. A voluntary restriction provider. - ni-initiative/ni-initiative

GitHub
If you're in need of a thread-safe, native #C++, implementation of #DBus I recommend DBus-ASIO. (As seen at #FOSDEM!)
https://github.com/dbus-asio/dbus-asio #disclaimer #imadethis

I've released KDE Desktop Operations - a D-Bus event-to-command daemon for KDE Plasma. I've tried to bring back the feature "Run a command" in #kde but the MR didn't move anywhere in more than a year. So I created a daemon in rust you run as a user which can do the same and more.

https://codeberg.org/cryptomilk/kdo

#plasma #dbus #zbus

kdo

KDE Desktop Operations - a D-Bus event-to-command daemon for KDE Plasma. kdo = kay do

Codeberg.org

#Linux became #slopware. The best #GNU/Linux distro still depends on #AI
slop. #Hurd is not ready yet. #Hyperbola #BSD needs support in order to
fully properly switch from a #GNU/Linux OS to a GNU? #BSD one.

Depressing times, but maybe enlightening ones too. Linux since 1996 was
just a corporate workauround to drive commercial Unix tools on it.

In the end #IBM won. My tip for the #GN[U] develoepers for #GUIX:
consider Unix dead. Don't try to resurrect it. It's finished, rotten,
bloated, propietarized, outdated. Ironically the licensed GPLv2 kernel
with less blobs than Linux came from AT&T and it's Unix 2.0.
They already did Unix better than Unix itself. Either you focus and enhance
#Hurd, or lose against the blobslop OS. Make an outstanding FS on Hurd.
Give more rights to the user than the shitty layers of #dbus/#polkit and the
like to fix the lack of proper namespaces on Linux.
I said 'proper', Plan9/9front it's light years ahead.
Don't get just 'well enough' with X11/wayland. You can do better stuff.
Ditto with Emacs, forget coreutils, reimplement everything you
can with jitted Elisp and Elisp code replacing these outdated Unix
tools. Eshell can be a better shell. The 9front folks already did it
with 'rc' simplyfing Unxi shells to the extreme.

On #digitalrights I agree with #lunduke but not for the rest of #israel whitewashing.

On #systemd and #age requeriments and #potential user surveillance:

https://nitter.tiekoetter.com/LundukeJournal/status/2034623870448046258#m

Stay the f*ck away from #gnome, #wayland and #systemd. #dbus it's s pest too, but at least you can fake machine-id at boot with trivial ease.

The Lunduke Journal (@LundukeJournal)

Moderators of the r/Linux subreddit are now censoring posts which talk about Age Verification. Not only are posts being removed, but I’ve heard from multiple Reddit users who have been banned from r/Linux for expressing opposition to Age Verification.

Nitter