Code: Select all
#include once "X11/Xlib.bi"
#include once "X11/Xatom.bi"
#include once "X11/Intrinsic.bi"
#include once "X11/extensions/shape.bi"
#include once "X11/Xfuncproto.bi"
#inclib "X11"
#inclib "Xext"
SUB SetWindowOpacity (Level as single)
dim as Display ptr dpy=XOpenDisplay(0)
dim w as integer
screencontrol 2,w
dim as Window parent, root
dim as Window ptr child_list
dim num_children as unsigned long
XQueryTree (dpy, w, @root, @parent, @child_list, @num_children)
dim target_win as Window=parent
dim opacity as ulong=Level * &hffffffff
XChangeProperty (dpy, target_win, XInternAtom (dpy, "_NET_WM_WINDOW_OPACITY", False),XA_CARDINAL, 32, PropModeReplace, cast (ubyte ptr,@opacity), 1)
XSync (dpy, False)
XCloseDisplay (dpy)
end sub
screenres 640,480
dim w as integer
screencontrol 2,w
?"Hello world"
SetWindowOpacity .8
sleep