summaryrefslogtreecommitdiff
path: root/slstatus.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove program name from error messagesAaron Marcher2018-03-281-1/+1
|
* Remove unnecessary headersAaron Marcher2018-03-281-2/+0
|
* Print unknown_str in case of errorSiIky2018-02-171-1/+3
| | | | | func can return NULL in case of error, but no checking is done when printing, and unknown_str wasn't being used anywhere.
* Properly declare buf as extern and fix all unused-warningsLaslo Hunhold2017-09-171-1/+4
|
* Rewrite Makefile to accomodate file splitLaslo Hunhold2017-09-171-37/+1
|
* Split into multiple filesAaron Marcher2017-09-171-740/+1
| | | | | | | | 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
* Add blank line after setlocaleAaron Marcher2017-09-161-0/+1
| | | | setlocale() has to be separated from the signal handling.
* slstatus: set localeKurt Van Dijck2017-09-161-0/+2
| | | | | | | 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>
* slstatus: add cpu_iowaitKurt Van Dijck2017-09-161-11/+33
| | | | | | | | | | 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>
* slstatus load_avg format stringKamil CholewiƄski2017-09-101-3/+3
|
* Added IPv6 address functionAaron Marcher2017-08-141-4/+36
| | | | | | - Renamed "ip" function to "ipv4" - Added "ipv6" function - Adjusted README and config.def.h accordingly
* Fix a little logic errorLaslo Hunhold2017-08-141-1/+1
|
* Add pscanf()Laslo Hunhold2017-08-141-157/+66
| | | | This reduces a lot of equivalent code to one function call.
* Refactor main()Laslo Hunhold2017-08-131-34/+39
| | | | | | | | | | | | | | | | | 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.
* Simplify signal handling a bitLaslo Hunhold2017-08-131-7/+5
|
* Remove unnecessary prototypesLaslo Hunhold2017-08-131-3/+0
|
* Remove unnecessary blank lines after license-noticeLaslo Hunhold2017-08-131-1/+0
|
* Removed #define for unknown_strAaron Marcher2017-08-121-69/+69
| | | | | Debugging #define is very difficult. The performance overhead of static const char is negligible.
* Removed #define for update intervalAaron Marcher2017-08-121-2/+2
| | | | | Debugging #define, especially in mathematical constructs is very difficult. The performance overhead of static const int is negligible.
* keyboard_indicators: fix segfault when -s is specifiedAli H. Fardan2017-08-121-0/+6
|
* Fixed possible NULL-deref and removed unnecessary XOpenDisplay()Aaron Marcher2017-08-111-2/+5
| | | | | | | - 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.
* Add and use LEN() macroLaslo Hunhold2017-08-111-5/+6
|
* Refactor battery_state()Laslo Hunhold2017-08-111-12/+17
|
* Print usage() when we are left with argumentsLaslo Hunhold2017-08-101-0/+4
|
* Reduce -o | -n to -sLaslo Hunhold2017-08-101-21/+10
| | | | | 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.
* Remove d- and v-flagsLaslo Hunhold2017-08-101-12/+3
| | | | | | | 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.
* Convert slstatus.1 to mandoc, simplify it and remove -hLaslo Hunhold2017-08-101-8/+6
| | | | | | 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.
* add num_files() function for maildirs ;)aaron marcher2017-08-061-0/+25
|
* check for fgets/fscanf return valuesAaron Marcher2017-06-131-35/+75
|
* use a static buffer instead of dynamic memoryAaron Marcher2017-06-131-241/+200
|
* remove format characters from stat functionsAaron Marcher2017-06-121-8/+8
|
* add cpu_freq functionAaron Marcher2017-06-121-0/+18
|
* add battery_power functionAaron Marcher2017-06-121-0/+20
|
* added option to output only once and exit afterwardsAaron Marcher2017-05-111-6/+12
|
* simplified and improved vol_perc()Aaron Marcher2017-04-201-6/+12
|
* fix overflow in run_command()Aaron Marcher2017-04-201-1/+1
|
* username(): get rid of unneeded uid variableAaron Marcher2017-04-201-2/+1
|
* On success, fgets always terminates the result.Tobias Stoeckmann2017-04-041-1/+1
| | | | | | | | 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>
* Fixed out of boundary write on long lines.Tobias Stoeckmann2017-04-021-6/+6
| | | | | | | | | | | 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>
* loading thresholds stateAaron Marcher2017-03-301-0/+2
|
* Fixed XCloseDisplay() which is not reached in keyboard_indicators()Aaron Marcher2017-01-231-2/+1
|
* Added keyboard_indicators (Fixes #31)Aaron Marcher2017-01-161-0/+25
|
* Makefile fix and vol_perc fix for muteAaron Marcher2017-01-091-3/+1
|
* removed ./extern/Aaron Marcher2017-01-071-1/+1
|
* removed strlcat dependency (was used only once)Aaron Marcher2017-01-071-6/+1
|
* got rid of concat.hAaron Marcher2017-01-071-13/+14
|
* happy new year!Aaron Marcher2017-01-071-1/+1
|
* run_command: strlen() will not function if string is not null terminatedAaron Marcher2017-01-071-1/+1
|
* consistent coding style: usage() declaration, eval is a constantAaron Marcher2016-12-301-2/+2
|
* Merge branch 'master' into masterparazyd2016-12-301-123/+137
|\