diff --git a/Cargo.toml b/Cargo.toml index f860cbc..5a2f5ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ming-wm" -version = "1.0.0" +version = "1.0.1" repository = "https://github.com/stjet/ming-wm" license = "GPL-3.0-or-later" edition = "2021" diff --git a/README.md b/README.md index 5bdefb7..85a1e04 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The [Koxinga web browser](https://github.com/stjet/koxinga) can be separately in ## Building -Create a `password.env` file in the same directory as `build.rs`, otherwise the default password will be "incorrect mule lightbulb niche". +Create a `password.env` file in the same directory as `build.rs`, otherwise the default password will be "password". For best performance: diff --git a/build.rs b/build.rs index ec0677c..829ffd1 100644 --- a/build.rs +++ b/build.rs @@ -49,7 +49,7 @@ fn font_chars_to_alphas(dir: &str) { fn main() { //hash + "salt" password and add to build - let password = read_to_string("password.env").unwrap_or("incorrect mule lightbulb niche".to_string()).replace("\n", "") + "salt?sorrycryptographers"; + let password = read_to_string("password.env").unwrap_or("password".to_string()).replace("\n", "") + "salt?sorrycryptographers"; let mut hasher = Blake2b512::new(); hasher.update(password.as_bytes()); let out_dir = env::var_os("OUT_DIR").unwrap(); diff --git a/src/bin/file_explorer.rs b/src/bin/file_explorer.rs index 54b1749..83fbdb5 100644 --- a/src/bin/file_explorer.rs +++ b/src/bin/file_explorer.rs @@ -11,6 +11,16 @@ use ming_wm_lib::ipc::listen; const HEIGHT: usize = 20; +fn format_secs(secs: u64) -> String { + let minute = 60; + let hour = minute * 60; + let day = 24 * hour; + let days = secs / day; + let hours = (secs % day) / hour; + let minutes = ((secs % day) % hour) / minute; + format!("{}d {}h {}m", days, hours, minutes) +} + struct DirectoryChild { //if some, use instead of file/dir name override_name: Option, @@ -140,7 +150,7 @@ impl WindowLike for FileExplorer { start_y += HEIGHT; if let Ok(elapsed) = metadata.modified().unwrap().elapsed() { //properly format months, days, hours, minutes, secs instead - instructions.push(DrawInstructions::Text([5, start_y], vec!["nimbus-roman".to_string()], format!("Last Modified: {} minutes ago", elapsed.as_secs() / 60), theme_info.text, theme_info.background, None, None)); + instructions.push(DrawInstructions::Text([5, start_y], vec!["nimbus-roman".to_string()], format!("Last Modified: {} ago", format_secs(elapsed.as_secs())), theme_info.text, theme_info.background, None, None)); } //todo: other stuff // diff --git a/src/window_manager.rs b/src/window_manager.rs index 1bf6ffc..c50c5b1 100644 --- a/src/window_manager.rs +++ b/src/window_manager.rs @@ -405,6 +405,7 @@ impl WindowManager { } }, &ShortcutType::FocusPrevWindow | &ShortcutType::FocusNextWindow => { + self.toggle_start_menu(true); let current_index = self.get_focused_index().unwrap_or(0); let mut new_focus_index = current_index; loop {