// _NET_WM_WINDOW_OPACITY get // This isn't part of the EWMH spec, but is widely used by drop in // compositing managers (i.e., xcompmgr, cairo-compmgr, etc.). // This property is typically set not on a client window, but the *parent* // of a client window in reparenting window managers. // The float returned will be in the range [0.0, 1.0] where 0.0 is completely // transparent and 1.0 is completely opaque. func WmWindowOpacityGet(xu *xgbutil.XUtil, win xproto.Window) (float64, error) { intOpacity, err := xprop.PropValNum( xprop.GetProperty(xu, win, "_NET_WM_WINDOW_OPACITY")) if err != nil { return 0, err } return float64(uint(intOpacity)) / float64(0xffffffff), nil }
// _NET_WM_HANDLED_ICONS get func WmHandledIconsGet(xu *xgbutil.XUtil, win xproto.Window) (bool, error) { reply, err := xprop.GetProperty(xu, win, "_NET_WM_HANDLED_ICONS") if err != nil { return false, err } val, err := xprop.PropValNum(reply, nil) if err != nil { return false, err } return val == 1, nil }
// _NET_SHOWING_DESKTOP get func ShowingDesktopGet(xu *xgbutil.XUtil) (bool, error) { reply, err := xprop.GetProperty(xu, xu.RootWin(), "_NET_SHOWING_DESKTOP") if err != nil { return false, err } val, err := xprop.PropValNum(reply, nil) if err != nil { return false, err } return val == 1, nil }
// _NET_CURRENT_DESKTOP get func CurrentDesktopGet(xu *xgbutil.XUtil) (uint, error) { return xprop.PropValNum(xprop.GetProperty(xu, xu.RootWin(), "_NET_CURRENT_DESKTOP")) }
// _NET_WM_PID get func WmPidGet(xu *xgbutil.XUtil, win xproto.Window) (uint, error) { return xprop.PropValNum(xprop.GetProperty(xu, win, "_NET_WM_PID")) }
// _NET_WM_DESKTOP get func WmDesktopGet(xu *xgbutil.XUtil, win xproto.Window) (uint, error) { return xprop.PropValNum(xprop.GetProperty(xu, win, "_NET_WM_DESKTOP")) }
// _NET_NUMBER_OF_DESKTOPS get func NumberOfDesktopsGet(xu *xgbutil.XUtil) (uint, error) { return xprop.PropValNum(xprop.GetProperty(xu, xu.RootWin(), "_NET_NUMBER_OF_DESKTOPS")) }
// _NET_WM_USER_TIME get func WmUserTimeGet(xu *xgbutil.XUtil, win xproto.Window) (uint, error) { return xprop.PropValNum(xprop.GetProperty(xu, win, "_NET_WM_USER_TIME")) }
// _NET_WM_SYNC_REQUEST_COUNTER get // I'm pretty sure this needs 64 bit integers, but I'm not quite sure // how to go about that yet. Any ideas? func WmSyncRequestCounter(xu *xgbutil.XUtil, win xproto.Window) (uint, error) { return xprop.PropValNum(xprop.GetProperty(xu, win, "_NET_WM_SYNC_REQUEST_COUNTER")) }