summaryrefslogtreecommitdiff
path: root/drafts/dell-dock.html
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-01-15 14:48:59 -0500
committerAdam T. Carpenter <atc@53hor.net>2021-01-15 14:48:59 -0500
commit0c3a3e015b66eeac415580cb9f0391184e54853f (patch)
treec5301a7f310ada2298160f8f3b47c61692d4373c /drafts/dell-dock.html
parent57b70c5a30fba783dcbb290b08821d7d3c1e96c1 (diff)
download53hor-0c3a3e015b66eeac415580cb9f0391184e54853f.tar.xz
53hor-0c3a3e015b66eeac415580cb9f0391184e54853f.zip
added/finished Zroot mirror vdevs
Diffstat (limited to 'drafts/dell-dock.html')
-rw-r--r--drafts/dell-dock.html82
1 files changed, 64 insertions, 18 deletions
diff --git a/drafts/dell-dock.html b/drafts/dell-dock.html
index 4be6691..4a9dd9a 100644
--- a/drafts/dell-dock.html
+++ b/drafts/dell-dock.html
@@ -1,18 +1,17 @@
-<h1>Make Your Docking Station Work for You on FreeBSD</h1>
+<h1>Make Your Docking Station Work for You (on FreeBSD)</h1>
<p class="description">
- Here's the problem. I have a Dell Latitude E-series laptop running FreeBSD
- 12.1-RELEASE. I also have a Dell E-Port II docking station on my desk. I
- wanted to be able to take my shut, sleeping laptop and plop it down on the
- docking station, hit the dock power button, and have the laptop wake up and
- switch over to all of the docking station peripherals. All of the USB devices
- did this without any additional work. However, the ethernet hookup, external
- monitor, and speakers all required some additional tinkering. This assumes
- that you're already familiar with wired and wireless network interfaces on
- FreeBSD!
+ I have a Dell Latitude E-series laptop running FreeBSD 12.2-RELEASE. I also
+ have a Dell E-Port II docking station on my desk. I wanted to be able to take
+ my shut, sleeping laptop and plop it down on the docking station, hit the dock
+ power button, and have the laptop wake up and switch over to all of the
+ docking station peripherals. So I did it! And now I'm going to write about it
+ so I don't forget how. You need to know a little bit about FreeBSD
+ <code>sysctl</code> knobs, display outputs in X, sound devices, and
+ <code>ifconfig</code> networking.
</p>
-<h2>Link Aggregation (Failover)</h2>
+<h2>Switching from Ethernet to WiFi and Back Again, Seamlessly</h2>
<p>
FreeBSD doesn't magically swap from wireless to wired connections by default,
@@ -20,21 +19,21 @@
<a href="https://www.freebsd.org/doc/handbook/network-aggregation.html"
>FreeBSD handbook page on network aggregation</a
>
- as it's where I found out how to do what I'm about to show you. Basically,
+ as it's where I found out about link aggregation and failover. Basically,
aggregation lets you bind two of your network interfaces together into a
single virtual interface. Failover lets your traffic continue moving as long
- as one of the aggregated interfaces has is connected. The steps I had to
- follow are as follows:
+ as one of the aggregated interfaces has is connected.
+ Here's what I had to do:
</p>
-<ul>
+<ol>
<li>
- Bind the wireless network interface to the MAC address of the wired
- interface
+ Bind the wireless network interface (wlan0) to the MAC address of the wired
+ interface (em0)
</li>
<li>Create a lagg interface using the two network interfaces</li>
<li>Bind the lagg interface to an IP address, preferably with DHCP</li>
-</ul>
+</ol>
<p>All of this is configured in my <code>rc.conf</code>:</p>
@@ -54,3 +53,50 @@ ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP" # <- con
will take over. This transition happens instantly, and without interrupting
traffic; active transactions aren't cut short for example.
</p>
+
+<h2>Sleeping on Lid Close Except When Docked</h2>
+
+<p>
+ This is an easy one. You can use <code>sysctl</code> to configure what happens
+ when a laptop lid is closed. I wanted the lid closing while undocked to
+ suspend (put the laptop to sleep). When it's docked however, I don't use the
+ internal display and wanted to be able to shut the lid and leave it shut. If you read <code>ACPI(4)</code> in the manual, you'll find this little passage:
+</p>
+
+<pre>
+<blockquote>
+hw.acpi.lid_switch_state
+ Suspend state (S1-S5) to enter when the lid switch (i.e., a
+ notebook screen) is closed. Default is "NONE" (do nothing).
+</blockquote>
+<pre>
+
+<p>I changed this value a long time ago so closing the lid suspends the laptop. You can check with <code>sysctl</code>:</p>
+
+<pre>
+<code>
+$ sysctl hw.acpi.lid_switch_state
+hw.acpi.lid_switch_state: S3
+</code>
+</pre>
+
+<p>Now, if I wanted to disable this functionality, I would just change this parameter as root:</p>
+
+<pre>
+<code>
+$ doas sysctl hw.acpi.lid_switch_state=NONE
+hw.acpi.lid_switch_state: NONE -> NONE
+</code>
+</pre>
+
+This change takes effect immediately. I can open and close the lid and nothing happens but turning off the screen. Awesome.
+
+<h2>Swapping Primary Display Outputs (Also Nvidia Screen-Tearing)</h2>
+
+<h2>Switching Default Sound Device</h2>
+
+<h2>Putting It All Together (Scripts Are Glue)</h2>
+
+<h2>What I Didn't Have to Do</h2>
+
+usb devices, battery/charging