public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* how to detect whether a laptop is docked
@ 2015-08-26 20:59 Nellis, Kenneth
  2015-08-26 21:11 ` Yaakov Selkowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Nellis, Kenneth @ 2015-08-26 20:59 UTC (permalink / raw)
  To: cygwin

Dear Cygwin Users:

I am looking for a method by which I can determine within a shell script 
whether my laptop is docked or not. Google provided some answers for Linux 
and Windows users, but the several ways I tried did not work out.

One Windows solution * provided a VB script that accessed a registry variable ‡,
but my registry value remains the same whether or not I'm docked. 

The Linux solutions required either a file I don't have (/var/run/stab) or a tool
that I don't have and couldn't find in a Cygwin search (acpid or lsusb).

* https://www.autoitscript.com/forum/topic/147332-how-do-you-detect-a-docking-station/
‡ /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/IDConfigDB/CurrentDockInfo/DockingState

--Ken Nellis

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: how to detect whether a laptop is docked
  2015-08-26 20:59 how to detect whether a laptop is docked Nellis, Kenneth
@ 2015-08-26 21:11 ` Yaakov Selkowitz
  2015-08-26 22:16   ` Michael Enright
  2015-08-27 15:45   ` Nellis, Kenneth
  0 siblings, 2 replies; 4+ messages in thread
From: Yaakov Selkowitz @ 2015-08-26 21:11 UTC (permalink / raw)
  To: cygwin

On Wed, 2015-08-26 at 19:27 +0000, Nellis, Kenneth wrote:
> I am looking for a method by which I can determine within a shell script 
> whether my laptop is docked or not. Google provided some answers for Linux 
> and Windows users, but the several ways I tried did not work out.
> 
> One Windows solution * provided a VB script that accessed a registry variable ‡,
> but my registry value remains the same whether or not I'm docked. 
> 
> The Linux solutions required either a file I don't have (/var/run/stab) or a tool
> that I don't have and couldn't find in a Cygwin search (acpid or lsusb).

lsusb is part the usbutils package, which is currently in Ports.

--
Yaakov




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: how to detect whether a laptop is docked
  2015-08-26 21:11 ` Yaakov Selkowitz
@ 2015-08-26 22:16   ` Michael Enright
  2015-08-27 15:45   ` Nellis, Kenneth
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Enright @ 2015-08-26 22:16 UTC (permalink / raw)
  To: cygwin

On Wed, Aug 26, 2015 at 12:50 PM, Yaakov Selkowitz wrote:
> On Wed, 2015-08-26 at 19:27 +0000, Nellis, Kenneth wrote:
>> I am looking for a method by which I can determine within a shell script
>> whether my laptop is docked or not. Google provided some answers for Linux
>> and Windows users, but the several ways I tried did not work out.
>>
>> One Windows solution * provided a VB script that accessed a registry variable ‡,
>> but my registry value remains the same whether or not I'm docked.
>>
>> The Linux solutions required either a file I don't have (/var/run/stab) or a tool
>> that I don't have and couldn't find in a Cygwin search (acpid or lsusb).
>

If you cat the path to the registry key it doesn't show anything but
if you hexdump it there is a '1' (in my case, 2 out of 2 systems)
stored as a DWORD I suppose. I think that value is wrong for at least
one of those (a docked laptop or a VM in a PC). I got the impression
the feature is not 100% solid.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: how to detect whether a laptop is docked
  2015-08-26 21:11 ` Yaakov Selkowitz
  2015-08-26 22:16   ` Michael Enright
@ 2015-08-27 15:45   ` Nellis, Kenneth
  1 sibling, 0 replies; 4+ messages in thread
From: Nellis, Kenneth @ 2015-08-27 15:45 UTC (permalink / raw)
  To: cygwin

From: Yaakov Selkowitz
> On Wed, 2015-08-26 at 19:27 +0000, Nellis, Kenneth wrote:
> > I am looking for a method by which I can determine within a shell script
> > whether my laptop is docked or not. Google provided some answers for Linux
> > and Windows users, but the several ways I tried did not work out.
> >
> > One Windows solution * provided a VB script that accessed a registry variable ‡,
> > but my registry value remains the same whether or not I'm docked.
> >
> > The Linux solutions required either a file I don't have (/var/run/stab) or a tool
> > that I don't have and couldn't find in a Cygwin search (acpid or lsusb).
> 
> lsusb is part the usbutils package, which is currently in Ports.

Great! I now have a workable script: lsusb | grep -qi keyboard

I found it frustrating figuring out cygports until I found
http://www.cygwinports.org/, which clearly told me what to do. 
I wasn't able to find any reference to cygwinports on the cygwin site.

Thank you, Yaakov. ☺

--Ken Nellis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-27 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-26 20:59 how to detect whether a laptop is docked Nellis, Kenneth
2015-08-26 21:11 ` Yaakov Selkowitz
2015-08-26 22:16   ` Michael Enright
2015-08-27 15:45   ` Nellis, Kenneth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).