nixos/displaylink: fix with strict shellcheck

using the displaylink module currently fails with
`systemd.enableStrictShellChecks = true;`. there are two warnings:

- `read` without `-r` can technically mangle backslashes, as it acts as
  an escape character by default. as far as we can tell, this shouldn't
  cause problems, but it seems like a harmless and technically-correct
  fix.
- `SUSPEND_RESULT` is unused. as far as i can tell, this indeed seems to
  be the case, so this makes sense to remove.
This commit is contained in:
whispers
2026-09-17 11:11:12 -04:00
parent 131cf0f911
commit b1371e26ae

View File

@@ -46,7 +46,7 @@ in
powerManagement.powerDownCommands = ''
#flush any bytes in pipe
while read -n 1 -t 1 SUSPEND_RESULT < /tmp/PmMessagesPort_out; do : ; done;
while read -r -n 1 -t 1 < /tmp/PmMessagesPort_out; do : ; done;
#suspend DisplayLinkManager
echo "S" > /tmp/PmMessagesPort_in
@@ -54,7 +54,7 @@ in
#wait until suspend of DisplayLinkManager finish
if [ -f /tmp/PmMessagesPort_out ]; then
#wait until suspend of DisplayLinkManager finish
read -n 1 -t 10 SUSPEND_RESULT < /tmp/PmMessagesPort_out
read -r -n 1 -t 10 < /tmp/PmMessagesPort_out
fi
'';