summaryrefslogtreecommitdiff
path: root/drafts/2021-09-26-forget-autorandr-automate-display-switching-with-devd-on-freebsd.php
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2021-10-02 11:59:08 -0400
committer53hornet <atc@53hor.net>2021-10-02 11:59:08 -0400
commite0e45f0697ea0858fbea34cffc824f80105e8d7f (patch)
treed594946c0afe2a8f1efeba2b21ab22f07ddfb22b /drafts/2021-09-26-forget-autorandr-automate-display-switching-with-devd-on-freebsd.php
parent70bc00d5ff256e06c1c7d47c2af00d1863f53f6b (diff)
download53hor-e0e45f0697ea0858fbea34cffc824f80105e8d7f.tar.xz
53hor-e0e45f0697ea0858fbea34cffc824f80105e8d7f.zip
published hudson fan shroud, replaced makefile with scripts, added some
drafts
Diffstat (limited to 'drafts/2021-09-26-forget-autorandr-automate-display-switching-with-devd-on-freebsd.php')
-rw-r--r--drafts/2021-09-26-forget-autorandr-automate-display-switching-with-devd-on-freebsd.php41
1 files changed, 41 insertions, 0 deletions
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 @@
+<?php
+$title = "Forget autorandr, Automate Display Switching with devd(8) on FreeBSD";
+if (isset($early) && $early) {
+ return;
+}
+include($_SERVER['DOCUMENT_ROOT'] . '/includes/head.php');
+?>
+
+<p class="description">
+ <a href="https://github.com/phillipberndt/autorandr"><code>autorandr</code></a> and <a href="https://github.com/libthinkpad/dockd"><code>dockd</code></a> 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.
+</p>
+
+<p>
+ 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...
+</p>
+
+<ol>
+ <li>The laptop to use the larger, external monitor exclusively (no mirroring)</li>
+ <li>The default sound device to switch to the external monitor's speakers</li>
+ <li>Disable automatic locking via <code>xautolock(1)</code></li>
+ <li>Disable suspend on lid close</li>
+</ol>
+
+<p>When the laptop is removed from the docking station, I want...</p>
+
+<ol>
+ <li>The laptop to switch to its internal display</li>
+ <li>The default sound device to switch back to the internal laptop speakers</li>
+ <li>Automatic locking to re-enable</li>
+ <li>Suspend on lid close to re-enable</li>
+</ol>
+
+<p>To do this we'll need the following:</p>
+
+<ol>
+ <li><code>devd(8)</code> for launching userland applications when kernel events occur</li>
+ <li><code>xrandr(1)</code> for switching displays</li>
+ <li><code>xautolock(1)</code> for automatic locking</li>
+ <li><code>sysctl(8)</code> for changing hardware knobs</li>
+ <li>Some core utilities and a tiny shell script to bring it all together</li>
+</ol>