Nilesoft Shell Pro GitHub

SYS (SYSTEM)

sys.name

Returns Windows name.

Syntax

sys.name
sys.type

Returns system architecture.

Syntax

sys.type == 64
sys.type == 32
sys.is64

Returns if system architecture is x64.

Syntax

sys.is64
sys.dark

Check if dark mode is enabled.

Syntax

sys.dark
sys.var

Retrieves the value of an environment variable.

Syntax

sys.var('WINDIR')
sys.version (sys.ver)

Windows version.

Syntax

sys.version
sys.version.build
sys.version.major
sys.version.minor
sys.version.name
sys.version.type
sys.datetime (system.datetime)

Date and time format

Syntax

sys.datetime                                   // the date and time in a short format (Format: YYYY.MM.DD-HH.MM.SS).
sys.datetime.short                             // the date and time in a short format (Format: YYYY.MM.DD-HH.MM.SS).
sys.datetime.dayofweek (sys.datetime.dw)       // the day of the week as a number (Sunday as 1)

sys.datetime.date                              // the full date in a long format (Format: YYYY.MM.DD).
sys.datetime.yy                                // the year part of the current date as a two-digit number.
sys.datetime.year (sys.datetime.y)             // the year part of the current date as a four-digit number.
sys.datetime.month (sys.datetime.m)            // the month part of the current date.
sys.datetime.day (sys.datetime.d)              // the day part of the current date.

sys.datetime.time                              // the full time in hours, minutes, and seconds (Format: HH.MM.SS).
sys.datetime.pm                                // "AM" or "PM" based on the current time.
sys.datetime.hour (sys.datetime.h)             // the hour part of the current time (24-hour format).
sys.datetime.minute (sys.datetime.min)         // the minutes part of the current time.
sys.datetime.second (sys.datetime.s)           // the seconds part of the current time.
sys.datetime.milliseconds (sys.datetime.ms)    // the milliseconds part of the current time as a three-digit number.

sys.datetime("D")                              // the full date in a short format (Format: DD/MM/YYYY).
sys.datetime("Y")                              // the year part of the current date as a two-digit number.
sys.datetime("y")                              // the year part of the current date as a four-digit number.
sys.datetime("m")                              // the month part of the current date as a two-digit number.
sys.datetime("d")                              // the day part of the current date as a two-digit number.
sys.datetime("P") (sys.datetime("p"))          // "AM" or "PM" based on the current time.
sys.datetime("h")                              // the hour part of the current time as a two-digit number (12-hour format).
sys.datetime("H")                              // the hour part of the current time as a two-digit number (24-hour format).
sys.datetime("M")                              // the minute part of the current time as a two-digit number.
sys.datetime("S")                              // the second part of the current time as a two-digit number.
sys.datetime("s")                              // the milliseconds part of the current time as a three-digit number.

datetime("y/m/d")                              // the date in a short format (Format: YYYY/MM/DD).
datetime("h:M P")                              // the time in a short format (Format: HH:MM AM/PM).
datetime("H.M.S.s")                            // the time in a long format (Format: HH.MM.SS.MS).
Windows paths
sys                                            // %WINDIR%

sys.root                                       // %SYSTEMDRIVE%

sys.programdata                                // %PROGRAMDATA%
sys.prog                                       // %PROGRAMFILES%
sys.prog32                                     // %PROGRAMFILES(x86)%
sys.templates

sys.users
sys.appdata                                    // %APPDATA%
sys.temp                                       // %TEMP%

sys.directory (sys.dir)                        // %WINDIR%
sys.path                                       // %WINDIR%
sys.bin                                        // %WINDIR%\system32
sys.bin32
sys.bin64
sys.wow
sys.is_primary_monitor

Returns true if the current monitor is the primary

Syntax

sys.is_primary_monitor
sys.screen.primary
sys.langid

Returns the language ID

Syntax

sys.langid
sys.extended

Returns whether the Shift key is currently pressed

Syntax

sys.extended
sys.is11

Returns whether the Windows version is 11

Syntax

sys.is11
sys.is10

Returns whether the Windows version is 10

Syntax

sys.is10
sys.is81

Returns whether the Windows version is 8.1

Syntax

sys.is81
sys.is8

Returns whether the Windows version is 8

Syntax

sys.is8
sys.is7

Returns whether the Windows version is 7

Syntax

sys.is7
sys.lang

The Windows display language, the one Windows' own menu items use.

Syntax

sys.lang                                       // the language tag, e.g. en-US
sys.lang.full                                  // its name as Windows shows it, e.g. English (United States)
sys.lang.name                                  // the language part, e.g. en
sys.lang.country                               // the country part, e.g. US
sys.lang.id                                    // the language ID, e.g. 1033
sys.power

Power and battery state.

Syntax

sys.power                                      // "ac" when on mains power, "battery" when on battery
sys.power.is_ac                                // true when on mains power
sys.power.battery                              // the battery charge in percent, or -1 when unknown or there is no battery
sys.power.is_charging                          // true while the battery is charging (false when Windows does not know)

Example

item(title='Battery: ' + sys.power.battery + '%' where=sys.power.battery >= 0)
sys.memory

Physical memory (RAM).

Syntax

sys.memory                                     // the percent of memory in use (same as sys.memory.used)
sys.memory.used                                // the percent of memory in use
sys.memory.total                               // all memory in MB
sys.memory.free                                // free memory in MB
sys.screen

The screens. Width and height are those of the main screen, in pixels.

Syntax

sys.screen                                     // width x height of the main screen, e.g. 1920x1080
sys.screen.width
sys.screen.height
sys.screen.count                               // the number of monitors
sys.screen.primary                             // true if the menu is on the main monitor (same as sys.is_primary_monitor)
sys.cpu.count

Returns the number of logical processors. sys.cpu is the same.

Syntax

sys.cpu.count