Nilesoft Shell

repository·main·Indexed 24 days ago

https://github.com/moudey/shell

A highly customizable context menu extender for Windows File Explorer. Shell allows users to add, modify, or remove menu items across files, folders, the desktop, and the taskbar using a plain text configuration system. It supports nested menus, expression syntax, and rich visuals including SVG and embedded icons. Compatible with Windows 7, 8, 10, and 11.

Tokens
7.4K
Snippets
11
Records
63
Agent score
92%

What's inside Shell

  1. Overview of Shell for Windows Context Menus

    main

    Shell is a powerful, lightweight, and portable manager for the Windows File Explorer context menu. It allows you to:

    • Customize Appearance: Fully control the look of your menus.
    • Add Custom Items: Create new sub-menus, menu items, and separators.
    • Modify/Remove Existing Items: Change or hide context menu items added by Windows or third-party software.
    • Launch Applications/Resources: Access web pages, files, folders, and applications directly from the context menu.
    • Support Various Objects: Works with files, folders, the desktop, and the taskbar.
    • Advanced Features: Supports complex nested menus, multiple columns, search/filter, and expression syntax with built-in functions and predefined variables.
    • Rich Visuals: Supports colors, glyphs, SVG, embedded icons, and image files (.ico, .png, .bmp).
  2. Install and Update Nilesoft Shell

    main

    Nilesoft Shell is a lightweight extension for Windows File Explorer designed to provide high-level control over the context menu and improve performance.

    Important Update Procedure: If you are updating to a newer version, you must first uninstall or unregister the previous version before proceeding with the update.

  3. Use the 'Go To' navigation menu

    main

    The goto import provides a structured navigation menu for quickly accessing system directories, user folders, Control Panel items, and Windows Settings. This menu is triggered via a context menu (type='*') when interacting with taskbar windows or multiple selections, using the title.go_to identifier.

    Available Navigation Categories:

    Folders (loc.folder)

    Accesses common system and user directories:

    • System Directories: Windows, System, Program Files, Program Files x86, ProgramData, Applications, and Users.
    • User Directories: Desktop, Downloads, Pictures, Documents, Startmenu, Profile, AppData, and Temp.

    System Utilities

    • Control Panel: Access the main Control Panel or all Control Panel items.
    • Run Dialog: Opens the Windows Run command.

    Settings (title.settings)

    Available on Windows 10 and newer (sys.ver.major >= 10):

    • General: System settings, About, Your Info, System Info (via systeminfo), and Windows Search.
    • Security & Updates: USB settings, Windows Update, and Windows Defender.
    • Apps: Apps & Features, Default Apps, Optional Features, and Startup Apps.
    • Personalization: Personalization, Lock Screen, Background, Colors, Themes, Start menu, and Taskbar settings.
    • Network: Network Status, Ethernet, Wi-Fi, and Network Connections.
  4. Open files in editors via development menu

    main

    The development menu provides quick access to common editors. When an item is selected, it uses the current selection path (@sel.path) as an argument.

    • Visual Studio Code: Executes code "@sel.path".
    • Windows Notepad: Executes @sys.bin\notepad.exe "@sel.path".
  5. Import localization and theme files

    main

    Shell uses an import system to load localization, themes, and modular feature sets.

    To handle localization, you can define a path variable and conditionally import the language file based on the system language (sys.lang). If a specific language file does not exist in the path, it defaults to en.nss.

    Commonly imported modules include:

    • imports/theme.nss for visual styling.
    • imports/images.nss for asset management.
    • imports/modify.nss for system modification capabilities.
    • Feature-specific modules like terminal.nss, file-manage.nss, develop.nss, goto.nss, and taskbar.nss.
    $loc_path='imports\lang\'
    import lang loc_path + "en.nss"
    import lang if(path.exists(loc_path + sys.lang + ".nss"),
                   loc_path + sys.lang + ".nss",
                   loc_path + "en.nss")
    
    import 'imports/theme.nss'
    import 'imports/images.nss'
    import 'imports/modify.nss'
  6. Fix incorrect theme colors on Windows 11 Canary/Dev builds

    main
    If you are using Windows 11 Insider builds (Canary or Dev channels) and experiencing incorrect theme colors in context menus, ensure you are using a version of Nilesoft Shell that includes the fix for Issue #700. The fix implements enhanced Windows version detection via the FlightRing registry value and provides fallback mechanisms to system colors when standard theme APIs fail.
  7. Configure global taskbar context menus

    main

    To add a menu to the taskbar that appears when no applications are active (or based on specific conditions), use a menu block with a where clause.

    Example usage for a global settings/apps menu:

    • Use where=@(this.count == 0) to target the taskbar when empty.
    • Use expanded=true to have the menu open by default.
    • Nest menu() blocks within the main block to create submenus (e.g., for 'Apps' or 'Windows' management).
    • Use sep or sep=both to insert visual separators between items.
    • Use command.<action> to invoke built-in shell commands like command.cascade_windows or command.toggle_desktop.
  8. Configure Shell settings

    main

    The settings block in shell.nss allows you to define global behavior for the Shell environment. Key configuration options include:

    • priority: Sets the execution priority.
    • exclude.where: A conditional expression to determine where settings should not apply (e.g., !process.is_explorer to exclude non-explorer processes).
    • showdelay: The delay in milliseconds before showing elements.
    • modify.remove.duplicate: Enables or disables the ability to remove duplicate system items when set to 1.
    • tip.enabled: Toggles whether tooltips/tips are displayed.
    settings
    {
    	priority=1
    	exclude.where = !process.is_explorer
    	showdelay = 200
    	// Options to allow modification of system items
    	modify.remove.duplicate=1
    	tip.enabled=true
    }
  9. Terminal menu integration via Shell configuration

    main

    The Shell configuration allows for a context-sensitive terminal menu that appears when selecting items, interacting with the taskbar, or in edit mode. The menu provides options to launch Command Prompt, Windows PowerShell, or Windows Terminal with specific arguments to ensure the terminal opens in the current directory (@sel.dir or @sel.path).

    Key behaviors:

    • Administrator Access: Users can run the selected terminal as an administrator by pressing the [SHIFT key] or using [RIGHT-CLICK] during the menu interaction.
    • Command Prompt: Launches using /K TITLE Command Prompt &ver& PUSHD "@sel.dir".
    • Windows PowerShell: Launches using -noexit -command Set-Location -Path '@sel.dir'.
    • Windows Terminal: If installed, launches via wt.exe with the argument -d "@sel.path\." to set the starting directory.
    menu(type='*' where=(sel.count or wnd.is_taskbar or wnd.is_edit) title=title.terminal sep=sep.top image=icon.run_with_powershell)
    {
    	$tip_run_admin=["\xE1A7 Press [SHIFT key] or [RIGHT-CLICK] to run " + this.title + " as administrator", tip.warning, 1.0]
    	$has_admin=key.shift() or key.rbutton()
    
    item(title=title.command_prompt tip=tip_run_admin admin=has_admin image cmd-prompt=`/K TITLE Command Prompt &ver& PUSHD "@sel.dir"`)
    	item(title=title.windows_powershell admin=has_admin tip=tip_run_admin image cmd-ps=`-noexit -command Set-Location -Path '@sel.dir'`)
    	item(where=package.exists("WindowsTerminal")
    			title=title.Windows_Terminal
    			tip=tip_run_admin
    			admin=has_admin
    			image='@package.path("WindowsTerminal")\WindowsTerminal.exe'
    			cmd="wt.exe"
    			arg=`-d "@sel.path\."`)
    }