freenode/#clim - IRC Chatlog
Search
5:34:42
beach
loke: Since you recommended Cinnamon to me, I was wondering whether you know how such things are structured. Do you?
5:35:42
loke
The clipboard stuff certainly drags you into that world whether you want to or not. :-)
5:36:38
beach
... which prompted me to suggest a revival of the Eclipse window manager that my students wrote a long time ago.
5:37:36
beach
I think I also learned that a "panel" is a single applications so that the applets are "plugins" or Javascript programs. If so, a panel could be written in Common Lisp I presume.
5:39:09
beach
What I am aiming for is a collection of Common Lisp code that can work on a GNU/Linux desktop running (say) Gnome, but also as a preparation for the desktop on a system like CLOSOS or Mezzano.
5:40:05
beach
So, do you have suggestions about what is doable in Common Lisp without ditching all of Gnome or all of Cinnamon, etc?
5:41:44
loke
I did that when I was running StumpWM; integrating desktop notifications for example, and controlling spotify via the Common Lisp window manager.
5:42:02
loke
There is a Dbus library for Common Lisp that I was using (it's written by death_ on #lisp)
5:43:21
loke
there is a large set of standardised commands that your program can expose, so you can say for example: "Increase volume", or "Play next" or whatnot. The application in charge of the respective service will then respond to that message.
5:43:55
loke
Yes, it's a wire protocol that exposes a simple RPC mechanism, where the exposed functions conform to published interfaces so that "Play next" will work regardless of what music player you're using.
5:44:33
loke
Yes. The command names are strings that form a path of sorts, something like /services/mediaplayer/playNext or whatnot
5:45:20
loke
A Common Lisp music player can implement the same interfaces and then you'll be able to control it from existing applications.
5:46:00
loke
The desktop notifciations is another such service. I implemented a desktop notification thingy in CLIM, running insite the window manager itself, from which I could control and view the notifications.
5:46:25
beach
This is excellent information. It suggests that someone could start writing small components in Common Lisp.
5:47:54
loke
You can type the following command to list the services that are published in your current session:
5:48:16
loke
dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
5:49:40
loke
There are other methods you can call that display the avalable methods on a given object
6:36:33
beach
From reading the Dbus tutorial, I take it that this entire infrastructure is needed only in traditional kernel-based operating systems, and that it won't be required in CLOSOS. Right?
6:43:12
loke
beach: This is for integration between different processes, running on different runtimes, written in different languages, and part of different desktop environments even.
6:44:26
loke
beach: Abotu the print job. Yes, that's exactly what happens. So if you want your Lisp environment to hook into that, they just listen to events from the printer subsystem and act on those.
6:44:56
loke
Notifications can contain questions, and you can send replies back to the entity that sent it (like clickong on "retry" print job for example)
6:45:46
loke
There is an argument to the notification that contains the alternatives that should be presented to the user.
6:45:49
beach
Looking at the Dbus tutorial, it is screaming for a CLOS abstraction layer to be used on top of the protocol in applications. I assume that's what death_ did.
6:47:04
loke
I think what is needed is a way to define abstractions on top of known services. death_ only provided the low lever primitives.
6:48:32
loke
When calling functions, the dbus library provides WITH-INTROSPECTED-OBJECT which returns a function that can be applied like a normal Lisp function.
6:48:47
loke
this specific usage: https://github.com/lokedhs/stumpwm-dbus/blob/master/src/media.lisp#L19
6:50:31
loke
Dbus supports returning multiple values, which death_ matted to regular multiple values in Lisp. Here's the simplest possible implementation of a Dbus service (the function that returns the version and name): https://github.com/lokedhs/stumpwm-dbus/blob/master/src/dbus-server.lisp#L42
6:51:46
loke
So for a project, what would be neat is if there was a library that provided a more Lisp-based interface to the desktop services. The library would know about common services like notifications, media player, printing, etc.
7:28:30
loke
beach: If you have the ‘qdbus’ command, that gives you a nicer commandline tool to play with dbus
7:36:26
loke
I have the qt5 version installed but it gives me an error it can't find the qt4 dependencies
7:37:27
loke
beach: OK, then it should be fine. the text-based qdbus interface is pretty easy to use
7:38:08
beach
I am willing to believe that. But I need to know a bit more about how and what to do with the available services.
7:39:23
loke
I just played around with the file manager Dbus interface. You can use it to, for example, open a file manager window ooking at a given location
7:42:03
loke
(usually the file manager always runs, since it manages the desktop so that you can put files on the desktop)
7:43:07
loke
You can also send a ShowFolders command to that Dbus endpoint, and the filemanager will start automatically. It did for me when I tested
7:45:40
beach
Typing qdbus org.freedesktop.FileManager1 gives a list of paths that I don't know what to do with.
7:49:15
loke
qdbus org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowFolders file:///etc ''
7:51:06
beach
Except I could never have guessed what to type. I need to be more systematic about searching for this information I guess.
7:52:45
loke
The naming is annoying, in that they always prefix the names with a reverse-domain-name, so you end up with lots of repitiions.
7:53:40
loke
That's a qdbus thing. In a programming language API, these are mapped to the list/array/whatever primitives in the respective language.
7:54:13
beach
I mean, I could not have figured out from that information what arguments to pass to the command-line interface.
7:54:16
loke
qdbus has some way of indicating a list... I seem to recall it's square brackets (like ‘[foo,bar,test]’ but I'm not sure. It must be documented somewhere.
7:57:55
loke
I had documentation that documented the arguments that the notification service uses, and I had to translate that to the Lisp form
8:00:56
beach
I need to digest all this information and also look into what death_ did. Maybe later, I'll play around with a few lines of Common Lisp code.
15:29:34
jackdaniel
some useful hints for consideration: https://uxdesign.cc/how-white-space-killed-an-enterprise-app-and-why-data-density-matters-b3afad6a5f2a
16:16:32
scymtym
i was sick and traveling, so i missed #708. is there a reason some methods are specialized on ENCAPSULATING-STREAM and some on STANDARD-ENCAPSULATING-STREAM? same for using/not using DEF-STREAM-METHOD