Diff
diff --git a/justfile b/justfile
index 890e089..110d5d4 100644
--- a/justfile
+++ b/justfile
@@ -2,12 +2,13 @@ build:
cargo build --release
install: build
- sudo cp target/release/oxwm /usr/local/bin/oxwm
- @echo "✓ oxwm installed to /usr/local/bin/oxwm"
+ cp target/release/oxwm ~/.local/bin/oxwm
+ chmod +x ~/.local/bin/oxwm
+ @echo "✓ oxwm installed to ~/.local/bin/oxwm"
@echo " Run 'oxwm --init' to set up your config"
uninstall:
- sudo rm -f /usr/local/bin/oxwm
+ rm -f ~/.local/bin/oxwm
@echo "✓ oxwm uninstalled"
@echo " Your config at ~/.config/oxwm is preserved"
@@ -38,4 +39,3 @@ fmt:
pre-commit: fmt check build
@echo "✓ All checks passed!"
-
diff --git a/src/window_manager.rs b/src/window_manager.rs
index 56323a6..07eda6a 100644
--- a/src/window_manager.rs
+++ b/src/window_manager.rs
@@ -351,10 +351,18 @@ impl WindowManager {
let source = config_dir.join("target/release/oxwm-user");
let dest = get_cache_binary_path();
+ let backup = dest.with_extension("old");
std::fs::create_dir_all(dest.parent().unwrap())?;
+
+ if dest.exists() {
+ std::fs::rename(&dest, &backup)?;
+ }
+
std::fs::copy(&source, &dest)?;
+ let _ = std::fs::remove_file(&backup);
+
notify("OXWM", "Recompiled successfully! Restarting...");
Ok(())
diff --git a/templates/config.rs b/templates/config.rs
index cc10649..904bef8 100644
--- a/templates/config.rs
+++ b/templates/config.rs
@@ -164,7 +164,7 @@ pub const STATUS_BLOCKS: &[BlockConfig] = &[
underline: false,
},
BlockConfig {
- format: " {}",
+ format: " {}",
command: BlockCommand::Shell("uname -r"),
interval_secs: u64::MAX,
color: RED,