Rust based Linux Process Manager with both a GUI and a TUI
Pctrl is a robust, featureful, easy-to-use and powerful process manager based on the Rust programming language. It provides an overview of the system, as in what processes are currently running and the system, and gives administrators control to manipulate these processes. Pctrl is designed to compete with all currently available Linux process managers by providing powerful controls as well as a friendly interface choice of running in either a Terminal User Interface (TUI), Graphical User Interface (GUI) or both.
We have built this project as part of the Operating Systems (CSCE 3401) course at the American University in Cairo with the aim to experiment and learn the rust programming language.
sudo apt install ./pctrl_1.0.0_amd64.deb
chmod +x pctrl_1.0.0_amd64.AppImage
./pctrl_1.0.0_amd64.AppImage
git clone https://github.com/MohamedSherifNoureldin/PCtrl
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libncursesw5-dev
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
cargo install tauri-cli
npm install
cargo tauri build
src-tauri/target/release
directorypctrl
pctrl gui_only
pctrl gui
pctrl --help
pctrl --record <pid>
Output file: {HOME}/.local/share/pctrl/pctrl_{PID}.plogpctrl keepalive <PID>
pctrl filter --columns <COLUMNS_TO_FILTER_ON> --type <TYPE OF FILTER> --value <VALUE TO FILTER ON>
Example of filtering for processes with pid greater than 2 and priority 20 and CPU less than 5:
pctrl filter --columns PID,PRI,CPU --type greater,eq,less --value 2,20,5
pctrl search --type <TYPE OF SEARCH> --value <VALUE TO SEARCH FOR>
Example of searching for a process with pid 2:
pctrl search --type PID --value 2
src
contains the source code for the react frontend of the GUI
App.css
a custom stylesheet for the GUIApp.jsx
the main component of the GUI responsible for rendering the different tabs and processing the data received from the backendmain.jsx
the entry point of the GUIProcessTable.jsx
the component responsible for rendering the processes tableProcessTree.jsx
the component responsible for rendering the processes treeProcessInfo.jsx
the component responsible for rendering the selected process's informationSystemInfo.jsx
the component responsible for rendering the system information tab along with its graphsTheme.jsx
custom theme for the GUIsrc-tauri
contains the source code for the backend and the TUI
src
actual rust source code
main.rs
the entry point of the backend. It is responsible for handling the command line arguments, starting the TUI or GUI or both accordingly and reading the configuration fileour_mods.rs
just a file to hold all the modules we createdour_modes
contains the code for our modules
gui.rs
contains the code for the tauri methods that are called from the GUItui.rs
contains the code for the cursive TUIproc_functions.rs
contains the code for the functions that read and parse the process information from the system as well as the functions that manipulate processes.structures.rs
contains the code for the structures needed across the project