aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/main.rs b/src/main.rs
index b0b5b9b..fab737a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,6 +8,7 @@ extern crate libc;
extern crate x11;
#[macro_use]
extern crate lazy_static;
+extern crate dirs;
pub mod safe_x11;
pub mod command;
@@ -16,29 +17,26 @@ pub mod event;
pub mod socket;
pub mod desktop;
-use dotwm::DotWM;
-use command::*;
-use event::{Event,select_event};
-use socket::parser;
-
use std::collections::HashMap;
use std::mem::uninitialized;
-
-use x11::xlib;
-use x11::keysym;
-
use std::fs;
-use std::env;
use std::path::{PathBuf};
use std::io::{Read,Write};
use std::os::unix::net::UnixListener;
+use x11::xlib;
+use x11::keysym;
+
+use dotwm::DotWM;
+use command::*;
+use event::{Event,select_event};
+use socket::parser;
+
fn dotwm_dir() -> PathBuf {
- let mut path = env::home_dir().unwrap();
- path.push(".config");
+ let mut path = dirs::config_dir().unwrap();
path.push("dotwm");
-
if !path.exists() && !path.is_dir() {
+ println!("Creating config directory in {:?}", path);
fs::create_dir(&path).unwrap();
}
@@ -55,6 +53,7 @@ fn run_autostart() {
let mut autostart = dotwm_dir();
autostart.push("autostart");
+ println!("Trying to exec {:?}", autostart);
let found = exec_cmd(autostart, &[]).is_ok();
if !found {