Skip to content

Add support for OpenBSD / make wordexp optional#154

Open
landryb wants to merge 3 commits intoswaywm:masterfrom
landryb:support-openbsd
Open

Add support for OpenBSD / make wordexp optional#154
landryb wants to merge 3 commits intoswaywm:masterfrom
landryb:support-openbsd

Conversation

@landryb
Copy link
Copy Markdown

@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