Post #1942388
2026-05-03 11:31 UTC
A GTK 4 bar in a toot!
#!/bin/env -S LD_PRELOAD=libgtk4-layer-shell.so.0 gjs -m
import G from 'gi://Gtk?version=4.0';
import L from 'gi://GLib';
import D from 'gi://GnomeDesktop?version=4.0';
import S from 'gi://Gtk4LayerShell'
G.init();
let w = new G.Window;
S.init_for_window(w);
[0, 1, 2].map((a) => S.set_anchor(w, a, true));
S.auto_exclusive_zone_enable(w);
w.set_child(new G.Label);
(new D.WallClock).bind_property('clock', w.child, 'label', 2);
w.present();
L.MainLoop.new(null, false).run();
Replies (2)
-
@ralen@social.ralen.top 2026-05-03 13:32
@YaLTeR@mastodon.online tell this guy about the "date" command so he doesn't occupy 5% of his screen with useless placeholder😔
-
@acidiclight@mastodon.social 2026-05-03 14:36
@YaLTeR@mastodon.online everyone knows you can't have the bar without importing that D(esktop)