There is the procedure gimp-drawable-offsets
. If called with a layer id, it will return the offsets in x- and y-direction as a list.
Example via the Script-Fu console:
> (gimp-layer-set-offsets 2 42 23) (#t) > (gimp-drawable-offsets 2) (42 23)
The first command offsets the layer with id 2 by 42 pixels in x- and 23 pixels in y-direction. The layer id is an educated guess I made; for real purposes you'd have to determine a suitable id, e.g. the currently active layer: gimp-image-get-active-layer
.
The second command return the offsets as a list, in order to access them as numbers you can use the standard Scheme procedures car
and cdr
(and their concatenation shortcuts, such as cadr
):
> (car (gimp-drawable-offsets 2)) 42 > (cadr (gimp-drawable-offsets 2)) 23