Garry's Mod Wiki

system

The system library provides functions that allow you to gather information about the system running the game, such as operating system, uptime and battery level.

Methods

number system.AppTime()
Returns the total uptime of the current application as reported by Steam. This will return a similar value to SysTime. This function does not work on Dedicated Servers and will instead return no value.
Returns the current battery power.
system.FlashWindow()
Flashes the window, turning the border to white briefly
Returns the country code of this computer, determined by the localisation settings of the OS. This function does not work on Dedicated Servers and will instead return no value.
boolean system.HasFocus()
Returns whether or not the game window has focus. This function does not work on dedicated servers and will instead return no value.
boolean system.IsLinux()
Returns whether the current OS is Linux.
boolean system.IsOSX()
Returns whether the current OS is OSX.
Returns whether the game is being run in a window or in fullscreen (you can change this by opening the menu, clicking 'Options', then clicking the 'Video' tab, and changing the Display Mode using the dropdown menu):
Returns whether the current OS is Windows.
number system.SteamTime()
Returns the synchronized Steam time. This is the number of seconds since the Unix epoch. This function does not work on Dedicated Servers and will instead return no value.
number system.UpTime()
Returns the amount of seconds since the Steam user last moved their mouse. This is a direct binding to ISteamUtils->GetSecondsSinceComputerActive, and is most likely related to Steam's automatic "Away" online status. This function does not work on Dedicated Servers and will instead return no value.