Aaron Marcher [Sun, 18 Mar 2018 22:26:13 +0000 (23:26 +0100)]
Build Linux-only functions only on Linux
Aaron Marcher [Sun, 18 Mar 2018 21:51:51 +0000 (22:51 +0100)]
README: Add Todo
Aaron Marcher [Sat, 17 Feb 2018 20:00:04 +0000 (20:00 +0000)]
Merge pull request #43 from SiIky/unknown_str
Print unknown_str in case of error
SiIky [Sat, 17 Feb 2018 18:08:27 +0000 (18:08 +0000)]
Print unknown_str in case of error
func can return NULL in case of error, but no checking is done when
printing, and unknown_str wasn't being used anywhere.
Aaron Marcher [Sat, 6 Jan 2018 22:40:05 +0000 (23:40 +0100)]
Update LICENSE year for myself.
Aaron Marcher [Sat, 6 Jan 2018 22:37:09 +0000 (23:37 +0100)]
Fix a bug in wifi_essid().
When an invalid interface name is passed to wifi_essid() it does not
close opened sockets.
Aaron Marcher [Sun, 3 Dec 2017 00:40:38 +0000 (01:40 +0100)]
Small fixes in config.mk
Aaron Marcher [Tue, 24 Oct 2017 09:23:27 +0000 (11:23 +0200)]
Update LICENSE for parazyd
parazyd [Tue, 24 Oct 2017 09:03:17 +0000 (11:03 +0200)]
Return actual percentage for wifi_perc()
Implement basic percentage calculation for wifi_perc. With this
commit, the function returns correct percentage, since the max
of what /proc/net/wireless returns is 70.
Laslo Hunhold [Sun, 24 Sep 2017 13:33:01 +0000 (15:33 +0200)]
Move components into dedicated subdirectory
This brings us a lot more tidiness.
Laslo Hunhold [Mon, 18 Sep 2017 06:53:19 +0000 (08:53 +0200)]
Get rid of HDR variable
The HDR variable is used for general purpose headers, which are not
given in this project. arg.h and config.h are only needed for
slstatus.c, not every component $(COM:=.c).
This also fixes a problem introduced in
e04a3853643df1c98a451969d515d8850f138bcc, where config.h is pulled into
the tarball.
Laslo Hunhold [Sun, 17 Sep 2017 21:48:11 +0000 (23:48 +0200)]
Simplify Makefile
Quentin Rameau [Sun, 17 Sep 2017 20:31:26 +0000 (22:31 +0200)]
Fix missing config.h in Makefile
Aaron Marcher [Sun, 17 Sep 2017 15:45:03 +0000 (17:45 +0200)]
Added LICENSE statements to all source files
Laslo Hunhold [Sun, 17 Sep 2017 15:21:54 +0000 (17:21 +0200)]
Properly declare buf as extern and fix all unused-warnings
Laslo Hunhold [Sun, 17 Sep 2017 15:12:44 +0000 (17:12 +0200)]
Rewrite Makefile to accomodate file split
Aaron Marcher [Sun, 17 Sep 2017 14:18:17 +0000 (16:18 +0200)]
Split into multiple files
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
Aaron Marcher [Sat, 16 Sep 2017 12:11:49 +0000 (14:11 +0200)]
Add blank line after setlocale
setlocale() has to be separated from the signal handling.
Kurt Van Dijck [Mon, 11 Sep 2017 18:05:21 +0000 (20:05 +0200)]
slstatus: set locale
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>
Aaron Marcher [Sat, 16 Sep 2017 11:54:28 +0000 (13:54 +0200)]
Added CPU iowait to README
Kurt Van Dijck [Thu, 14 Sep 2017 21:58:38 +0000 (23:58 +0200)]
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>
Aaron Marcher [Thu, 14 Sep 2017 20:20:44 +0000 (22:20 +0200)]
Deleted slstatus.png as it is unnecessary
Kamil Cholewiński [Fri, 8 Sep 2017 21:08:28 +0000 (23:08 +0200)]
slstatus load_avg format string
Aaron Marcher [Mon, 14 Aug 2017 16:00:46 +0000 (18:00 +0200)]
Added IPv6 address function
- Renamed "ip" function to "ipv4"
- Added "ipv6" function
- Adjusted README and config.def.h accordingly
Aaron Marcher [Mon, 14 Aug 2017 12:04:21 +0000 (14:04 +0200)]
sexy config.def.h table
Laslo Hunhold [Mon, 14 Aug 2017 08:24:43 +0000 (10:24 +0200)]
Fix a little logic error
Laslo Hunhold [Sun, 13 Aug 2017 22:34:00 +0000 (00:34 +0200)]
Add pscanf()
This reduces a lot of equivalent code to one function call.
Laslo Hunhold [Sun, 13 Aug 2017 21:21:23 +0000 (23:21 +0200)]
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.
Laslo Hunhold [Sun, 13 Aug 2017 18:33:44 +0000 (20:33 +0200)]
Simplify signal handling a bit
Laslo Hunhold [Sun, 13 Aug 2017 18:21:49 +0000 (20:21 +0200)]
Remove unnecessary prototypes
Laslo Hunhold [Sun, 13 Aug 2017 18:21:04 +0000 (20:21 +0200)]
Remove unnecessary blank lines after license-notice
Aaron Marcher [Sun, 13 Aug 2017 21:25:44 +0000 (23:25 +0200)]
Fix man page .Os field
Aaron Marcher [Sun, 13 Aug 2017 21:05:22 +0000 (23:05 +0200)]
Added Makefile target for distribution tarballs.
Aaron Marcher [Sun, 13 Aug 2017 20:56:14 +0000 (22:56 +0200)]
Fixed man page path
According to the FHS, /usr/local/share/man is the correct man page path
in this projects's case. Set this to default in config.mk.
Aaron Marcher [Sat, 12 Aug 2017 11:37:12 +0000 (13:37 +0200)]
slstatus != dmenu lol
Aaron Marcher [Sat, 12 Aug 2017 11:27:30 +0000 (13:27 +0200)]
Removed #define for unknown_str
Debugging #define is very difficult. The performance overhead of static const
char is negligible.
Aaron Marcher [Sat, 12 Aug 2017 11:06:24 +0000 (13:06 +0200)]
Removed #define for update interval
Debugging #define, especially in mathematical constructs is very
difficult. The performance overhead of static const int is negligible.
Aaron Marcher [Sat, 12 Aug 2017 10:55:53 +0000 (12:55 +0200)]
Updated LICENSE
Extended Ali H. Fardan contribution dates
Ali H. Fardan [Sat, 12 Aug 2017 04:01:13 +0000 (07:01 +0300)]
keyboard_indicators: fix segfault when -s is specified
Aaron Marcher [Fri, 11 Aug 2017 12:33:02 +0000 (14:33 +0200)]
Fixed possible NULL-deref and removed unnecessary XOpenDisplay()
- 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.
Laslo Hunhold [Fri, 11 Aug 2017 11:39:19 +0000 (13:39 +0200)]
Add and use LEN() macro
Laslo Hunhold [Thu, 10 Aug 2017 22:17:49 +0000 (00:17 +0200)]
Refactor battery_state()
Aaron Marcher [Thu, 10 Aug 2017 20:43:56 +0000 (22:43 +0200)]
Reformatted LICENSE to fit 75 character width
Laslo Hunhold [Thu, 10 Aug 2017 20:23:55 +0000 (22:23 +0200)]
Print usage() when we are left with arguments
Laslo Hunhold [Thu, 10 Aug 2017 20:22:39 +0000 (22:22 +0200)]
Reduce -o | -n to -s
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.
Laslo Hunhold [Thu, 10 Aug 2017 19:56:06 +0000 (21:56 +0200)]
Remove d- and v-flags
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.
Laslo Hunhold [Thu, 10 Aug 2017 19:36:29 +0000 (21:36 +0200)]
Convert slstatus.1 to mandoc, simplify it and remove -h
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.
Laslo Hunhold [Thu, 10 Aug 2017 19:32:10 +0000 (21:32 +0200)]
Refactor build system
Aaron Marcher [Thu, 10 Aug 2017 19:49:37 +0000 (21:49 +0200)]
New README in plain text
Aaron Marcher [Thu, 10 Aug 2017 19:10:17 +0000 (21:10 +0200)]
Removed TODO.md
Aaron Marcher [Thu, 10 Aug 2017 19:08:53 +0000 (21:08 +0200)]
Removed CONTRIBUTING.md
Aaron Marcher [Thu, 10 Aug 2017 19:06:48 +0000 (21:06 +0200)]
Moved contributors to LICENSE
Aaron Marcher [Thu, 10 Aug 2017 18:32:14 +0000 (20:32 +0200)]
Copyright sign (C) is not required in LICENSE
According to https://opensource.org/licenses/ISC
Aaron Marcher [Thu, 10 Aug 2017 18:30:52 +0000 (20:30 +0200)]
Removed .gitignore from repository
A file outside the repository (.git/info/exclude) can replace this and
suits better for this usecase.
Aaron Marcher [Thu, 10 Aug 2017 09:31:57 +0000 (11:31 +0200)]
new arg.h version by frign
aaron marcher [Sun, 6 Aug 2017 13:02:16 +0000 (15:02 +0200)]
add num_files() function for maildirs ;)
Aaron Marcher [Mon, 12 Jun 2017 22:11:35 +0000 (00:11 +0200)]
updated readme
Aaron Marcher [Mon, 12 Jun 2017 22:06:56 +0000 (00:06 +0200)]
check for fgets/fscanf return values
Aaron Marcher [Mon, 12 Jun 2017 22:06:04 +0000 (00:06 +0200)]
use a static buffer instead of dynamic memory
Aaron Marcher [Mon, 12 Jun 2017 21:59:21 +0000 (23:59 +0200)]
remove format characters from stat functions
Aaron Marcher [Mon, 12 Jun 2017 21:56:21 +0000 (23:56 +0200)]
add cpu_freq function
Aaron Marcher [Mon, 12 Jun 2017 21:55:27 +0000 (23:55 +0200)]
add battery_power function
Aaron Marcher [Thu, 11 May 2017 17:06:45 +0000 (19:06 +0200)]
added option to output only once and exit afterwards
Aaron Marcher [Thu, 20 Apr 2017 20:33:10 +0000 (22:33 +0200)]
enable stack protector and compile to position independent executable
Aaron Marcher [Thu, 20 Apr 2017 20:30:04 +0000 (22:30 +0200)]
simplified and improved vol_perc()
Aaron Marcher [Thu, 20 Apr 2017 20:20:19 +0000 (22:20 +0200)]
fix overflow in run_command()
Aaron Marcher [Thu, 20 Apr 2017 20:18:24 +0000 (22:18 +0200)]
username(): get rid of unneeded uid variable
Aaron Marcher [Thu, 20 Apr 2017 20:14:56 +0000 (22:14 +0200)]
Merge pull request #39 from stoeckmann/fgets
On success, fgets always terminates the result.
Tobias Stoeckmann [Tue, 4 Apr 2017 19:27:31 +0000 (21:27 +0200)]
On success, fgets always terminates the result.
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>
Aaron Marcher [Sun, 2 Apr 2017 13:27:09 +0000 (15:27 +0200)]
Merge pull request #38 from stoeckmann/terminating-nul
Fixed out of boundary write on long lines.
Tobias Stoeckmann [Sun, 2 Apr 2017 11:12:03 +0000 (13:12 +0200)]
Fixed out of boundary write on long lines.
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>
Aaron Marcher [Thu, 30 Mar 2017 15:32:20 +0000 (17:32 +0200)]
loading thresholds state
Aaron Marcher [Mon, 23 Jan 2017 20:01:41 +0000 (21:01 +0100)]
Fixed XCloseDisplay() which is not reached in keyboard_indicators()
Aaron Marcher [Mon, 16 Jan 2017 11:10:56 +0000 (12:10 +0100)]
Added keyboard_indicators (Fixes #31)
Aaron Marcher [Mon, 9 Jan 2017 11:05:29 +0000 (12:05 +0100)]
Makefile fix and vol_perc fix for mute
Aaron Marcher [Mon, 9 Jan 2017 08:29:58 +0000 (09:29 +0100)]
simplified Makefile
Aaron Marcher [Mon, 9 Jan 2017 08:23:17 +0000 (09:23 +0100)]
small Makefile tweak
Aaron Marcher [Mon, 9 Jan 2017 08:21:18 +0000 (09:21 +0100)]
Makefile: Added back config.h handling in Makefile
Aaron Marcher [Mon, 9 Jan 2017 07:24:26 +0000 (08:24 +0100)]
Makefile: Fixes #35
Aaron Marcher [Sat, 7 Jan 2017 21:34:45 +0000 (22:34 +0100)]
todo
Aaron Marcher [Sat, 7 Jan 2017 21:33:28 +0000 (22:33 +0100)]
removed ./extern/
Aaron Marcher [Sat, 7 Jan 2017 21:31:46 +0000 (22:31 +0100)]
removed strlcat dependency (was used only once)
Aaron Marcher [Sat, 7 Jan 2017 21:01:49 +0000 (22:01 +0100)]
got rid of concat.h
Aaron Marcher [Sat, 7 Jan 2017 20:49:10 +0000 (21:49 +0100)]
saner makefile: cleaner, simpler, suckless
Aaron Marcher [Sat, 7 Jan 2017 20:28:22 +0000 (21:28 +0100)]
happy new year!
Aaron Marcher [Sat, 7 Jan 2017 20:19:40 +0000 (21:19 +0100)]
run_command: strlen() will not function if string is not null terminated
Aaron Marcher [Fri, 30 Dec 2016 22:13:21 +0000 (23:13 +0100)]
consistent coding style: usage() declaration, eval is a constant
Aaron Marcher [Fri, 30 Dec 2016 22:01:14 +0000 (23:01 +0100)]
Merge pull request #34 from parazyd/master
refactor vol_perc to not depend on alsa libraries
parazyd [Fri, 30 Dec 2016 13:21:19 +0000 (14:21 +0100)]
Merge branch 'master' into master
parazyd [Fri, 30 Dec 2016 11:16:07 +0000 (12:16 +0100)]
add vol_perc notes, add braces to singleline statements
Aaron Marcher [Thu, 29 Dec 2016 22:36:05 +0000 (23:36 +0100)]
why releases for such a small project? useless and overhead!
Aaron Marcher [Thu, 29 Dec 2016 22:30:53 +0000 (23:30 +0100)]
#undef strlcpy not needed anymore
Aaron Marcher [Thu, 29 Dec 2016 22:30:17 +0000 (23:30 +0100)]
tested wifi
Aaron Marcher [Thu, 29 Dec 2016 22:27:57 +0000 (23:27 +0100)]
Merge pull request #32 from R41z/master
several bugfixes and general improvements, see commits below.
Aaron Marcher [Thu, 29 Dec 2016 22:27:44 +0000 (23:27 +0100)]
Merge branch 'master' into master
raiz [Thu, 29 Dec 2016 12:37:17 +0000 (15:37 +0300)]
fix TODO markdown syntax && update
raiz [Thu, 29 Dec 2016 09:40:43 +0000 (12:40 +0300)]
add braces to single statements so drkhsh doesn't be upset
Aaron Marcher [Wed, 28 Dec 2016 22:59:19 +0000 (23:59 +0100)]
kernel_release() coding style and position in code fix
parazyd [Tue, 27 Dec 2016 23:41:51 +0000 (00:41 +0100)]
refactor vol_perc to not depend on alsa libraries
raiz [Tue, 27 Dec 2016 17:41:40 +0000 (20:41 +0300)]
usage(): return success if -h is called && print more appropriate usage, opts can't be all called at the same time, that's why a separator is required