-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal start #12
Comments
@Eloitor Let's write the base in zig (watched an introductory video about the language yesterday :-p). What do you say? |
I like Zig, but sadly it is not easy to set up, it is not available in many distros: https://repology.org/project/zig/versions In void linux (what I use) it is stuck at 0.10.1 for some months... https://github.com/void-linux/void-packages/issues?q=Updating+Zig+to+0.11.0 The upgrade from 0.10.1 to 0.11.0 is not backward compatible. Further updates may not be as well.. Other options we can consider:
Do you have other suggestions? If not, for me the clear winner is C. But we can work with Zig 0.10.1 if you want, it is nice to learn. |
River can work with a tcl config! https://gist.github.com/Eloitor/5b4b96311e0867057114b266245671b0 Maybe we can use river to get a prototype of the configuration that we wish to have |
C it is then :-) I mean Haskell would be a dream, but also a bit too much work for me upfront.
Looks good, let's take a tiny subset of this. As a minimum, I'm thinking:
Same here! |
what about something like this?
|
After thinking about it I think that adopting tk syntax is better:
|
That's awesome. Yes, tk syntax for user events that call tcl procs. We will need to work around the fact that At some point, though, I would love to do something like: package require goose
set M Mod4
set S Shift
bind . <$M-Q> close [goose::get_current_window]
bind . <$M-$S-Q> close [goose::get_all_windows] |
Yes we'll have to do something like that. Maybe we can adapt something already done.
Maybe even better if it is a variable:
|
We can also use tk to prototype some possible configurations: #!/bin/env wish
wm title . "Goose"
set bindings_help {Keybindings:}
rename bind original_bind
proc bind {path binding action description} {
global bindings_help
append bindings_help "\n $description"
original_bind $path $binding $action
}
bind . <c> {spawn foobar} "c: Create window"
bind . <d> {pack forget [focus]} "d: Delete window"
bind . <e> {exit} "e: Exit"
label .keybindingsInfo -text $bindings_help -anchor n -justify left
pack .keybindingsInfo -side left -anchor w -fill both
namespace eval goose {
variable window {}
variable next_id 1
}
proc spawn {command} {
set win_name [join ".textBox $goose::next_id" ""]
append goose::windows $win_name
text $win_name
pack $win_name -fill both -expand true -side left
$win_name insert 1.0 $win_name
incr goose::next_id
} |
We also need syntax for place a new window on coordinades X, Y. And move a window to coordinates X, Y (with optional configurable animation). |
We can take ideas for window placement from https://blog.teclado.com/side-values-in-tkinters-pack-geometry-manager/ |
Excellent stuff. I say we aim for #12 (comment) as a minimal config and polish the syntax as we go. Maybe we can start with a tcl (without tk) syntax. Still need to look at how to make tk minimally support wayland, whether it would be better to roll our own or to adopt a third-party project. Tried compiling tinywl but it fails due to a deprecated renderer initialisating step. And it builds against wlroots 0.15. So I'll hunt for a more up-to-date project to use as a guide. |
Maybe we can see what undroidwish did... https://stackoverflow.com/a/48026908 |
Yes, will need to do some source diving there and see the least amount of work needed to get tk running natively. That project seems to bundle a version of the entire tcl environment, so I'll need to parse out just the parts we want. Hopefully, what we're trying to achieve with tk isn't as daunting as it first appears. |
What about using Critcl? |
That would be really cool. Maybe not the super low-level stuff, but for all the "wm" logic, critcl would be fantastic. |
I made a template for void: # Template file for 'critcl'
pkgname=critcl
version=3.2
revision=1
hostmakedepends="tcl tcllib"
depends="tcl gcc"
short_desc="Compiled Runtime In Tcl"
maintainer="Eloi Torrents <eloitor@disroot.org>"
license="TCL"
homepage="https://andreas-kupries.github.io/critcl/"
distfiles="https://github.com/andreas-kupries/critcl/archive/refs/tags/${version}.tar.gz"
checksum=20061944e28dda4ab2098b8f77682cab77973f8961f6fa60b95bcc09a546789e
do_build() {
DESTDIR=${PKGDESTDIR} tclsh build.tcl doc install
}
do_install() {
DESTDIR=${PKGDESTDIR} tclsh build.tcl textdoc ${DESTDIR}/usr/share/doc/${pkgname}
DESTDIR=${PKGDESTDIR} tclsh build.tcl install
}
do_check() {
tclsh build.tcl test
} I'm not adding it to void packages yet because |
@Eloitor |
🔥 |
The text was updated successfully, but these errors were encountered: