summaryrefslogtreecommitdiff
path: root/slstatus.c
AgeCommit message (Collapse)Author
2018-05-17Change done to int as it is the CPU's natural typeAaron Marcher
2018-05-08fflush(stdout) to print line by line if stdout is not a ttyJosuah Demangeon
To reproduce the issue: $ slstatus -s | tee then it would print only when the stdout buffer is full, by block of multiple lines. fflush() makes sure the line is printed at every loop iteration
2018-05-07Only variable declarations at top of blockAaron Marcher
2018-03-28Remove program name from error messagesAaron Marcher
2018-03-28Remove unnecessary headersAaron Marcher
2018-02-17Print unknown_str in case of errorSiIky
func can return NULL in case of error, but no checking is done when printing, and unknown_str wasn't being used anywhere.
2017-09-17Properly declare buf as extern and fix all unused-warningsLaslo Hunhold
2017-09-17Rewrite Makefile to accomodate file splitLaslo Hunhold
2017-09-17Split into multiple filesAaron Marcher
For multiple reasons the program is now split: - Make future porting to OpenBSD easier - Assign header includes to individiual functions - Make future program extensions easier - Recompile only changed parts
2017-09-16Add blank line after setlocaleAaron Marcher
setlocale() has to be separated from the signal handling.
2017-09-16slstatus: set localeKurt Van Dijck
I want my date & time printed according my locale settings. This commit enables that Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
2017-09-16slstatus: add cpu_iowaitKurt Van Dijck
This commit introduces the cpu_iowait item, this is the percentage of cpu time spent waiting on disks. High numbers typically indicate that your system is not responsive due to disk IO. This commit also avoid sleeping inside the cpu_perc and cpu_iowait functions: waiting in either one implies lost info for the other. Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
2017-09-10slstatus load_avg format stringKamil CholewiƄski
2017-08-14Added IPv6 address functionAaron Marcher
- Renamed "ip" function to "ipv4" - Added "ipv6" function - Adjusted README and config.def.h accordingly
2017-08-14Fix a little logic errorLaslo Hunhold
2017-08-14Add pscanf()Laslo Hunhold
This reduces a lot of equivalent code to one function call.
2017-08-13Refactor main()Laslo Hunhold
We remove the hack with the sleep and global "delay"-variable and use a monotonic clock to derive the desired monotonic properties of the tool. Inside each function that demands a personal delay we can then just do a nanosleep() and be done with it. It's a shame that timespec is so ugly to work with, but there's really no way to make it more beautiful. However, at this cost though we finally can set the interval times in milliseconds and not only just seconds. We remove setlocale(), because nothing good ever came out of this function. Besides that we have some more code refactoring, especially in the argument loop which saves us a bit of complexity.
2017-08-13Simplify signal handling a bitLaslo Hunhold
2017-08-13Remove unnecessary prototypesLaslo Hunhold
2017-08-13Remove unnecessary blank lines after license-noticeLaslo Hunhold
2017-08-12Removed #define for unknown_strAaron Marcher
Debugging #define is very difficult. The performance overhead of static const char is negligible.
2017-08-12Removed #define for update intervalAaron Marcher
Debugging #define, especially in mathematical constructs is very difficult. The performance overhead of static const int is negligible.
2017-08-12keyboard_indicators: fix segfault when -s is specifiedAli H. Fardan
2017-08-11Fixed possible NULL-deref and removed unnecessary XOpenDisplay()Aaron Marcher
- Added a check for the return value of XOpenDisplay() in main(). This fixes a possible NULL-deref. - Removed unnsecessary XOpenDisplay and XCloseDisplay from keyboard_indicators(). The ones in main() are sufficent.
2017-08-11Add and use LEN() macroLaslo Hunhold
2017-08-11Refactor battery_state()Laslo Hunhold
2017-08-10Print usage() when we are left with argumentsLaslo Hunhold
2017-08-10Reduce -o | -n to -sLaslo Hunhold
What we really want is to either output to WM_NAME or stdout. If we want just one single line, we do slstatus | head -n 1.
2017-08-10Remove d- and v-flagsLaslo Hunhold
d-flag: There's no need for that, use the &-operator or fork+exec in a non-shell-context. In the latter case you get the PID for free. v-flag: If you want to find out which version of a package is installed, consult your package manager. That's his job.
2017-08-10Convert slstatus.1 to mandoc, simplify it and remove -hLaslo Hunhold
We also change the semantics of -v to only return the version information. There is now no need for usage() to exit with anything other than 1.
2017-08-06add num_files() function for maildirs ;)aaron marcher
2017-06-13check for fgets/fscanf return valuesAaron Marcher
2017-06-13use a static buffer instead of dynamic memoryAaron Marcher
2017-06-12remove format characters from stat functionsAaron Marcher
2017-06-12add cpu_freq functionAaron Marcher
2017-06-12add battery_power functionAaron Marcher
2017-05-11added option to output only once and exit afterwardsAaron Marcher
2017-04-20simplified and improved vol_perc()Aaron Marcher
2017-04-20fix overflow in run_command()Aaron Marcher
2017-04-20username(): get rid of unneeded uid variableAaron Marcher
2017-04-04On success, fgets always terminates the result.Tobias Stoeckmann
If fgets succeeds, then the resulting char array is always terminated by a '\0'. No need to keep extra space, therefore sizeof(buf) is the correct argument. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2017-04-02Fixed out of boundary write on long lines.Tobias Stoeckmann
The terminating nul character ('\0') could be written outside the boundary of the buffer which is used to read characters. If "sizeof(buffer)" characters are read, the resulting value must not be used as index, because that's an off by one. Read sizeof(buffer)-1 bytes instead. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2017-03-30loading thresholds stateAaron Marcher
2017-01-23Fixed XCloseDisplay() which is not reached in keyboard_indicators()Aaron Marcher
2017-01-16Added keyboard_indicators (Fixes #31)Aaron Marcher
2017-01-09Makefile fix and vol_perc fix for muteAaron Marcher
2017-01-07removed ./extern/Aaron Marcher
2017-01-07removed strlcat dependency (was used only once)Aaron Marcher
2017-01-07got rid of concat.hAaron Marcher
2017-01-07happy new year!Aaron Marcher