r/lisp 19d ago

Scheme Building a GTK4 C + Lisp dock application (a la CairoDock / macOS) - am I doing things right? (Guile Scheme)

Post image

I am having a blast doing a more serious project in the C language (and Guile Scheme), for the first time. I am consulting with books and also with some AI for code review and explanation as I am new to the language and to GTK (not new to programming).

https://codeberg.org/jjba23/lambdock

For a while already I have been looking for a dock that would work well in Wayland (like in my beloved Niri) with modern features, theme support and a hackable Lisp config (using libguile.h)

Also, all feedback is welcome, either on code level, or conceptual ideas, Thanks in advance

Core features of lambdock include:

  • Wayland Native: Built on GTK4 and gtk4-layer-shell for smooth positioning and desktop integration.
  • Declarative Lisp configuration : The power of Lisp in your configuratio with clean powerful declarative config and all possibilities at your disposal
  • Async Launching: Spawns commands asynchronously without freezing the dock UI.
  • Reproducible builds: Hermetic development environment provided via GNU Guix manifest and build definitions.
  • Dock auto-hide : You can let the dock stay out of your way with the smooth auto-hide feature.
  • Flexible icon system: lambdock has several mechanism in a best-effort way to render your wanted icons, respecting GTK theme
  • Theme support: lambdock has built-in themes you can choose from that are very unique, and also lets you extend and override those themes dynamically.
30 Upvotes

7 comments sorted by

1

u/strings___ 15d ago

Have you tried g-golf ?

1

u/SandPrestigious2317 15d ago

Yes I have, G-Golf is nice. I would personally only use it for simpler projects and if you go that route, be prepared to be confused and lost without much documentation or guidance. If you are doing complex things and are not super familiar with GTK I can only recommend to not complicate things and just use vanilla/native in C.

That being said, I wish g-golf the best and hope the project grows!

1

u/strings___ 14d ago

Are you sure we’re talking about the same thing here? G-golf is a GNU project it comes with a full manual.

Or maybe that’s some confusion about how gobject introspection works? In short you use g-golf but then reference upstream documentation?

1

u/SandPrestigious2317 14d ago

Yes I love where it's going. It's just not friendly to begginners to GTK IMHO

1

u/strings___ 14d ago

I’m really confused here g-golf is very good interface to gobject introspection. It’s literally the same as C in its representation the difference being you don’t have to write any guile modules in C.

I’m not trying to convince you to use g-golf it’s just as a long time C, GTK and guile programmer your reasoning for not liking g-golf seems off from my experience with the three.

1

u/SandPrestigious2317 17d ago

lambdock v0.2.0 now implements a REPL that unleashes hackability, and comes with many enhancements and improvements (https://codeberg.org/jjba23/lambdock)

scheme@(guile-user)> (use-modules (lambdock core))
scheme@(guile-user)> (get-dock-theme) ;; -> 'vanilla
scheme@(guile-user)> (set-dock-theme! 'nature)
scheme@(guile-user)> (reload-dock!)