1 Commits

Author SHA1 Message Date
stjet
cdb35767ac v1.0.1: fix start menu and shortcut bug
also, change default password, make file explorer last modified sane
2025-03-17 02:49:30 +00:00
5 changed files with 15 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "ming-wm" name = "ming-wm"
version = "1.0.0" version = "1.0.1"
repository = "https://github.com/stjet/ming-wm" repository = "https://github.com/stjet/ming-wm"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
edition = "2021" edition = "2021"

View File

@@ -9,7 +9,7 @@ The [Koxinga web browser](https://github.com/stjet/koxinga) can be separately in
## Building ## 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: For best performance:

View File

@@ -49,7 +49,7 @@ fn font_chars_to_alphas(dir: &str) {
fn main() { fn main() {
//hash + "salt" password and add to build //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(); let mut hasher = Blake2b512::new();
hasher.update(password.as_bytes()); hasher.update(password.as_bytes());
let out_dir = env::var_os("OUT_DIR").unwrap(); let out_dir = env::var_os("OUT_DIR").unwrap();

View File

@@ -11,6 +11,16 @@ use ming_wm_lib::ipc::listen;
const HEIGHT: usize = 20; 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 { struct DirectoryChild {
//if some, use instead of file/dir name //if some, use instead of file/dir name
override_name: Option<String>, override_name: Option<String>,
@@ -140,7 +150,7 @@ impl WindowLike for FileExplorer {
start_y += HEIGHT; start_y += HEIGHT;
if let Ok(elapsed) = metadata.modified().unwrap().elapsed() { if let Ok(elapsed) = metadata.modified().unwrap().elapsed() {
//properly format months, days, hours, minutes, secs instead //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 //todo: other stuff
// //

View File

@@ -405,6 +405,7 @@ impl WindowManager {
} }
}, },
&ShortcutType::FocusPrevWindow | &ShortcutType::FocusNextWindow => { &ShortcutType::FocusPrevWindow | &ShortcutType::FocusNextWindow => {
self.toggle_start_menu(true);
let current_index = self.get_focused_index().unwrap_or(0); let current_index = self.get_focused_index().unwrap_or(0);
let mut new_focus_index = current_index; let mut new_focus_index = current_index;
loop { loop {