Aptivi - Deprecated Manuals
ProjectsWebsiteBlog
Nitrocid KS v0.1.1 - Service Pack 1
Nitrocid KS v0.1.1 - Service Pack 1
  • ๐Ÿ‘‹Welcome!
  • ๐Ÿ—ž๏ธVersion Release Notes
  • Installation and Maintenance
    • ๐Ÿ“€Installing the Kernel
      • ๐Ÿ’ปWindows
      • ๐ŸŽmacOS
      • ๐ŸงLinux
      • ๐Ÿ“ฑAndroid
    • โซUpgrading the Kernel
      • ๐Ÿ’ปWindows
      • ๐ŸŽmacOS
      • ๐ŸงLinux
      • ๐Ÿ“ฑAndroid
    • ๐Ÿ“ฆDependency Information
  • Fundamentals
    • ๐ŸŒฝWhat is the Kernel?
    • ๐Ÿ‘พWhat is Nitrocid KS?
    • โญSimulated Kernel Features
      • ๐ŸŒŸExtra Features
        • ๐ŸŒMore Networking
          • ๐Ÿ—ƒ๏ธFTP Client
          • ๐Ÿ”’SFTP Client
          • ๐Ÿ“ฐRSS Client
          • ๐ŸŒHTTP Client
          • ๐Ÿ“งMail Client
        • ๐ŸŽฎGames and Amusements
          • ๐Ÿ”คHangman
          • ๐Ÿ‡BackRace
          • โ˜„๏ธMeteor
          • ๐Ÿ“Pong
          • ๐ŸŽฐRussian Roulette
          • โ˜„๏ธShipDuet
          • ๐ŸSnaker
          • ๐Ÿ”ขSolver
          • โŒจ๏ธSpeedPress
          • ๐Ÿ” Wordle
        • ๐Ÿ–Š๏ธMore Editors
          • ๐Ÿ–Š๏ธJSON Editor
          • ๐Ÿ—„๏ธSQL Editor
        • ๐ŸงฐCommon Programs
          • ๐Ÿ“ฆArchive
          • โ˜•Caffeine
          • ๐Ÿ—“๏ธCalendar
          • ๐Ÿ”ขCalculator
          • ๐Ÿ‘ฅContacts
          • ๐Ÿ“•Dictionary
          • ๐Ÿ‘ฉโ€๐Ÿ’ปGit Shell
          • ๐ŸŽงMusic Player
          • ๐Ÿ—’๏ธNotes
          • ๐Ÿ”ŒSSH Connection
          • ๐Ÿ’นStocks
          • โฐStopwatch and Timer
          • โ˜‘๏ธTo-do List
          • โš–๏ธUnit Converter
          • โ˜€๏ธWeather
        • ๐Ÿ–ผ๏ธDocking
        • ๐ŸŒLanguage Studio
        • ๐ŸŽจTheme Studio
      • ๐Ÿ‘คAccounts
        • ๐Ÿ‘ฅGroups
        • ๐Ÿ”“Permissions
      • โœ๏ธEditors
        • ๐Ÿ“Text Editor
        • ๐Ÿ’พHex Editor
      • ๐ŸšShells
        • ๐Ÿ“„Commands List
        • ๐Ÿ“„Addon Commands List
      • ๐Ÿ“‚Files and Folders
        • ๐Ÿ”Hashing and Encryption
      • ๐Ÿ The Nitrocid Homepage
      • ๐ŸŒŽNetworking
      • ๐Ÿ‡บ๐Ÿ‡ธLanguages
      • ๐ŸŒŒScreensavers
      • ๐Ÿ“…Lockscreen Widgets
  • Advanced and Power Users
    • โš’๏ธBuilding the Kernel
      • ๐ŸชŸBuilding on Windows
      • ๐ŸŽBuilding on macOS
      • ๐ŸงBuilding on Linux
      • ๐Ÿ“ฑBuilding on Android
    • ๐ŸงฐKernel Modifications
      • ๐ŸงชBuilding your Mod
      • ๐Ÿ“ˆAnalyzing your Mod
        • ๐Ÿ“‰Text - NKS0001
        • ๐Ÿ“‰ConsoleBase - NKS0002
        • ๐Ÿ“‰ConsoleBase - NKS0003
        • ๐Ÿ“‰ConsoleBase - NKS0004
        • ๐Ÿ“‰ConsoleBase - NKS0005
        • ๐Ÿ“‰ConsoleBase - NKS0006
        • ๐Ÿ“‰ConsoleBase - NKS0007
        • ๐Ÿ“‰ConsoleBase - NKS0008
        • ๐Ÿ“‰ConsoleBase - NKS0009
        • ๐Ÿ“‰Files - NKS0010
        • ๐Ÿ“‰Files - NKS0011
        • ๐Ÿ“‰Files - NKS0012
        • ๐Ÿ“‰Files - NKS0013
        • ๐Ÿ“‰Files - NKS0014
        • ๐Ÿ“‰Files - NKS0015
        • ๐Ÿ“‰Files - NKS0016
        • ๐Ÿ“‰Files - NKS0017
        • ๐Ÿ“‰Files - NKS0018
        • ๐Ÿ“‰Files - NKS0019
        • ๐Ÿ“‰Files - NKS0020
        • ๐Ÿ“‰Files - NKS0021
        • ๐Ÿ“‰Files - NKS0022
        • ๐Ÿ“‰Files - NKS0023
        • ๐Ÿ“‰Kernel - NKS0024
        • ๐Ÿ“‰Kernel - NKS0025
        • ๐Ÿ“‰Kernel - NKS0026
        • ๐Ÿ“‰Kernel - NKS0027
        • ๐Ÿ“‰Kernel - NKS0031
        • ๐Ÿ“‰Kernel - NKS0032
        • ๐Ÿ“‰Kernel - NKS0033
        • ๐Ÿ“‰Kernel - NKS0037
        • ๐Ÿ“‰Kernel - NKS0038
        • ๐Ÿ“‰Kernel - NKS0039
        • ๐Ÿ“‰Kernel - NKS0040
        • ๐Ÿ“‰Kernel - NKS0041
        • ๐Ÿ“‰Kernel - NKS0042
        • ๐Ÿ“‰Kernel - NKS0043
        • ๐Ÿ“‰Kernel - NKS0052
        • ๐Ÿ“‰Kernel - NKS0053
        • ๐Ÿ“‰Languages - NKS0044
        • ๐Ÿ“‰Languages - NKS0045
        • ๐Ÿ“‰Languages - NKS0046
        • ๐Ÿ“‰Network - NKS0051
        • ๐Ÿ“‰Text - NKS0047
        • ๐Ÿ“‰Text - NKS0048
        • ๐Ÿ“‰Text - NKS0049
        • ๐Ÿ“‰Text - NKS0050
        • ๐Ÿ“‰Text - NKS0054
        • ๐Ÿ“‰Text - NKS0055
      • ๐Ÿ”งManaging your Mod
        • ๐Ÿ“žInter-Mod Communication
        • ๐Ÿ“žInter-Addon Communication
    • ๐Ÿฆ Diagnostics
      • ๐Ÿ”ฌDebugging
        • ๐ŸงฌLocal Debugging
        • ๐Ÿ›ฐ๏ธRemote Debugging
      • ๐ŸงชTesting
      • ๐Ÿ’‰Other Diagnostics
    • ๐Ÿ“€Bootloader
      • ๐Ÿ‘†Boot Choices
      • โ–ถ๏ธKernel Environments
      • ๐Ÿ’„Custom Boot Styles
    • โš’๏ธInner Workings
      • ๐Ÿ”งKernel Settings
        • โ›๏ธMechanics of Settings App
        • ๐Ÿ”ฉSettings Format
        • โš™๏ธCustom Settings
      • ๐ŸšShell Structure
        • โ”Help System
        • ๐Ÿ—œ๏ธCommand Parsing
        • ๐Ÿ”‹Command Information
        • โฒ๏ธCommand Switch Management
        • ๐ŸŽš๏ธCommand Switch Information
        • โณShell History
        • ๐Ÿ“œShell Scripting
        • ๐Ÿ“ŸShell Presets
        • ๐Ÿ’ Extra Shell Features
      • ๐ŸŒMultilingual Kernel
        • ๐ŸŒCustom Languages
      • โ™ฆ๏ธInner Essentials
        • ๐Ÿ”ŒKernel Drivers
          • ๐Ÿ”ŒConsole Drivers
          • ๐Ÿ”ŒDebug Logger Drivers
          • ๐Ÿ”ŒEncoding Drivers
          • ๐Ÿ”ŒEncryption Drivers
          • ๐Ÿ”ŒFilesystem Drivers
          • ๐Ÿ”ŒHardware Prober Drivers
          • ๐Ÿ”ŒInput Drivers
          • ๐Ÿ”ŒNetwork Drivers
          • ๐Ÿ”ŒRNG Drivers
          • ๐Ÿ”ŒRegular Expression Drivers
          • ๐Ÿ”ŒSorting Drivers
        • ๐ŸชงKernel Placeholders
        • ๐Ÿ”The Permissions
        • ๐Ÿ‘ฅThe Users
        • ๐Ÿ“žKernel Threads
        • ๐ŸŽ›๏ธKernel Arguments
        • ๐Ÿ“’Kernel Journaling
        • ๐Ÿ“กRemote Procedure
        • ๐Ÿ—ƒ๏ธNitrocid Filesystem
        • ๐ŸŒƒScreensaver Internals
        • ๐Ÿ’ฆSplash Internals
        • ๐Ÿ–ฅ๏ธKernel Platform
        • ๐ŸŽจTheme Internals
        • โ›ฑ๏ธColor Internals
        • ๐Ÿ”Privacy Consents
        • ๐Ÿ””System Notifications
        • โœ‰๏ธMAL and MOTD
        • โŒ›Progress Handlers
        • โœ’๏ธAssembly Signing
        • ๐Ÿ”Assembly Reflection
        • ๐ŸŽฐRandom Number Generation
        • ๐ŸŒNetwork Tools
        • ๐Ÿ•™Date and Time
        • ๐Ÿ“–Mod Manual Pages
      • ๐ŸŒ€Miscellaneous APIs
  • ๐ŸงฑProject Dependencies
  • Report an issue
  • Source code
  • API Reference
Powered by GitBook
On this page
  • Setting widgets
  • Configuring widgets
  • Building widgets
Edit on GitHub
  1. Fundamentals
  2. Simulated Kernel Features

Lockscreen Widgets

What are the lockscreen widgets?

Last updated 3 months ago

Lockscreen widgets is a modern lockscreen feature that gives you quick insights about different information, including the world clock and the news, in a full-screen format. These widgets can be found in the modern logon screen introduced in the 0.1.0 version of Nitrocid. In the lock screen, you can easily switch between the main screen and the widgets (up to 2 widgets).

Lockscreen widgets are not supported in the classic lock screen style. For custom lock screens, you'll need to handle the widget display yourself.

Setting widgets

The WidgetTools class provides a plethora of functions that allow you to manipulate with the widgets, such as registering them and unregistering them. You can also get a widget instance and its name.

In addition to that, the kernel configuration contains the following basic settings that you can use to set your widgets in your choice:

  • EnableWidgets: Enables or disables widgets in all the supported lock screens

  • FirstWidget: Specifies the first widget to use

  • SecondWidget: Specifies the second widget to use

Configuring widgets

You can configure the widgets using the settings application by executing the settings command, passing it the -widgets switch. Select a widget using the up/down arrow keys, then use the tab key to change the focus to the widget settings entry list. You can use the enter key afterwards to customize the widgets.

Building widgets

In order to be able to build your widget, you must make a kernel mod that will register your widget when it starts (AddWidget()) and will unregister it when your mod stops (RemoveWidget()). Follow the instructions on how to build your mod and use it as a starting point to be able to build such a mod.

Afterwards, make a new class file somewhere on your mod source that will hold all your widget code, such as MyWidget, and make it implement both the BaseWidget class and the IWidget interface so that Nitrocid recognizes it as a widget. A minimal example for this class can be consulted below:

MyWidget.cs
using Nitrocid.Users.Login.Widgets;

namespace MyMod
{
    internal class MyWidget : BaseWidget, IWidget
    {
        public override string Cleanup(int left, int top, int width, int height)
        {
            // Your cleanup code here
        }
        
        public override string Initialize(int left, int top, int width, int height)
        {
            // Your initialization code here
        }
        
        public override string Render(int left, int top, int width, int height)
        {
            // Your widget rendering code here
        }
    }
}

The strings that the three functions return will be printed raw to the console by Nitrocid using the available Terminaux functions, so make sure that you use the Render variants of the writers. In case of things, such as steps, image numbers, or changing colors, you can make use of the class-wide global settings and initialize their initial values by putting the assignments to the Initialize function. For example, is the implementation of the analog clock widget. You can also omit the initialization and the clean-up code by making them return an empty string.

โญ
๐Ÿ“…
here
here