Git Product home page Git Product logo

pctrl's People

Contributors

mohamedsherifnoureldin avatar spospider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pctrl's Issues

TUI Detect Background Colors

When running under Ubuntu 22.04, if your terminal's background color is set to white, you cannot see the User Interface as the majority of text uses white as the default color. If I change my terminal's background color to black, or any other color, you are able to see the terminal interface with no issues.

There should be a way to determine the terminal's background color, and if the terminal background is white, then change the default text color to something else.

This stackoverflow article may help.

Requires nightly rust and panics if a process us using a UID that the system does not recognise

This patch will enable this to build with stable rust and avoid a panic when a user is not known to the system (i.e., userid not associated with an actual user, as is the case with some pppd VPN plugins)

diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index a2e07d0d..569a11b8 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -1,4 +1,3 @@
-#![feature(linked_list_cursors)]
 use std::vec::Vec;

 //cmd args
diff --git a/src-tauri/src/our_mods/proc_functions.rs b/src-tauri/src/our_mods/proc_functions.rs
index 7d49e0b9..f9c550ed 100644
--- a/src-tauri/src/our_mods/proc_functions.rs
+++ b/src-tauri/src/our_mods/proc_functions.rs
@@ -18,7 +18,7 @@ use std::process::{Command, Stdio};

 fn log_data<T>(list: &mut LinkedList<T>, val:T, config: Config) {
     if list.len() == config.record_length as usize {
-        list.cursor_back_mut().remove_current();
+        list.pop_back();
     }

     list.push_front(val);
@@ -153,7 +153,12 @@ pub fn update_procs(_pid_table: &mut HashMap<u32, u16>, procs: &mut Vec<Process>
         procs[i].priority = stat.priority as u8;
         procs[i].start_time = stat.starttime().unwrap();
         procs[i].dir = prc.exe().unwrap_or_default();
-        procs[i].owner = get_user_by_uid(prc.uid().unwrap_or(0)).unwrap().name().to_str().unwrap_or("Unidentified").to_string();
+        let uid = prc.uid().unwrap_or(0);
+        procs[i].owner = if let Some(user) = get_user_by_uid(uid) {
+            user.name().to_str().unwrap_or("Unidentified").to_string()
+        } else {
+            uid.to_string()
+        };
         procs[i].group = get_group_by_gid(stat.pgrp as u32).unwrap_or(Group::new(0, "none")).name().to_str().unwrap_or("Unidentified").to_string();
         match prc.fd_count() {
             Ok(_fdcount) => {procs[i].open_fds = _fdcount as u16; // only for root user

GUI - graphs - displays 14 decimal places

When using the GUI option, the numbers displayed on the "System Information & Graphs" tab for CPU and Memory are shown with 14 decimal places - see attached. The extra digits are meaningless and the numbers should be shown to either 1 decimal place, or rounded to the nearest integer.
PCtrl-14dp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.