~kennylevinsen/dlm

6b0e11c4f453b1a4d7a32019227539a980b7ce66 — Kenny Levinsen 2 years ago dd80867 master
Update greet_proto
2 files changed, 8 insertions(+), 8 deletions(-)

M Cargo.lock
M src/main.rs
M Cargo.lock => Cargo.lock +1 -1
@@ 86,7 86,7 @@ dependencies = [
[[package]]
name = "greet_proto"
version = "0.2.0"
source = "git+https://git.sr.ht/~kennylevinsen/greetd#252ab3738a92ac0c94dd239acd5d62926a8fcbcc"
source = "git+https://git.sr.ht/~kennylevinsen/greetd#4a5ea14ac075b76173d7509f7490309ead81aa5f"
dependencies = [
 "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",

M src/main.rs => src/main.rs +7 -7
@@ 3,7 3,6 @@ use std::io::{Write, Read};
use std::os::unix::net::UnixStream;
use std::env;
use std::default::Default;
use std::collections::HashMap;

use framebuffer::{Framebuffer, KdMode};
use termion::raw::IntoRawMode;


@@ 171,11 170,11 @@ impl<'a> LoginManager<'a> {
    }
}

fn login(username: String, password: String, command: Vec<String>, env: HashMap<String, String>) -> Result<(), Box<dyn std::error::Error>> {
fn login(username: String, password: String, cmd: Vec<String>, env: Vec<String>) -> Result<(), Box<dyn std::error::Error>> {
    let request = Request::Login{
        username,
        password,
        command,
        cmd,
        env,
    };



@@ 303,13 302,14 @@ fn main() {
                    } else {
                        lm.draw_bg(&color::Color::new(0.75, 0.75, 0.25, 1.0))
                            .expect("unable to draw background");
                        let mut env = HashMap::new();
                        env.insert("XDG_SESSION_TYPE".to_string(), "wayland".to_string());
                        env.insert("XDG_SESSION_DESKTOP".to_string(), "sway".to_string());
                        let res = login(username,
                            password,
                            vec!["sway".to_string()],
                            env
                            vec![
                                "XDG_SESSION_TYPE=wayland".to_string(),
                                "XDG_SESSION_DESKTOP=sway".to_string(),
                                "XDG_CURRENT_DESKTOP=sway".to_string()
                            ],
                        );
                        username = String::with_capacity(USERNAME_CAP);
                        password = String::with_capacity(PASSWORD_CAP);