Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.
/ lstatus Public archive

lstatus is (supposed to be) a simple helper to tool to fetch certain trivial info on your Linux system

License

Notifications You must be signed in to change notification settings

leo-alvarenga/lstatus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lstatus

lstatus is (supposed to be) a simple helper to tool to fetch certain trivial info on your Linux* system.

lstatus follows loosely the Suckless philosophy, trying really hard to be good at one thing: fetching relevant data to be used in any text based status bar being configured by changing the values inside the config.h header and recompiling it.

(*) Yes, only Linux is supported so far, mostly due to my familiarity and lstatus's heavy reliance on the system's directory structure.

Interested? See the usage section.

Why?

Why not?

Seriouly though, I had the idea to build this when, while tinkering with dwmstatus, I realized how much work goes into solutions like it and thought to myself, "I can do that!".

Installation

  1. Clone this repo
  2. Customize lstatus to your liking
  3. Install it with sudo make install
  • Future installations should be done with sudo make clean install;
  • To uninstall lstatus, run sudo make clean and delete your local repo

Usage

There are two ways to use lstatus, alongside dwm and using its output directly

Using it alongside dwm:

This is the default behavior for lstatus, requiring X11 libs to function properly.

When using lstatus alongside dwm, its output will be inserted as X's root name, so that dwm bar is able to display it.

result1

You can even add an icon font to your dwm config to use icons on your lstatus config: result2

If you want see lstatus's output in your shell while using lstatus this way, simply invoke it with lstatus --output.

output_mode

Using lstatus's output directly

If you don't use dwm or don't want to use lstatus alongside it there is absolutely no reason to allow lstatus to insert its output as X's root name, which means that use_setxroot should be set to false.

Furthermore, if that is your case, you can go even further an remove all X11 related logic from lstatus. To do that:

  1. Remove the xsetroot_name function implementation and calls from the main.c file
  2. Remove the inclusion of X11/Xlib from the main.c file
  3. In the Makefile, alter CFLAGSX and LDFLAGSX to CFLAGS and LDFLAGS respectively

Example: Using its output

#!/bin/bash

while [ true ]
do
  status = lstatus

  # do something with the $status here
  sleep 1
done

# If you actually use this, make sure to
# invoke this script with '/path/to/script.sh &'
# to run it as a seperate process

Performance

Even with a refresh rate of one (1) second and use_setxroot set to true, lstatus does not bear any significant impact on your machine's performance:

performance1

To do

  • Implement a memory info module (ram & swap)
  • (Maybe) Implement a temperature module
  • Document custom module implementation
  • Rework the documentation

About

lstatus is (supposed to be) a simple helper to tool to fetch certain trivial info on your Linux system

Topics

Resources

License

Stars

Watchers

Forks