Пример #1
0
// _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
}
Пример #2
0
// _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
}
Пример #3
0
// _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
}
Пример #4
0
// _NET_CURRENT_DESKTOP get
func CurrentDesktopGet(xu *xgbutil.XUtil) (uint, error) {
	return xprop.PropValNum(xprop.GetProperty(xu, xu.RootWin(),
		"_NET_CURRENT_DESKTOP"))
}
Пример #5
0
// _NET_WM_PID get
func WmPidGet(xu *xgbutil.XUtil, win xproto.Window) (uint, error) {
	return xprop.PropValNum(xprop.GetProperty(xu, win, "_NET_WM_PID"))
}
Пример #6
0
// _NET_WM_DESKTOP get
func WmDesktopGet(xu *xgbutil.XUtil, win xproto.Window) (uint, error) {
	return xprop.PropValNum(xprop.GetProperty(xu, win, "_NET_WM_DESKTOP"))
}
Пример #7
0
// _NET_NUMBER_OF_DESKTOPS get
func NumberOfDesktopsGet(xu *xgbutil.XUtil) (uint, error) {
	return xprop.PropValNum(xprop.GetProperty(xu, xu.RootWin(),
		"_NET_NUMBER_OF_DESKTOPS"))
}
Пример #8
0
// _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"))
}
Пример #9
0
// _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"))
}