Configurable statusbar for Xorg server using xsetroot
- Dependencies:
xsetrootandasoundlib - Influenced by suckless software (changes are doing by config.h file and recompilation).
- This library has been developed on and for Linux following open source philosophy.
- First step:
git clone https://github.com/javiorfo/xtatusbar
cd xtatusbar
sudo make clean install- In your ~/.xinitrc to start in every login
xtatusbar &| Component | xtatusbar | NOTE |
|---|---|---|
| CPU usage | ✔️ | percentage |
| RAM usage | ✔️ | percentage |
| TEMPERATURE | ✔️ | Celcious |
| DISK USAGE | ✔️ | percentage |
| VOLUME LEVEL | ✔️ | Level and Mute status |
| BATTERY LEVEL | ✔️ | percentage |
| WEATHER | ❌ | |
| NETWORK STATUS | ✔️ | Receive and send packages |
| DATE | ✔️ | could be custimizable |
| CUSTOM COMPONENT | ✔️ | coding in C |
- Edit config.h to change values or configurations (then recompile)
- By default the values by parameters are the following:
// First element is a string interpolation
// Second element is the time in miliseconds in which every component will execute the function in the third element
// Third element is the function to be executed
static Component components[] = {
{.pattern = " CPU %d%% | ", .wait_ms = 1000, .fn = cpu},
{.pattern = " RAM %d%% | ", .wait_ms = 1000, .fn = ram},
{.pattern = " TEMP %d°C | ", .wait_ms = 1000, .fn = temperature},
{.pattern = " DISK %d%% | ", .wait_ms = 5000, .fn = disk},
{.pattern = " VOL %s | ", .wait_ms = 100, .fn = volume},
{.pattern = "%s NET | ", .wait_ms = 5000, .fn = network},
{.pattern = " %s ", .wait_ms = 1000, .fn = date},
/* {.pattern = " BAT %d%% | ", .wait_ms = 5000, .fn = battery},
{.pattern = "CUSTOM %s ", .wait_ms = 1000, .fn = script}, */
};
// File where to get PC temperature
// static const char *TEMPERATURE_FILE = "/sys/class/thermal/thermal_zone0/temp";
static const char* TEMPERATURE_FILE = "/sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input";
// File where to get battery info
static const char* BATTERY_FILE = "/sys/class/power_supply/BAT0/uevent";
// Date format calendar
static const char* DATE_FORMAT = "%A %d/%m/%Y %H:%M";
// Path to a script if execute_script function is used
static const char* SCRIPT = "./path/to/script";