Skip to content

Instantly share code, notes, and snippets.

@kdrwygvh
Last active January 7, 2020 15:46
Show Gist options
  • Save kdrwygvh/0de8ef26bc45990a1b8c8d78a3ce23cf to your computer and use it in GitHub Desktop.
Save kdrwygvh/0de8ef26bc45990a1b8c8d78a3ce23cf to your computer and use it in GitHub Desktop.
User Idle Time
#!/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