pub fn init_desktops_hints(&self) -> Result<()> {
        let tag_labels = &self.tag_labels;
        let tag_length = tag_labels.len();

        // Set the number of desktop.
        self.set_desktop_prop(
            &[u32::try_from(tag_length)?],
            self.atoms.NetNumberOfDesktops,
        )?;

        // Set a current desktop.
        self.set_desktop_prop(&[0_u32, x11rb::CURRENT_TIME], self.atoms.NetCurrentDesktop)?;

        // Set desktop names.
        //
        // Convert the list of tag names string into a valid list of strings for an atom,
        // which is a null terminated string containing null terminated strings for each value.
        // This essecially replicates what this function does:
        // `Xutf8TextListToTextProperty`: https://linux.die.net/man/3/xutf8textlisttotextproperty
        let concat_str = tag_labels
            .iter()
            .fold(String::default(), |acc, x| format!("{acc}{x}\0"));
        let bytes = concat_str.as_bytes();

        xproto::change_property(
            &self.conn,
            xproto::PropMode::REPLACE,
            self.root,
            self.atoms.NetDesktopNames,
            self.atoms.UTF8String,
            8,
            // Removing the last null byte because `CString::from_vec_unchecked` adds a trailing
            // null byte
            u32::try_from(bytes.len())? - 1,
            &bytes[..bytes.len() - 1],
        )?;

        // Set the WM NAME.
        self.set_desktop_prop_string("LeftWM", self.atoms.NetWMName, self.atoms.UTF8String)?;

        self.set_desktop_prop_string(
            "LeftWM",
            self.atoms.WMClass,
            xproto::AtomEnum::STRING.into(),
        )?;

        self.set_desktop_prop_u32(
            self.root,
            self.atoms.NetSupportingWmCheck,
            xproto::AtomEnum::WINDOW.into(),
        )?;

        // Set a viewport.
        self.set_desktop_prop(&[0_u32, 0_u32], self.atoms.NetDesktopViewport)?;
        Ok(())
    }
EWMH support used for bars such as polybar.
display-servers/x11rb-display-server/src/xwrap.rs