add layer-shell, todo list
This commit is contained in:
parent
76b919baed
commit
10154115bf
@ -8,6 +8,16 @@ More seriously: you might prefer this over another status bar program
|
|||||||
if you want fine-grained control over what is shown in your bar and
|
if you want fine-grained control over what is shown in your bar and
|
||||||
you are happy to exert that control in a Lua-based Lisp language.
|
you are happy to exert that control in a Lua-based Lisp language.
|
||||||
|
|
||||||
|
## Plan
|
||||||
|
|
||||||
|
* [X] use gtk-layer-shell to put it in a layer
|
||||||
|
* [] update only at relevant intervals
|
||||||
|
* [] do we need file poll support? prolly not if we're calling every 200ms
|
||||||
|
* [] cache icon pixbufs
|
||||||
|
* [] update image/label widget instead of destroying
|
||||||
|
* [] allow height customisation
|
||||||
|
|
||||||
|
|
||||||
```fennel
|
```fennel
|
||||||
(bar
|
(bar
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
(local {: Gtk
|
(local {: Gtk
|
||||||
|
: GtkLayerShell
|
||||||
: Gdk
|
: Gdk
|
||||||
: GdkPixbuf
|
: GdkPixbuf
|
||||||
: GLib
|
: GLib
|
||||||
@ -61,6 +62,24 @@
|
|||||||
: update
|
: update
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
(fn make-layer-shell [window layer exclusive? anchors]
|
||||||
|
(let [s GtkLayerShell]
|
||||||
|
(s.init_for_window window)
|
||||||
|
(s.set_layer window (. {
|
||||||
|
:top GtkLayerShell.Layer.TOP
|
||||||
|
}
|
||||||
|
layer))
|
||||||
|
(if exclusive? (s.auto_exclusive_zone_enable window))
|
||||||
|
|
||||||
|
(each [edge margin (pairs anchors)]
|
||||||
|
(let [edge (. {:top GtkLayerShell.Edge.TOP
|
||||||
|
:bottom GtkLayerShell.Edge.BOTTOM
|
||||||
|
:left GtkLayerShell.Edge.LEFT
|
||||||
|
:right GtkLayerShell.Edge.RIGHT}
|
||||||
|
edge)]
|
||||||
|
(GtkLayerShell.set_margin window edge margin)
|
||||||
|
(GtkLayerShell.set_anchor window edge 1)))))
|
||||||
|
|
||||||
(local bars [])
|
(local bars [])
|
||||||
|
|
||||||
(fn bar [{ : anchor : orientation : indicators }]
|
(fn bar [{ : anchor : orientation : indicators }]
|
||||||
@ -85,6 +104,9 @@
|
|||||||
(indicator:update)))
|
(indicator:update)))
|
||||||
true))
|
true))
|
||||||
(each [_ b (ipairs bars)]
|
(each [_ b (ipairs bars)]
|
||||||
|
(make-layer-shell b.window :top true
|
||||||
|
(collect [_ edge (ipairs b.anchor)]
|
||||||
|
edge 1))
|
||||||
(b.window:show_all))
|
(b.window:show_all))
|
||||||
(Gtk.main))
|
(Gtk.main))
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
, fetchurl
|
, fetchurl
|
||||||
, gobject-introspection
|
, gobject-introspection
|
||||||
, gtk3
|
, gtk3
|
||||||
|
, gtk-layer-shell
|
||||||
, lib
|
, lib
|
||||||
, librsvg
|
, librsvg
|
||||||
, lua53Packages
|
, lua53Packages
|
||||||
@ -33,7 +34,12 @@ in stdenv.mkDerivation {
|
|||||||
|
|
||||||
inherit fennel;
|
inherit fennel;
|
||||||
|
|
||||||
buildInputs = [ lua gtk3 gobject-introspection.dev ];
|
buildInputs = [
|
||||||
|
gobject-introspection.dev
|
||||||
|
gtk-layer-shell
|
||||||
|
gtk3
|
||||||
|
lua
|
||||||
|
];
|
||||||
nativeBuildInputs = [ lua makeWrapper ];
|
nativeBuildInputs = [ lua makeWrapper ];
|
||||||
|
|
||||||
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
||||||
|
Loading…
Reference in New Issue
Block a user