Giter Club home page Giter Club logo

cmd-colors-gruvbox's Introduction

Gruvbox - Command Prompt Theme

This is a Gruvbox color scheme, adapted by Andrew Reid East from the Solarized color scheme for the Windows command prompt, contributed by Neil Pankey. Solarized inspired by this post.

See the Gruvbox repository for screenshots and more details, as well as color schemes for other applications.

Making Gruvbox work for cmd.exe, Bash on Ubuntu on Windows, and PowerShell, and striking a balance with how other Gruvbox projects are implemented presents some challenges. The following table shows how the colors are mapped.

To make sure that the terminal is likely to use the best matching, the ColorTable is aligned with TERMCOL values. These values were pulled from PuTTY and other Gruvbox terminal profiles. This allows the same ANSI escape sequences to show the same in ANSI supported terminals. The PowerShell default colors are also matched for the $Host.PrivateData and PSReadLine to make them seemingly fit with the rest of the environments.

WARNING

Below are very simplified installation instructions. It will not update existing shortcuts because they have their own color mapping. With this latest version of the project, it is possible to apply to existing shortcuts, but it will not be easy to revert that change. It will not always play nice with traditional unix tools or compatability shims because Windows uses a fundamentally different color code mapping.

Installation

Update Registry for Console

While this was the original process, this only changes the registry default and doesn't update the Command Prompt and PowerShell defaults when you launch those shortcuts. It is still something you may wish to do, but the recommended process is now to use the Update-Link utility.

Import the .reg file of choice, e.g. regedit /s gruvbox-dark-medium.reg.

Both files contain the same palettes, the only difference is the default foreground and background colors. Therefore you can switch between themes on the fly with color 01 for dark and color F6 for light.

Update Command Prompt and PowerShell shortcut .lnks

Locate the link you wish to modify, such as Command Prompt. The easiest way to do this on Windows 10 is to click Start, then type in the command you want to change. When it appears in the list, right-click and select Open file location. This will open an Explorer window and show you the shortcut. Hold shift and right-click on the shortcut, then select Copy as path. Now open a Command Prompt to the location of this project. In the Command Prompt window use this command.

Update-Link "<shortcut.lnk>" [hard|medium|soft] [dark|light]

The path to the shortcut.lnk is the same as you copied to your clipboard in the previous step. To easily paste it in Windows 10, just right-click on the window. If the path has spaces, you will want to wrap it in quotes, but if you followed the recommended way to use Copy as path, it will be done for you. If no theme is given, Update-Link will default to Gruvbox Dark.

Update your PowerShell profile

Copy the Set-Gruvbox*ColorDefaults.ps1 files to your profile directory, likely ~\Documents\WindowsPowerShell\. Then add the following line of code to the end of your Microsoft.PowerShell_profile.ps1 or profile.ps1:

. (Join-Path -Path (Split-Path -Parent -Path $PROFILE) -ChildPath $(switch($HOST.UI.RawUI.BackgroundColor.ToString()){'White'{'Set-GruvboxLightColorDefaults.ps1'}'Black'{'Set-GruvboxDarkColorDefaults.ps1'}default{return}}))

Uninstall

Registry for Console

The file windows-old-defaults.reg is provided to restore the command prompt colors back to their shipping defaults. The registry settings have been checked for versions of Windows back to at least Windows 7 and the values are the same.

To restore the defaults, import the .reg the same way as you applied it previously, regedit /s windows-old-defaults.reg.

Command Prompt and PowerShell shortcut .lnks

Unfortunately, this is not the easiest to revert right now. One way, which is not recommended for casual users is to edit the Properties of an open window. From there, you can edit the colors manually, using the table as a guide. If there is enough interest and demand, a future update may make it possible to apply other themes using the Update-Link utility, but for now it is not very easy to revert.

PowerShell profile

You will also want to revert any changes you made to your PowerShell profile. Just open the profile you created or modified and remove the code.

TODO

  • Fix Out-Colors.ps1
  • Fix Set-GruvboxDarkColorDefaults.ps1
  • Fix Set-GruvboxLightColorDefaults.ps1

Screenshots

Command Prompt Old Default

Command Prompt Old Default

Command Prompt New Default

Command Prompt New Default

Command Prompt Hard Dark Gruvbox

Command Prompt Hard Dark Gruvbox

Command Prompt Medium Dark Gruvbox

Command Prompt Medium Dark Gruvbox

Command Prompt Soft Dark Gruvbox

Command Prompt Soft Dark Gruvbox

Command Prompt Hard Light Gruvbox

Command Prompt Hard Light Gruvbox

Command Prompt Medium Light Gruvbox

Command Prompt Medium Light Gruvbox

Command Prompt Soft Light Gruvbox

Command Prompt Soft Light Gruvbox

cmd-colors-gruvbox's People

Contributors

bambocher avatar charles-hollenbeck avatar dahlbyk avatar jdagilliland avatar neilpa avatar ntwb avatar rbeesley avatar russwe avatar ryanbee-msft avatar shanselman avatar thebigbear avatar

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.