v1.0.1: fix start menu and shortcut bug
also, change default password, make file explorer last modified sane
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
2
build.rs
2
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();
|
||||
|
||||
@@ -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<String>,
|
||||
@@ -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
|
||||
//
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user