Commit Graph

35 Commits

Author SHA1 Message Date
NRK 0c2b3e5b5c do not rely on obsolete feature
function prototype with unspecified argument is obsolete since c99.

additionally some of these function which don't take any argument were
being called with a `const char *` arg, which is UB.

fix both these issues by declararing ALL the components to accept a
`const char *`, and name the arg "unused" if it's meant to be ignored.
2022-10-26 23:32:43 +02:00
michaelbuch12@gmail.com 798809ce02 Make volume component work on FreeBSD
- Edit compile instructions
- Reuse OpenBSD sndio implementation
2022-10-26 21:24:14 +02:00
Aaron Marcher dd5bfc3e51 Add comment for FreeBSD to config.mk
Apparently `-lkvm` is needed for swap on FreeBSD

Thanks to Micheal Buch and Jason Smith
(See thread https://lists.suckless.org/dev/1907/33594.html)
2020-11-30 21:24:34 +01:00
Ingo Feinerer 9ac721c23f Use the sioctl_open(3) OpenBSD API to access vol
Starting with OpenBSD 6.7 regular users cannot access raw audio devices
anymore, for improved security.

Instead use the sioctl_open(3) API to access and manipulate audio
controls exposed by sndiod(8). On the first call a permanent connection
is established with the running sndiod daemon, and call-back functions
are registered which are triggered when audio controls are changed
(e.g., a USB headset is attached) or when the volume is modified. On
subsequent calls we poll for changes; if there are no volume changes
this costs virtually nothing.

Joint work with Alexandre Ratchov
2020-11-30 21:24:33 +01:00
Ingo Feinerer c1dc896c80 Add native OpenBSD support for mute/volume
Based on functionality in dstat by Joerg Jung.
2019-02-13 13:35:44 +01:00
Laslo Hunhold 24b663d657 Tweak build system a little bit
Be consistent with brackets and add a comment for OpenBSD to make it
clearer what the actual intent of the uncommented line is.

In the Makefile, add a dependency of slstatus.o from config.mk.
2018-05-01 20:53:27 +02:00
Laslo Hunhold 42edfea89a Revert component-split
this reverts the commits from 92ab9ef52e up to
d42870d6ca.

After heavy consideration, the component split has more disadvantages
than advantages, especially given there will be utility-functions
sharing quite a lot of code that would then need to be duplicated, as it
does not fit into the util.c due to its speciality.

One big advantage of the component-wise build is readability, and
without doubt, this was achieved here. This point will be addressed
with a different approach that will be visible in the upcoming commits.

One big disadvantage of the component build is the fact that it
introduces state to the build process which is not necessary. Before its
introduction, the only influencing factors where the system-defines
__linux__ and __OpenBSD__. With the components, we are also relying on
the output of uname(1).
Additionally, if the os.mk is not present, make gives the output

     $ make
     Makefile:5: os.mk: No such file or directory
     make: *** No rule to make target 'os.mk'.  Stop.

This could easily be fixed by providing some sort of meta-rule for this
file, however, it indicates the problem we have here, and this entire
statefulness will heavily complicate packaging of this tool and makes
the build process much more complex than it actually has to be.
2018-05-01 19:43:34 +02:00
Quentin Rameau 2ea3d46f13 Makefile: move OS-specific libs to configure script 2018-04-30 16:27:07 +02:00
Quentin Rameau 95665e437b Makefile: separate default flags from user flags 2018-04-30 16:27:07 +02:00
parazyd d66e775c8d Add OpenBSD support in volume.c 2018-04-29 15:57:17 +02:00
Aaron Marcher 47d0073bfd
Small fixes in config.mk 2017-12-03 01:40:38 +01:00
Laslo Hunhold 914440b4fc
Properly declare buf as extern and fix all unused-warnings 2017-09-17 17:38:07 +02:00
Aaron Marcher 96334e2079
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.
2017-08-13 22:56:14 +02:00
Laslo Hunhold 4d33c36014
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.
2017-08-10 22:32:48 +02:00
Laslo Hunhold 8dad4910bf
Refactor build system 2017-08-10 22:32:14 +02:00
Aaron Marcher ac1a57ec30
enable stack protector and compile to position independent executable 2017-04-20 22:33:10 +02:00
Aaron Marcher d1915f0d4d
saner makefile: cleaner, simpler, suckless 2017-01-07 21:49:10 +01:00
parazyd 13604963bc Merge branch 'master' into master 2016-12-30 14:21:19 +01:00
Aaron Marcher 8fa6229759
why releases for such a small project? useless and overhead! 2016-12-29 23:36:05 +01:00
parazyd c2808b6d99
refactor vol_perc to not depend on alsa libraries 2016-12-28 00:41:51 +01:00
Aaron Marcher a2d2e801a2 3.0 2016-09-19 11:17:51 +02:00
Aaron Marcher bad8dc682d shorter copyright notice and moved back VERSION and _GNU_SOURCE as the man page version number fails 2016-09-18 22:00:50 +02:00
Ali H. Fardan f4a383382c several changes 2016-09-18 22:27:04 +03:00
Aaron Marcher d1423010d0 config.mk comment about -Wno-unused-functions 2016-09-18 17:22:12 +02:00
Aaron Marcher cfa0d9e8fe optimization 2016-09-18 17:15:50 +02:00
Aaron Marcher 4a7aba5151 added man page 2016-09-17 22:51:49 +02:00
Aaron Marcher fd0bb713d7 added optimization back (removed it for debugging some time ago) 2016-09-17 22:03:56 +02:00
Ali H. Fardan b9b6486cda bringed back the old config.mk 2016-09-05 01:40:47 +03:00
Ali H. Fardan 9fa858daea added a tool for resetting the status bar && worked around some issues && removed the makefile (we need a better one) 2016-09-05 01:13:48 +03:00
Ali H. Fardan 1654efe1d6 config.mk cleanup 2016-09-05 00:56:22 +03:00
Ali H. Fardan 6f31ca6ce3 fixed compiler warnings in a better way 2016-08-21 15:43:57 +03:00
Ali H. Fardan 73ec65a84d -Wextra 2016-08-21 11:10:37 +03:00
Aaron Marcher f9748dcca3 Removed the debug gcc flags 2016-08-16 17:34:50 +02:00
Daniel Walter 046e273a7e simplify smprintf by using vasprintf 2016-03-10 11:49:48 +01:00
Aaron Marcher 94ea78f0fe initial commit 2016-03-04 18:07:42 +01:00