Sample Header Ad - 728x90

Bash & Thinkpad: how to get docked / undocked status?

2 votes
1 answer
2191 views
In some of my scripts I need to know if my Thinkpad is docked or not. So far I'm just checking if any of the peripherals attached to the docking station can be found. For example I use xrandr or get-edid to get the list of attached monitors and understand if the laptop is docked. However I see in the syslog that the kernel can see the docking event but I don't want to parse syslog looking for "docking something". Do you know some smart way to check from bash if the laptop is docked without relying on the attached peripherals? It would be cool if I could **both** catch the docking/undocking event when it happens **and** check the docking status at any time.
Asked by 19hundreds (41 rep)
Jan 6, 2019, 12:11 PM
Last activity: Oct 16, 2024, 11:43 PM