suckless/slstatus.git
6 years agobattery: OS split
Quentin Rameau [Mon, 30 Apr 2018 13:14:32 +0000 (15:14 +0200)]
battery: OS split

6 years agoMakefile: detect running OS
Quentin Rameau [Mon, 30 Apr 2018 13:14:31 +0000 (15:14 +0200)]
Makefile: detect running OS

6 years agocpu_freq: Port to OpenBSD
Aaron Marcher [Mon, 30 Apr 2018 11:20:24 +0000 (13:20 +0200)]
cpu_freq: Port to OpenBSD

In OpenBSD CPU frequency gets fetched using sysctl now.

6 years agoFix typo in temperature
Aaron Marcher [Sun, 29 Apr 2018 20:44:09 +0000 (22:44 +0200)]
Fix typo in temperature

6 years agoUpdate README for OpenBSD build
Aaron Marcher [Sun, 29 Apr 2018 20:33:15 +0000 (22:33 +0200)]
Update README for OpenBSD build

6 years agouptime: Separate function for readbility
Aaron Marcher [Sun, 29 Apr 2018 18:07:09 +0000 (20:07 +0200)]
uptime: Separate function for readbility

6 years agobattery: Separate function for readbility
Aaron Marcher [Sun, 29 Apr 2018 18:02:42 +0000 (20:02 +0200)]
battery: Separate function for readbility

6 years agoram: Move up includes
Aaron Marcher [Sun, 29 Apr 2018 18:00:38 +0000 (20:00 +0200)]
ram: Move up includes

6 years agoSort LICENSE according to first commit
Aaron Marcher [Sun, 29 Apr 2018 16:50:44 +0000 (18:50 +0200)]
Sort LICENSE according to first commit

6 years agotemp: Port to OpenBSD
Aaron Marcher [Sun, 29 Apr 2018 16:35:41 +0000 (18:35 +0200)]
temp: Port to OpenBSD

In OpenBSD temperature gets fetched using sysctl now.

6 years agoRemove vol_perc() from todo in README
Aaron Marcher [Sun, 29 Apr 2018 14:08:45 +0000 (16:08 +0200)]
Remove vol_perc() from todo in README

6 years agoUpdate LICENSE for parazyd
Aaron Marcher [Sun, 29 Apr 2018 14:05:53 +0000 (16:05 +0200)]
Update LICENSE for parazyd

6 years agoAdd OpenBSD support in volume.c
parazyd [Sun, 29 Apr 2018 13:41:18 +0000 (15:41 +0200)]
Add OpenBSD support in volume.c

6 years agoUpdate LICENSE for Ali H. Fardan
Aaron Marcher [Sun, 29 Apr 2018 11:02:08 +0000 (13:02 +0200)]
Update LICENSE for Ali H. Fardan

6 years agoRemove ipv{4,6}() from todo in README
Aaron Marcher [Sun, 29 Apr 2018 11:00:12 +0000 (13:00 +0200)]
Remove ipv{4,6}() from todo in README

6 years agoip: add OpenBSD support
Ali H. Fardan [Sun, 29 Apr 2018 07:55:38 +0000 (10:55 +0300)]
ip: add OpenBSD support

ip.c already works on OpenBSD, it's just missing some headers:

6 years agoRemove non-portable functions from config.def.h
Aaron Marcher [Mon, 16 Apr 2018 17:09:07 +0000 (19:09 +0200)]
Remove non-portable functions from config.def.h

6 years agoAdd Darron Anderson to LICENSE
Aaron Marcher [Sat, 14 Apr 2018 17:44:54 +0000 (19:44 +0200)]
Add Darron Anderson to LICENSE

Thank you for your contribution.

6 years agoRemove ram_*() from README
Aaron Marcher [Sat, 14 Apr 2018 17:44:25 +0000 (19:44 +0200)]
Remove ram_*() from README

6 years agoAdd OpenBSD RAM stats
Darron Anderson [Sat, 14 Apr 2018 09:41:35 +0000 (09:41 +0000)]
Add OpenBSD RAM stats

6 years agoFormat error messages properly
Aaron Marcher [Wed, 28 Mar 2018 17:46:27 +0000 (19:46 +0200)]
Format error messages properly

Make use of strerror(errno) and format all errors equally:
function ['parameters']: error message

6 years agoRemove program name from error messages
Aaron Marcher [Wed, 28 Mar 2018 16:49:27 +0000 (18:49 +0200)]
Remove program name from error messages

6 years agoGet rid of err.h as it is not portable
Aaron Marcher [Wed, 28 Mar 2018 16:26:56 +0000 (18:26 +0200)]
Get rid of err.h as it is not portable

Replace warn() and warnx() with fprintf() and add <stdio.h> where
necessary.

6 years agoRemove unnecessary headers
Aaron Marcher [Wed, 28 Mar 2018 16:14:08 +0000 (18:14 +0200)]
Remove unnecessary headers

6 years agoRemove ALSA dependency from README
Aaron Marcher [Mon, 26 Mar 2018 16:09:30 +0000 (18:09 +0200)]
Remove ALSA dependency from README

ALSA is not a dependency anymore as we use /dev/mixer. The corresponding
notice about PulseAudio is thus not necessary too.

6 years agoMore robust preprocessor switches
Aaron Marcher [Wed, 21 Mar 2018 11:21:37 +0000 (12:21 +0100)]
More robust preprocessor switches

Replace #ifdef with #if defined() and #elif with #elif defined() as it
should only test if it is defined or not.

6 years agouptime: Port to OpenBSD.
Aaron Marcher [Mon, 19 Mar 2018 23:48:10 +0000 (00:48 +0100)]
uptime: Port to OpenBSD.

In OpenBSD uptime gets fetched using sysctl now.

6 years agobattery_perc: Port to OpenBSD.
Aaron Marcher [Mon, 19 Mar 2018 17:44:52 +0000 (18:44 +0100)]
battery_perc: Port to OpenBSD.

In OpenBSD battery percentage gets fetched using apm now.

6 years agoREADME: Add list of non-portable functions
Aaron Marcher [Sun, 18 Mar 2018 22:30:54 +0000 (23:30 +0100)]
README: Add list of non-portable functions

6 years agoBuild Linux-only functions only on Linux
Aaron Marcher [Sun, 18 Mar 2018 22:26:13 +0000 (23:26 +0100)]
Build Linux-only functions only on Linux

6 years agoREADME: Add Todo
Aaron Marcher [Sun, 18 Mar 2018 21:51:51 +0000 (22:51 +0100)]
README: Add Todo

6 years agoMerge pull request #43 from SiIky/unknown_str
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

6 years agoPrint 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.

6 years agoUpdate LICENSE year for myself.
Aaron Marcher [Sat, 6 Jan 2018 22:40:05 +0000 (23:40 +0100)]
Update LICENSE year for myself.

6 years agoFix a bug in wifi_essid().
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.

6 years agoSmall fixes in config.mk
Aaron Marcher [Sun, 3 Dec 2017 00:40:38 +0000 (01:40 +0100)]
Small fixes in config.mk

6 years agoUpdate LICENSE for parazyd
Aaron Marcher [Tue, 24 Oct 2017 09:23:27 +0000 (11:23 +0200)]
Update LICENSE for parazyd

6 years agoReturn actual percentage for wifi_perc()
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.

7 years agoMove components into dedicated subdirectory
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.

7 years agoGet rid of HDR variable
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.

7 years agoSimplify Makefile
Laslo Hunhold [Sun, 17 Sep 2017 21:48:11 +0000 (23:48 +0200)]
Simplify Makefile

7 years agoFix missing config.h in Makefile
Quentin Rameau [Sun, 17 Sep 2017 20:31:26 +0000 (22:31 +0200)]
Fix missing config.h in Makefile

7 years agoAdded LICENSE statements to all source files
Aaron Marcher [Sun, 17 Sep 2017 15:45:03 +0000 (17:45 +0200)]
Added LICENSE statements to all source files

7 years agoProperly declare buf as extern and fix all unused-warnings
Laslo Hunhold [Sun, 17 Sep 2017 15:21:54 +0000 (17:21 +0200)]
Properly declare buf as extern and fix all unused-warnings

7 years agoRewrite Makefile to accomodate file split
Laslo Hunhold [Sun, 17 Sep 2017 15:12:44 +0000 (17:12 +0200)]
Rewrite Makefile to accomodate file split

7 years agoSplit into multiple files
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

7 years agoAdd blank line after setlocale
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.

7 years agoslstatus: set locale
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>
7 years agoAdded CPU iowait to README
Aaron Marcher [Sat, 16 Sep 2017 11:54:28 +0000 (13:54 +0200)]
Added CPU iowait to README

7 years agoslstatus: add cpu_iowait
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>
7 years agoDeleted slstatus.png as it is unnecessary
Aaron Marcher [Thu, 14 Sep 2017 20:20:44 +0000 (22:20 +0200)]
Deleted slstatus.png as it is unnecessary

7 years agoslstatus load_avg format string
Kamil Cholewiński [Fri, 8 Sep 2017 21:08:28 +0000 (23:08 +0200)]
slstatus load_avg format string

7 years agoAdded IPv6 address function
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

7 years agosexy config.def.h table
Aaron Marcher [Mon, 14 Aug 2017 12:04:21 +0000 (14:04 +0200)]
sexy config.def.h table

7 years agoFix a little logic error
Laslo Hunhold [Mon, 14 Aug 2017 08:24:43 +0000 (10:24 +0200)]
Fix a little logic error

7 years agoAdd pscanf()
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.

7 years agoRefactor main()
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.

7 years agoSimplify signal handling a bit
Laslo Hunhold [Sun, 13 Aug 2017 18:33:44 +0000 (20:33 +0200)]
Simplify signal handling a bit

7 years agoRemove unnecessary prototypes
Laslo Hunhold [Sun, 13 Aug 2017 18:21:49 +0000 (20:21 +0200)]
Remove unnecessary prototypes

7 years agoRemove unnecessary blank lines after license-notice
Laslo Hunhold [Sun, 13 Aug 2017 18:21:04 +0000 (20:21 +0200)]
Remove unnecessary blank lines after license-notice

7 years agoFix man page .Os field
Aaron Marcher [Sun, 13 Aug 2017 21:25:44 +0000 (23:25 +0200)]
Fix man page .Os field

7 years agoAdded Makefile target for distribution tarballs.
Aaron Marcher [Sun, 13 Aug 2017 21:05:22 +0000 (23:05 +0200)]
Added Makefile target for distribution tarballs.

7 years agoFixed man page path
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.

7 years agoslstatus != dmenu lol
Aaron Marcher [Sat, 12 Aug 2017 11:37:12 +0000 (13:37 +0200)]
slstatus != dmenu lol

7 years agoRemoved #define for unknown_str
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.

7 years agoRemoved #define for update interval
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.

7 years agoUpdated LICENSE
Aaron Marcher [Sat, 12 Aug 2017 10:55:53 +0000 (12:55 +0200)]
Updated LICENSE

Extended Ali H. Fardan contribution dates

7 years agokeyboard_indicators: fix segfault when -s is specified
Ali H. Fardan [Sat, 12 Aug 2017 04:01:13 +0000 (07:01 +0300)]
keyboard_indicators: fix segfault when -s is specified

7 years agoFixed possible NULL-deref and removed unnecessary XOpenDisplay()
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.

7 years agoAdd and use LEN() macro
Laslo Hunhold [Fri, 11 Aug 2017 11:39:19 +0000 (13:39 +0200)]
Add and use LEN() macro

7 years agoRefactor battery_state()
Laslo Hunhold [Thu, 10 Aug 2017 22:17:49 +0000 (00:17 +0200)]
Refactor battery_state()

7 years agoReformatted LICENSE to fit 75 character width
Aaron Marcher [Thu, 10 Aug 2017 20:43:56 +0000 (22:43 +0200)]
Reformatted LICENSE to fit 75 character width

7 years agoPrint usage() when we are left with arguments
Laslo Hunhold [Thu, 10 Aug 2017 20:23:55 +0000 (22:23 +0200)]
Print usage() when we are left with arguments

7 years agoReduce -o | -n to -s
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.

7 years agoRemove d- and v-flags
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.

7 years agoConvert slstatus.1 to mandoc, simplify it and remove -h
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.

7 years agoRefactor build system
Laslo Hunhold [Thu, 10 Aug 2017 19:32:10 +0000 (21:32 +0200)]
Refactor build system

7 years agoNew README in plain text
Aaron Marcher [Thu, 10 Aug 2017 19:49:37 +0000 (21:49 +0200)]
New README in plain text

7 years agoRemoved TODO.md
Aaron Marcher [Thu, 10 Aug 2017 19:10:17 +0000 (21:10 +0200)]
Removed TODO.md

7 years agoRemoved CONTRIBUTING.md
Aaron Marcher [Thu, 10 Aug 2017 19:08:53 +0000 (21:08 +0200)]
Removed CONTRIBUTING.md

7 years agoMoved contributors to LICENSE
Aaron Marcher [Thu, 10 Aug 2017 19:06:48 +0000 (21:06 +0200)]
Moved contributors to LICENSE

7 years agoCopyright sign (C) is not required in 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

7 years agoRemoved .gitignore from repository
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.

7 years agonew arg.h version by frign
Aaron Marcher [Thu, 10 Aug 2017 09:31:57 +0000 (11:31 +0200)]
new arg.h version by frign

7 years agoadd num_files() function for maildirs ;)
aaron marcher [Sun, 6 Aug 2017 13:02:16 +0000 (15:02 +0200)]
add num_files() function for maildirs ;)

7 years agoupdated readme
Aaron Marcher [Mon, 12 Jun 2017 22:11:35 +0000 (00:11 +0200)]
updated readme

7 years agocheck for fgets/fscanf return values
Aaron Marcher [Mon, 12 Jun 2017 22:06:56 +0000 (00:06 +0200)]
check for fgets/fscanf return values

7 years agouse a static buffer instead of dynamic memory
Aaron Marcher [Mon, 12 Jun 2017 22:06:04 +0000 (00:06 +0200)]
use a static buffer instead of dynamic memory

7 years agoremove format characters from stat functions
Aaron Marcher [Mon, 12 Jun 2017 21:59:21 +0000 (23:59 +0200)]
remove format characters from stat functions

7 years agoadd cpu_freq function
Aaron Marcher [Mon, 12 Jun 2017 21:56:21 +0000 (23:56 +0200)]
add cpu_freq function

7 years agoadd battery_power function
Aaron Marcher [Mon, 12 Jun 2017 21:55:27 +0000 (23:55 +0200)]
add battery_power function

7 years agoadded option to output only once and exit afterwards
Aaron Marcher [Thu, 11 May 2017 17:06:45 +0000 (19:06 +0200)]
added option to output only once and exit afterwards

7 years agoenable stack protector and compile to position independent executable
Aaron Marcher [Thu, 20 Apr 2017 20:33:10 +0000 (22:33 +0200)]
enable stack protector and compile to position independent executable

7 years agosimplified and improved vol_perc()
Aaron Marcher [Thu, 20 Apr 2017 20:30:04 +0000 (22:30 +0200)]
simplified and improved vol_perc()

7 years agofix overflow in run_command()
Aaron Marcher [Thu, 20 Apr 2017 20:20:19 +0000 (22:20 +0200)]
fix overflow in run_command()

7 years agousername(): get rid of unneeded uid variable
Aaron Marcher [Thu, 20 Apr 2017 20:18:24 +0000 (22:18 +0200)]
username(): get rid of unneeded uid variable

7 years agoMerge pull request #39 from stoeckmann/fgets
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.

7 years agoOn 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>
7 years agoMerge pull request #38 from stoeckmann/terminating-nul
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.

7 years agoFixed 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>