Last active
January 7, 2020 15:46
-
-
Save kdrwygvh/0de8ef26bc45990a1b8c8d78a3ce23cf to your computer and use it in GitHub Desktop.
User Idle Time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' ) | |
echo "<result>$(w -h "$currentUser" | head -1 | awk '{print $5}')</result>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment