diff options
author | francoism90 | 2022-01-08 13:59:36 +0100 |
---|---|---|
committer | francoism90 | 2022-01-08 13:59:36 +0100 |
commit | a8c096c76310b0cf7a85c397f79f2d22bfd68359 (patch) | |
tree | 8b12f359b20fc25914e899f6c037c20c4233d722 /displaylink-sleep.sh | |
download | aur-displaylink-beta.tar.gz |
Initial commit
Diffstat (limited to 'displaylink-sleep.sh')
-rw-r--r-- | displaylink-sleep.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/displaylink-sleep.sh b/displaylink-sleep.sh new file mode 100644 index 000000000000..b47d5fd2d45d --- /dev/null +++ b/displaylink-sleep.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright (c) 2015 - 2016 DisplayLink (UK) Ltd. + +suspend_dlm() +{ + #flush any bytes in pipe + while read -n 1 -t 1 SUSPEND_RESULT < /tmp/PmMessagesPort_out; do : ; done; + + #suspend DisplayLinkManager + echo "S" > /tmp/PmMessagesPort_in + + if [ -f /tmp/PmMessagesPort_out ]; then + #wait until suspend of DisplayLinkManager finish + read -n 1 -t 10 SUSPEND_RESULT < /tmp/PmMessagesPort_out + fi +} + +resume_dlm() +{ + #resume DisplayLinkManager + echo "R" > /tmp/PmMessagesPort_in +} + +case "\$1/\$2" in + pre/*) + suspend_dlm + ;; + post/*) + resume_dlm + ;; +esac + |