You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
330 B

use crate::ipc;
use crate::util;
use std::io::Write;
use std::os::unix::net::UnixStream;
pub fn send_swayr_cmd(
cmd: ipc::SwayrCommand,
) -> std::result::Result<(), std::io::Error> {
let mut sock = UnixStream::connect(util::get_swayr_socket_path())?;
sock.write_all(serde_json::to_string(&cmd).unwrap().as_bytes())
}