-
Notifications
You must be signed in to change notification settings - Fork 4
Is a machine being used right now?
Sometimes if you want to do work on a remote machine, you want to do it outside the office hours to not interfere with the user. This Command shows you if a user is logged in and for how long the machine is idle. It's working quite well for me to decide if someone is logged in or not:
clear && idle_time=$(/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/awk '/HIDIdleTime/ {print int($NF/1000000000); exit}'); if [[ "$(osascript -l JavaScript -e 'ObjC.import("CoreGraphics"); $.CGDisplayIsActive($.CGMainDisplayID())')" == "1" ]]; then echo "‼️unlocked and idle for $(echo $idle_time | awk '{printf "%dm %ds", $1/60, $1%60}')"; else echo "✅ locked and idle since $(echo $idle_time | awk '{printf "%dm %ds", $1/60, $1%60}')"; fi
It looks like this:
or:
✅ locked and idle since 18m 52s
- Using Core Tunnel app
- Migrate Macs over internet
- Extended Security by limiting ScreenSharing connections to localhost only
- Extended Security by disabling password authentication
- Is a machine being used right now?
- macOS Softwareupdates
- Admin Apps Configuration
- Admin Setup
- Admin Connect
- Web Admin
- Watchman Monitoring Integration
- Notifications and Alerts
- Add Nav Button to this Github Repo
- BlueConnect Admin