Exemple #1
0
// WM_CLASS get
func WmClassGet(xu *xgbutil.XUtil, win xproto.Window) (*WmClass, error) {
	raw, err := xprop.PropValStrs(xprop.GetProperty(xu, win, "WM_CLASS"))
	if err != nil {
		return nil, err
	}
	if len(raw) != 2 {
		return nil,
			fmt.Errorf("WmClass: Two string make up WM_CLASS, but "+
				"xgbutil found %d in '%v'.", len(raw), raw)
	}

	return &WmClass{
		Instance: raw[0],
		Class:    raw[1],
	}, nil
}
// _NET_DESKTOP_NAMES get
func DesktopNamesGet(xu *xgbutil.XUtil) ([]string, error) {
	return xprop.PropValStrs(xprop.GetProperty(xu, xu.RootWin(),
		"_NET_DESKTOP_NAMES"))
}