diff options
author | Ivan | 2015-09-14 17:56:07 -0700 |
---|---|---|
committer | Ivan | 2015-09-14 17:56:07 -0700 |
commit | 96a960403ed1f737150231c687719e0919e2203f (patch) | |
tree | 5796fede7d3f64bc3b43822e138f96e9f4a2e2fe /displaylink-sleep.sh | |
parent | f006373b11df3b56beaa92e44875345233e40301 (diff) | |
download | aur-96a960403ed1f737150231c687719e0919e2203f.tar.gz |
Displaylink 1.0.138 installer for Ubuntu had some new suspend/resume functionality that I missed. This has now been added.
Diffstat (limited to 'displaylink-sleep.sh')
-rw-r--r-- | displaylink-sleep.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/displaylink-sleep.sh b/displaylink-sleep.sh new file mode 100644 index 000000000000..bc26362e2f10 --- /dev/null +++ b/displaylink-sleep.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright (c) 2015 DisplayLink (UK) Ltd. + +suspend_dlm() +{ + #flush any bytes in pipe + while read -n 1 -t 1 SUSPEND_RESULT < /usr/lib/displaylink/PmMessagesPort_out; do : ; done; + + #suspend DisplayLinkManager + echo "S" > /usr/lib/displaylink/PmMessagesPort_in + + #wait until suspend of DisplayLinkManager finish + read -n 1 -t 10 SUSPEND_RESULT < /usr/lib/displaylink/PmMessagesPort_out +} + +resume_dlm() +{ + #resume DisplayLinkManager + echo "R" > /usr/lib/displaylink/PmMessagesPort_in +} + +case "\$1/\$2" in + pre/*) + suspend_dlm + ;; + post/*) + resume_dlm + ;; +esac + |