Page MenuHomeFreeBSD

x11/bhotkeys-lid-state: New port
ClosedPublic

Authored by dteske on Fri, Oct 9, 4:38 AM.
Tags
None
Referenced Files
F175427333: D60497.id.diff
Sat, Oct 10, 7:02 PM
F175423716: D60497.diff
Sat, Oct 10, 6:27 PM
F175417323: D60497.diff
Sat, Oct 10, 5:27 PM
F175412666: D60497.id189293.diff
Sat, Oct 10, 4:40 PM
F175409637: D60497.diff
Sat, Oct 10, 4:09 PM
F175404727: D60497.id189159.diff
Sat, Oct 10, 3:14 PM
F175352464: D60497.id189159.diff
Sat, Oct 10, 5:37 AM
F175326341: D60497.diff
Sat, Oct 10, 12:07 AM
Subscribers
None

Details

Summary

Super+Z lid stay-awake hotkey for bhotkeys.
lid-switchd holds the lid sysctl for the session.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77881
Build 74764: arc lint + arc unit

Event Timeline

dteske requested review of this revision.Fri, Oct 9, 4:38 AM
dteske created this revision.
x11/bhotkeys-lid-state/pkg-plist
3

Same comment as in another recent review: The RC script does pw groupadd "$lid_switchd_group". It would be better if the port did this. See https://docs.freebsd.org/en/books/porters-handbook/book/#users-and-groups.

Create group (lid_switchd:402) as part of package install

Update port to upstream 1.3 which drops group creation

x11/bhotkeys-lid-state/pkg-plist
9

The man page says lid_switchd_enable=YES and service lid_switchd start, but the rc script is lid-switchd. Should we check that there isn't an issue with the names?

dteske added inline comments.
x11/bhotkeys-lid-state/pkg-plist
3

done

9

when someone says “service lid-switchd start” the rcvar variable in the rc.d script should check lid_switchd_enable

You can’t have a variable in shell with a dash; and there’s no strict requirement that the rc.d service be the same as the rcvar component or even that the rcvar be {name}_enable

jrm added inline comments.
x11/bhotkeys-lid-state/pkg-plist
9

Ok, thanks for confirming.

This revision is now accepted and ready to land.Sat, Oct 10, 12:48 AM
dteske marked an inline comment as done.

Update port to 1.3.1 which fixes service typo in lid-switchd(8)

This revision now requires review to proceed.Sat, Oct 10, 3:32 PM
dteske added inline comments.
x11/bhotkeys-lid-state/pkg-plist
9

Typo fixed

This revision is now accepted and ready to land.Sat, Oct 10, 3:49 PM
x11/bhotkeys-lid-state/pkg-plist
9

One thing I missed last time: You also want USE_RC_SUBR as you did in x11/framework-autorotate.

Ref: https://docs.freebsd.org/en/books/porters-handbook/book/#rc-scripts.

dteske added inline comments.
x11/bhotkeys-lid-state/pkg-plist
9

USE_RC_SUBR requires the rc.d script to live in files/

Adding USE_RC_SUBR to bhotkeys-lid-state results in the below error (caught by poudriere testport):

===>  Configuring for bhotkeys-lid-state-1.3.1
** Missing /usr/ports/x11/bhotkeys-lid-state/files/lid-switchd.in for bhotkeys-lid-state-1.3.1.
*** Error code 1

Stop.
make: stopped making "configure" in /usr/ports/x11/bhotkeys-lid-state
build of x11/bhotkeys-lid-state | bhotkeys-lid-state-1.3.1 ended at Sat Oct 10 09:39:46 PDT 2026
build time: 00:00:01
!!! build failure encountered !!!

USE_RC_SUBR= framework_autorotate works in x11/framework-autorotate because that port has files/framework_autorotate.in

x11/bhotkeys-lid-state/pkg-plist
9

I double-checked the porter's handbook -- USE_RC_SUBR is strictly for rc.d scripts housed in the port's files/ directory and states:

Scripts must be placed in the files subdirectory and a .in suffix must be added to their filename.
This revision was automatically updated to reflect the committed changes.