Code Monkey home page Code Monkey logo

idlelogout's Introduction

¡PROJECT MOVED!

Find the latest commmits at https://git.psu.edu/sysman/IdleLogout

IdleLogout.app

Description

Application to log out users after a specified period of time. The user will see a prompt with a countdown asking them if they wish to log out or continue working ("More Time"). Users can disable the Idle Logout process using the "Disable Idle Logout.applescript".

The Idle Logout App will force close any applications the user has open. This will not save any data!

Screen Shot of Count Down Window: window

Download app: Idle Logout.app

Installation

The IdleLogout-V.v.pkg installs the Idle Logout.app into /Library/CLMshared/Startup Items/ and the LaunchAgent to open it in /Library/LaunchAgents/.

The Idle Logout.app will write log files into the /Users/Shared/IdleLogout/ folder.

You can deploy the "Disable Idle Logout.applescript", as a compiled app, to give users an easy way to stop the Idle Logout process. This is helpful in locations where users need to allow processes to run for longer than you're normal logout time.

Preferences

The Idle Logout.app looks for the preference file "/Library/Preferences/edu.psu.idlelogout.plist" (included in the repo under 'IdleLogout Builds/Preference/' folder). It looks for the following key/string pairs in the plist. If they are missing, it will use the defaults:

  • IgnoreUser = Ignore the username, don't force logout.
  • IgnoreGroup = Ignore anyone in this group, don't force logout.
  • ComputerIdleAfterNumSeconds = Number of seconds before considering the computer abandoned.
  • IdleLoopDelaySeconds = Number of seconds to wait between checking the usb idle seconds.
  • WaitForUserPromptSeconds = Number of seconds to wait for user to respond to logout prompt.
  • WindowTitle = Changes the name shown in the logout window. Uses String.
  • WindowMessage = Changes the text shown on the logout window. Uses String.

Default Values if plist is not installed:

  • IgnoreUser = "macadmin"
  • IgnoreGroup = "admin"
  • ComputerIdleAfterNumSeconds = "600"
  • IdleLoopDelaySeconds = "30"
  • WaitForUserPromptSeconds = "90"
  • WindowTitle = "PSU Idle Logout"
  • WindowMessage = "This Mac is idle.\n\nClick the "More Time" button to continue using the Mac.\n\nOtherwise, an automatic logout will occur and all unsaved documents will be LOST!"

Defaults can be set quickly for all users using defaults write:

  • defaults write /Library/Preferences/edu.psu.idlelogout.plist IgnoreUser -string clcclmadmin
  • defaults write /Library/Preferences/edu.psu.idlelogout.plist IgnoreGroup -string user
  • defaults write /Library/Preferences/edu.psu.idlelogout.plist ComputerIdleAfterNumSeconds -string 10
  • defaults write /Library/Preferences/edu.psu.idlelogout.plist IdleLoopDelaySeconds -string 5
  • defaults write /Library/Preferences/edu.psu.idlelogout.plist WaitForUserPromptSeconds -string 120
  • defaults write /Library/Preferences/edu.psu.idlelogout.plist WindowTitle -string "Our Idle Logout"
  • defaults write /Library/Preferences/edu.psu.idlelogout.plist WindowMessage "You're going to be logged out\n\n\nDude!"

Background

Idle Logout.app was written in Xojo 2015 R3. It uses the ioreg command to determine how long USB devices have been idle. Once the idle limit is meet, the computer is forcibly restarted to log out any users.

The terminal command we use to check idle seconds on USB devices is:

/bin/echo $((/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/sed -e '/HIDIdleTime/ !{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q' / 1000000000))

ToDo

  • No Known Issues - Please use GitHub Issues

Completed

  • 01/2017 - Updated preferences to use CFPrefsD through macoslibs. Update code to Cocoa (Only update UI from main thread).
  • 01/2015 - The path to the logout script should be set in the preference file OR the script should be part of the app.
  • 01/2015 - Make it part of the .app, create a new method to log out
  • 01/2015 - Add preference key for window wording.

Attribution

Application Icon modified from original, used with CC license: From http://www.flickr.com/photos/23453447@N02/5107438855/sizes/o/in/photostream/ By zyrquel: http://www.flickr.com/photos/23453447@N02/

Full Screen Shot of Countdown Window: full

idlelogout's People

Contributors

rustymyers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

idlelogout's Issues

logout disable

Hi Rusty,

Is it possible the under "more time" a dropdown can be added where a student could add time and choose 30min, 1hr, 2hr, 6hour or disable until the computer is logout. It will allow my Film student time to render there work. Or maybe added as an option on the disable logout app?

Feature request

Hi Rusty, As you request I'm submitting feature request. We have similar setup, with additional features the
current user folder moves to a different location and time-stamp on logout and custom default template is use at next login. the script checks the folder and deletes users folder older than 2 days. Let me know if you want to see the scripts and package we use. Thanks for great conference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.