Skip to content

Commit

Permalink
Merge pull request #166 from knuton/div-47-include-scannable-mac-outp…
Browse files Browse the repository at this point in the history
…ut-on-status-console

Add MAC addresses on PlayOS status screen
  • Loading branch information
knuton authored May 27, 2024
2 parents 45b9d93 + 75b9f1e commit 6e10b30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion application/playos-status.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ let
while :; do
screen=$(xrandr --current | grep '*' | awk '{print $1}')
networkCount=$(connmanctl services | grep wifi | wc -l)
ethernetMacs=$(cat /sys/class/net/e*/address 2>/dev/null | grep -v '^$' | awk '{print "Ethernet " $0}' | tr '\n' ' ')
wlanMacs=$(cat /sys/class/net/wl*/address 2>/dev/null | grep -v '^$' | awk '{print "WLAN " $0}' | tr '\n' ' ')
rfid=$(opensc-tool --list-readers | pr -T -o 2)
dataDiskFree=$(df -h /mnt/data | pr -T -o 2)
controller=$(systemctl is-active playos-controller)
Expand All @@ -23,8 +25,13 @@ let
"Persistent storage:" \
"$dataDiskFree" \
"Controller: $controller" \
"Updated at: $time" \
"Network interfaces:" \
" $ethernetMacs $wlanMacs" \
> ${ttyPath}
qrencode -m 2 -t utf8 <<< "$ethernetMacs $wlanMacs" \
| pr -T -o 2 \
> ${ttyPath}
printf "\n%s" "Updated at: $time" > ${ttyPath}
sleep 5
done
'';
Expand All @@ -43,6 +50,7 @@ in
xorg.xrandr
opensc
coreutils
qrencode
];
description = "PlayOS status";
wantedBy = [ "multi-user.target" ];
Expand Down
1 change: 1 addition & 0 deletions controller/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- kiosk: Add a key combination to perform hard refresh (Ctrl-Shift-R)
- os: Added localization options for Polish and Czech
- controller: Add licensing page in System Settings
- status screen: Display MAC addresses in text and QR code

## Changed

Expand Down

0 comments on commit 6e10b30

Please sign in to comment.