Fixed justfile to point to .local/bin
Browse files
+4 −4 justfile
| @@ -2,12 +2,13 @@ build: | |||
| 2 | cargo build --release | 2 | cargo build --release |
| 3 | 3 | ||
| 4 | install: build | 4 | install: build |
| 5 | - sudo cp target/release/oxwm /usr/local/bin/oxwm | 5 | + cp target/release/oxwm ~/.local/bin/oxwm |
| 6 | - @echo "✓ oxwm installed to /usr/local/bin/oxwm" | 6 | + chmod +x ~/.local/bin/oxwm |
| 7 | + @echo "✓ oxwm installed to ~/.local/bin/oxwm" | ||
| 7 | @echo " Run 'oxwm --init' to set up your config" | 8 | @echo " Run 'oxwm --init' to set up your config" |
| 8 | 9 | ||
| 9 | uninstall: | 10 | uninstall: |
| 10 | - sudo rm -f /usr/local/bin/oxwm | 11 | + rm -f ~/.local/bin/oxwm |
| 11 | @echo "✓ oxwm uninstalled" | 12 | @echo "✓ oxwm uninstalled" |
| 12 | @echo " Your config at ~/.config/oxwm is preserved" | 13 | @echo " Your config at ~/.config/oxwm is preserved" |
| 13 | 14 | ||
| @@ -38,4 +39,3 @@ fmt: | |||
| 38 | 39 | ||
| 39 | pre-commit: fmt check build | 40 | pre-commit: fmt check build |
| 40 | @echo "✓ All checks passed!" | 41 | @echo "✓ All checks passed!" |
| 41 | - | ||
+8 −0 src/window_manager.rs
| @@ -351,10 +351,18 @@ impl WindowManager { | |||
| 351 | 351 | ||
| 352 | let source = config_dir.join("target/release/oxwm-user"); | 352 | let source = config_dir.join("target/release/oxwm-user"); |
| 353 | let dest = get_cache_binary_path(); | 353 | let dest = get_cache_binary_path(); |
| 354 | + let backup = dest.with_extension("old"); | ||
| 354 | 355 | ||
| 355 | std::fs::create_dir_all(dest.parent().unwrap())?; | 356 | std::fs::create_dir_all(dest.parent().unwrap())?; |
| 357 | + | ||
| 358 | + if dest.exists() { | ||
| 359 | + std::fs::rename(&dest, &backup)?; | ||
| 360 | + } | ||
| 361 | + | ||
| 356 | std::fs::copy(&source, &dest)?; | 362 | std::fs::copy(&source, &dest)?; |
| 357 | 363 | ||
| 364 | + let _ = std::fs::remove_file(&backup); | ||
| 365 | + | ||
| 358 | notify("OXWM", "Recompiled successfully! Restarting..."); | 366 | notify("OXWM", "Recompiled successfully! Restarting..."); |
| 359 | 367 | ||
| 360 | Ok(()) | 368 | Ok(()) |
+1 −1 templates/config.rs
| @@ -164,7 +164,7 @@ pub const STATUS_BLOCKS: &[BlockConfig] = &[ | |||
| 164 | underline: false, | 164 | underline: false, |
| 165 | }, | 165 | }, |
| 166 | BlockConfig { | 166 | BlockConfig { |
| 167 | - format: " {}", | 167 | + format: " {}", |
| 168 | command: BlockCommand::Shell("uname -r"), | 168 | command: BlockCommand::Shell("uname -r"), |
| 169 | interval_secs: u64::MAX, | 169 | interval_secs: u64::MAX, |
| 170 | color: RED, | 170 | color: RED, |