From e0e45f0697ea0858fbea34cffc824f80105e8d7f Mon Sep 17 00:00:00 2001 From: 53hornet Date: Sat, 2 Oct 2021 11:59:08 -0400 Subject: published hudson fan shroud, replaced makefile with scripts, added some drafts --- ...mate-display-switching-with-devd-on-freebsd.php | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 drafts/2021-09-26-forget-autorandr-automate-display-switching-with-devd-on-freebsd.php (limited to 'drafts/2021-09-26-forget-autorandr-automate-display-switching-with-devd-on-freebsd.php') diff --git a/drafts/2021-09-26-forget-autorandr-automate-display-switching-with-devd-on-freebsd.php b/drafts/2021-09-26-forget-autorandr-automate-display-switching-with-devd-on-freebsd.php new file mode 100644 index 0000000..8ae50f7 --- /dev/null +++ b/drafts/2021-09-26-forget-autorandr-automate-display-switching-with-devd-on-freebsd.php @@ -0,0 +1,41 @@ + + +

+ autorandr and dockd have been around for a while. Both let you automatically switch to or from external displays when your laptop is plugged into a hub or hooked up to a docking station. But those are largely Linux- and Thinkpad-centric solutions. Let's do it the FreeBSD way. +

+ +

+ Here are my requirements. I have an E-series Dell laptop with a docking station. My docking station is hooked up to one large Dell monitor. When the laptop is attached to the docking station, I want... +

+ +
    +
  1. The laptop to use the larger, external monitor exclusively (no mirroring)
  2. +
  3. The default sound device to switch to the external monitor's speakers
  4. +
  5. Disable automatic locking via xautolock(1)
  6. +
  7. Disable suspend on lid close
  8. +
+ +

When the laptop is removed from the docking station, I want...

+ +
    +
  1. The laptop to switch to its internal display
  2. +
  3. The default sound device to switch back to the internal laptop speakers
  4. +
  5. Automatic locking to re-enable
  6. +
  7. Suspend on lid close to re-enable
  8. +
+ +

To do this we'll need the following:

+ +
    +
  1. devd(8) for launching userland applications when kernel events occur
  2. +
  3. xrandr(1) for switching displays
  4. +
  5. xautolock(1) for automatic locking
  6. +
  7. sysctl(8) for changing hardware knobs
  8. +
  9. Some core utilities and a tiny shell script to bring it all together
  10. +
-- cgit v1.2.3