Skip to content

Commit

Permalink
Merge pull request #12 from MoAlyousef/main
Browse files Browse the repository at this point in the history
0.1.10
  • Loading branch information
MoAlyousef committed May 18, 2022
2 parents cf3ba06 + 40971d8 commit a561636
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sysinfo-gui"
version = "0.1.9"
version = "0.1.10"
edition = "2021"
repository = "https://github.com/MoAlyousef/sysinfo-gui"
keywords = ["cross-platform", "monitoring", "gui"]
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ The font is Roboto Medium.
## Screenshots

- Dashboard
![image](https://user-images.githubusercontent.com/37966791/166832794-6d56d40a-f07d-446f-833b-e60fba3c0c6f.png)
![image](https://user-images.githubusercontent.com/37966791/169169613-af34be21-5b7d-4176-9e45-dfe763482996.png)

- Processes
![image](https://user-images.githubusercontent.com/37966791/167034654-acf8c86f-b9cf-403f-a0ed-c18138660a18.png)
![image](https://user-images.githubusercontent.com/37966791/169169714-24a5f233-e391-44c9-9c39-ebd42a5ab429.png)

- Cpu
![image](https://user-images.githubusercontent.com/37966791/167034442-e261f5b6-d268-4e85-bab0-96eb3ad37040.png)
![image](https://user-images.githubusercontent.com/37966791/169169787-668c23e5-7133-4e32-bc39-9c687a903150.png)

- Memory
![image](https://user-images.githubusercontent.com/37966791/166832991-65bd3782-b5ed-40f7-800c-b0d3f3a5e611.png)
![image](https://user-images.githubusercontent.com/37966791/169169841-bd6af58f-785b-4429-9b86-c1c5e160f9ab.png)

- Disk info
![image](https://user-images.githubusercontent.com/37966791/166833062-154428d8-7ecf-4b3f-9875-7397f84c7b32.png)
![image](https://user-images.githubusercontent.com/37966791/169169890-8fcb9d00-6f55-45d4-926c-781fb8066e4c.png)

- Networking
![image](https://user-images.githubusercontent.com/37966791/166833123-484adeac-0b23-4b0a-bfb0-767c1b4856cd.png)
Expand All @@ -36,7 +36,7 @@ The font is Roboto Medium.
- Realtime monitoring.
- End processes by sending a kill signal in the processes view.
- Both dark and light modes.
![image](https://user-images.githubusercontent.com/37966791/166833290-5161965a-f730-4f76-9845-0e0d38db6f96.png)
![image](https://user-images.githubusercontent.com/37966791/169170165-f0417ec7-a1dd-4282-a9b1-7bffdc3fc3bc.png)

## Getting the application:

Expand Down
4 changes: 2 additions & 2 deletions src/gui/widgets/dial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ impl HalfDial {
let parent = w.parent().unwrap();
let parent_col = parent.color();
draw::set_draw_color(Color::color_average(parent_col, Color::Foreground, 0.9));
draw::draw_pie(w.x(), w.y(), w.w(), w.h(), 0., 180.);
draw::draw_pie(w.x(), w.y(), w.w(), w.h(), -45., 225.);
draw::set_draw_color(w.selection_color());
let val = value_c.load(Ordering::Relaxed);
let val = if val > 100 { 100 } else { val };
draw::draw_pie(w.x(), w.y(), w.w(), w.h(), (100 - val) as f64 * 1.8, 180.);
draw::draw_pie(w.x(), w.y(), w.w(), w.h(), (100 - val) as f64 * 2.7 - 45., 225.);
draw::set_draw_color(parent_col);
draw::draw_pie(
w.x() - 50 + w.w() / 2,
Expand Down
19 changes: 16 additions & 3 deletions src/view/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,28 @@ pub fn disks(view: &MyView) -> Option<Box<dyn FnMut() + Send>> {
.with_size(300, 130)
.with_label(disk.name().to_str().unwrap());
t.begin();
let vpack = group::Pack::default().with_size(600, 100).center_of_parent();
let mut f = frame::Frame::default()
.with_size(80, 35)
.with_label(&format!(
"{}",
disk.mount_point().to_str().unwrap(),
));
f.set_label_size(14);
frame::Frame::default()
.with_size(80, 60)
.with_size(80, 35)
.with_label(&format!(
"{:?}: {} - Space: {:.02} GiB",
disk.type_(),
String::from_utf8(disk.file_system().to_vec()).unwrap(),
disk.total_space() as f64 / 2_f64.powf(30.)
))
.center_of_parent();
));
frame::Frame::default()
.with_size(80, 35)
.with_label(&format!(
"Removable: {}", if disk.is_removable() {"Yes"} else {"No"}
));
vpack.end();
t.end();
let grp = group::Group::default().with_size(130, 130);
let mut dial = Dial::default()
Expand Down
7 changes: 6 additions & 1 deletion src/view/procs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ pub fn procs(view: &MyView) -> Option<Box<dyn FnMut() + Send>> {
if let Some(text) = b.text(val) {
let sys = sys.lock();
let v: Vec<&str> = text.split_ascii_whitespace().collect();
let pid = sysinfo::Pid::from_str(v[1]).unwrap();
let pid = if light_mode {
v[0]
} else {
v[1]
};
let pid = sysinfo::Pid::from_str(pid).unwrap();
if let Some(p) = sys.process(pid) {
p.kill_with(sysinfo::Signal::Kill).unwrap();
}
Expand Down

0 comments on commit a561636

Please sign in to comment.