cabytcini/src/xsetroot.rs

18 lines
318 B
Rust
Raw Normal View History

2020-04-07 01:09:09 +00:00
#![allow(unsafe_code)]
2020-10-28 12:12:08 +00:00
use anyhow::Result;
use std::process::Command;
2020-04-07 01:09:09 +00:00
pub struct XSetRoot;
2020-04-07 01:09:09 +00:00
impl XSetRoot {
pub fn init() -> Result<Self> {
2020-10-28 12:12:08 +00:00
Ok(Self {})
2020-04-07 01:09:09 +00:00
}
pub fn render(&self, text: String) -> Result<()> {
2020-10-28 12:12:08 +00:00
Command::new("xsetroot").arg("-name").arg(text).output()?;
2020-04-10 11:18:51 +00:00
Ok(())
2020-04-07 01:09:09 +00:00
}
}