Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyTurtleDev committed Oct 24, 2023
1 parent 12b817a commit 81775f8
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions more-wallpapers/src/linux/sway.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
use crate::{
error::{CommandError, WallpaperError},
linux::{run, x11},
Mode, Screen,
};
use std::{process::Command, io::StdoutLock};
use super::check_command_error;
use serde::Deserialize;


#[derive(Deserialize, Debug)]
struct SawyMsgOutput
{
#[serde(rename(serialize = "all_screens"))]
all_screens: Vec<Output_Screen>
}
#[derive(Deserialize, Debug)]
pub struct Output_Screen{
name: String,
wallpaper: String,
mode: String,
active: bool,

}

pub(crate) fn get_screens() -> Result<Vec<Screen>, WallpaperError> {
let mut command = Command::new("swaymsg");
command.args(["-t", "get_outputs"]);
let output = check_command_error(command.output(), "swaymsg")?;
let output = String::from_utf8(output).unwrap();
println!("{output}");
let output: SawyMsgOutput = serde_json::from_str(&output)?;
println!("{output:#?}");
todo!()//Ok(screens)
}

pub(crate) fn set_screens(screens: Vec<Screen>) -> Result<(), WallpaperError> {
Ok(())
}

0 comments on commit 81775f8

Please sign in to comment.