Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OpenBSD / make wordexp optional #154

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

landryb
Copy link

@landryb landryb commented Nov 10, 2023

like done in swaywm/swaylock#325, replace wordexp() usage by handrolled C equivalents - i've been testing it working file with this in ~.config/swayidle/config:

timeout 10 'swaylock -f -c 00ff00'
timeout 20 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'

and it behaves as expected.

The handrolled line parser might be improved, but i've tested it with lines having extra spaces between keywords or trailing spaces.

Feedback welcome !

- like done in swaywm/swaylock#325, provide an alternative for swayidle
  configuration file lookup
- and provide a handrolled config line parser for 'timeout' commands, using
  strspn(), strchr() and asprintf()
- the latter is in recent POSIX so move _POSIX_C_SOURCE 200809L definition
  within #if HAVE_WORDEXP
- OpenBSD doesn't (and won't) have support for systemd/logind, so only care
  about timeout commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant