Files
FERRUM/system_monitor.h
marcusDenslow 01f7107c07 added git diff view with ncurses! command: gg dd
- Add ncurses-based interactive git diff viewer (gg dd command)
  - Create three-pane layout: file list, commit history, and diff
content
  - Implement file staging system with space/A keys for marking files
  - Add commit workflow with C key and title input dialog
  - Add push functionality with P key for individual commits
  - Create dynamic status bar with context-sensitive keybindings
  - Implement character-by-character text animations for status messages
  - Add auto-sync functionality to refresh files/commits every 30
seconds
  - Add spinning progress indicators for fetch/push operations
  - Fix cursor flickering and improve window layout spacing
  - Support number key navigation (1=files, 2=view, 3=commits)
  - Add proper window clearing to prevent content overlap issues
2025-06-06 15:09:58 +02:00

50 lines
1.2 KiB
C

#ifndef SYSTEM_MONITOR_H
#define SYSTEM_MONITOR_H
#include <ctype.h>
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/statvfs.h>
#include <sys/sysinfo.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
typedef struct {
float cpu_percent;
unsigned long memory_used;
unsigned long memory_total;
unsigned long disk_read;
unsigned long disk_write;
unsigned long net_rx;
unsigned long net_tx;
int process_count;
} SystemStats;
typedef struct {
int pid;
char name[256];
float cpu_percent;
unsigned long memory;
char state;
} ProcessInfo;
int builtin_monitor(char **args);
void display_dashboard(SystemStats *stats, ProcessInfo *processes,
int proc_count);
void get_system_stats(SystemStats *stats);
int get_process_info(ProcessInfo *processes, int max_processes);
void clear_screen(void);
void move_cursor(int row, int col);
void hide_cursor(void);
void show_cursor(void);
int kbhit(void);
void draw_progress_bar(int percentage, int width);
void format_progress_bar(int percentage, int width, char *buffer);
void format_bytes(unsigned long bytes, char *buffer);
#endif