Commit Graph

62 Commits

Author SHA1 Message Date
David Demelier 37724ac2c3 Add basic backlight percentage support
At the moment linux only, but will add support for OpenBSD as well.
2018-05-22 12:40:31 +02:00
Aaron Marcher fc0dde5a60 Remove fmt from load_avgs for consistency
In a later commit something like that will be enabled for every
component
2018-05-21 14:14:45 +02:00
Tobias Tschinkowitz 22175f0d57 implemented openbsd netspeed functions
implemented the netspeed functionality for openbsd.
furthermore the static keyword was removed of the interval variable in
config.def.h for usage as extern variable.
2018-05-19 01:44:36 +02:00
Aaron Marcher 176d8ff874 Add netspeeds to config.def.h 2018-05-19 00:40:59 +02:00
Aaron Marcher 2604f25b16 Fix indentation
Tabs for indentation, spaces for alignment
2018-05-18 15:32:15 +02:00
Tobias Tschinkowitz 8c8326f793 Add battery_remaining function on OpenBSD
Implementation of a battery_remaining function which returns the
remaining battery time in HH:MM format. Linux function still needs
implementation.
Move common code to load_apm_power_info
2018-05-18 15:25:42 +02:00
Aaron Marcher 11ce8ed013 Change interval to unsigned int 2018-05-17 17:25:31 +02:00
Aaron Marcher 0892a93dbd Add comments for battery_* functions on OpenBSD 2018-05-17 17:24:47 +02:00
Tobias Tschinkowitz 1cb5af98e5 added comment for temp function (openbsd) 2018-05-17 17:13:28 +02:00
Aaron Marcher 66a7fb16fc Remove cpu_iowait
The third value from load_avg (idle) gives us almost the same
information as cpu_iowait. Plus OpenBSD does not offer an iowait value
as Linux and thus the corresponding function would not be portable.
2018-05-06 21:11:50 +02:00
Aaron Marcher af3cdfbbc8 Add examples to config.def.h 2018-05-02 12:30:16 +02:00
Aaron Marcher 4f5ac5d9fe Remove battery_power for various reasons
- Battery power cannot be easily gatherable via apm(4)
- IMHO it does not represent essential information
2018-05-01 21:01:25 +02:00
Aaron Marcher 97ef7c2a1d Remove non-portable functions from config.def.h 2018-04-16 19:09:07 +02:00
Kurt Van Dijck 72a5e52a35
slstatus: add cpu_iowait
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-16 13:46:40 +02:00
Kamil Cholewiński b7d7ce9c5f
slstatus load_avg format string 2017-09-10 14:08:20 +02:00
Aaron Marcher 8f5219b6da
Added IPv6 address function
- Renamed "ip" function to "ipv4"
- Added "ipv6" function
- Adjusted README and config.def.h accordingly
2017-08-14 18:00:46 +02:00
Aaron Marcher fcc5c683a6
sexy config.def.h table 2017-08-14 14:04:21 +02:00
Laslo Hunhold 796b661284
Refactor main()
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-13 23:45:16 +02:00
Aaron Marcher c4779c9b15
Removed #define for unknown_str
Debugging #define is very difficult. The performance overhead of static const
char is negligible.
2017-08-12 13:27:30 +02:00
Aaron Marcher be12b6b350
Removed #define for update interval
Debugging #define, especially in mathematical constructs is very
difficult. The performance overhead of static const int is negligible.
2017-08-12 13:16:12 +02:00
aaron marcher 4b4b2ac079
add num_files() function for maildirs ;) 2017-08-06 15:02:16 +02:00
Aaron Marcher 597cdc6b5c
use a static buffer instead of dynamic memory 2017-06-13 00:06:04 +02:00
Aaron Marcher abbaa7af44
remove format characters from stat functions 2017-06-12 23:59:21 +02:00
Aaron Marcher 832b21ca4b
add cpu_freq function 2017-06-12 23:56:21 +02:00
Aaron Marcher 259e967cbf
add battery_power function 2017-06-12 23:55:27 +02:00
Aaron Marcher 823f2d047f
Added keyboard_indicators (Fixes #31) 2017-01-16 12:10:56 +01:00
parazyd 62f4016430
add vol_perc notes, add braces to singleline statements 2016-12-30 12:16:07 +01:00
parazyd c2808b6d99
refactor vol_perc to not depend on alsa libraries 2016-12-28 00:41:51 +01:00
Mike Coddington c3eb0c4012 Add "uname -r" functionality 2016-11-16 13:03:15 -06:00
Jody Leonard 46fb6abdc0 Edit config.def.h function descriptions 2016-10-15 06:45:33 -04:00
Aaron Marcher 3a3a3e4101 better default config.h 2016-10-05 11:40:36 +02:00
Aaron Marcher f13104156f battery_state() function added 2016-09-13 22:03:36 +02:00
Aaron Marcher 87c1377b08 simplified vol_perc() (and with that config.def.h is super clean) 2016-09-13 21:08:44 +02:00
Aaron Marcher 2d1bbf0d35 simplified battery_perc() a lot and removed useless options from config.def.h 2016-09-13 20:54:45 +02:00
Aaron Marcher 217da011dd brought back update interval 2016-09-09 19:26:06 +02:00
Aaron Marcher 3bfa5fe60d coding style fixes 2016-09-09 19:15:43 +02:00
Ali H. Fardan de4f20ace3 removed UPDATE_INTERVAL, it is neat to have it but removing it is a tradeoff worth making, because the clock would act weird if this used to work with cpu_perc(). 2016-09-03 21:43:05 +03:00
Ali H. Fardan b800eb21a3 removed vol function from the default config file 2016-08-31 02:17:42 +03:00
Ali H. Fardan 24c4134df6 removed a misplaced ';' 2016-08-28 16:24:19 +03:00
Ali H. Fardan 47ddf9382e used constant string literals && remote initialization to in battery_perc() && trying to fix possible buffer overflow 2016-08-28 16:20:50 +03:00
Ali H. Fardan 8e039b9dd2 corrected the time format 2016-08-21 15:21:20 +03:00
Aaron Marcher 85a2b9b79d added uptime function 2016-08-18 13:43:18 +02:00
Aaron Marcher 83c98554ed load avg 2016-08-18 13:30:45 +02:00
Aaron Marcher 1d43e2f2b2 added configuration option for n/a text 2016-08-18 13:03:42 +02:00
Aaron Marcher ad8ab20c63 Formatting commit :(
I know formatting commits suck... And I try to avoid them.

But this commit was absolutely necessary... The coding style in this
program was not ok and not the same over the whole program.

The commit is hard to read, but this is what I changed:
- Tabs for indentation instead of spaces
- Same style over the whole program (suckless style)
2016-08-16 11:41:43 +02:00
Aaron Marcher 093f39df23 added wifi essid 2016-08-15 14:43:29 +02:00
Aaron Marcher f6f0c895ce Added shell command function 2016-08-15 12:23:35 +02:00
Aaron Marcher 16716dd130 added, username, gid, uid 2016-06-13 18:49:50 +02:00
Aaron Marcher fb524b6050 added disk functions for details 2016-06-10 19:13:13 +02:00
Aaron Marcher 2e72b212d3 hostname function 2016-06-10 15:53:07 +02:00