Git Product home page Git Product logo

concfg's Introduction

concfg

concfg is a utility to import and export Windows console settings like fonts and colors.

Important Caveats

  • Console settings can be overridden by program- or shortcut-specific settings stored in the registry or in the .lnk file itself. Concfg can attempt to clean these up for you by removing registry settings that might conflict and removing console properties from .lnk files in known directories. concfg import will prompt you to clean these up after an import, or you can run concfg clean at any time.
  • PowerShell's syntax highlighting isn't compatible with Base16's conventions by default. To set syntax highlighting to colors consistent with Base16's conventions, use concfg tokencolor sub-command to modify the syntax highlighting colors.

Install

If you have Scoop, you can install concfg with:

scoop install concfg

If you don't, you can download a zip of this repository, and add bin\concfg.ps1 to your PATH.

Usage

Using built-in presets

  1. Use a color scheme, for example use the Solarized dark color presets:
concfg import solarized-dark
  1. Add some opinioned settings (optional)
concfg import basic

This will import some opinioned non-color settings, such as fontFace and fontSize, etc.

{
    "font_face": "Lucida Console",
    "font_true_type": true,
    "font_size": "0x14",
    "font_weight": 400,
    "cursor_size": "small",
    "window_size": "80x25",
    "screen_buffer_size": "80x1000",
    "command_history_length": 50,
    "num_history_buffers": 4,
    "quick_edit": false,
    "insert_mode": true,
    "fullscreen": false,
    "load_console_IME": true
}

You can also import multiple presets at once, the later sources will override settings from the earlier ones.

concfg import solarized-dark basic
  1. If you want to revert to the default cmd color preset:
concfg import cmd-default

Or the default powershell color preset:

concfg import powershell-default

If you imported non-color settings such as fontFace, and you want to reset them:

concfg import basic-reset

Note: Since concfg will clean all program- or shortcut-specific settings stored in the registry or in the .lnk file. So when you import a color preset, all console applications (cmd.exe/powershell.exe) will use the same preset. You can not set cmd.exe to use cmd-default while set powershell to use powershell-default. That means when you import powershell-default, your cmd.exe will also become powershell-blue. This is a known issue and proper behavior.

There are two default cmd color presets cmd-default and cmd-legacy, please read this article to see the difference. And because of this, there are also two default powershell presets powershell-default and powershell-legacy.

Importing settings from a URL

concfg import https://raw.githubusercontent.com/lukesampson/concfg/master/presets/solarized-light.json

This URL happens to be one of the built in presets. It's just an example of importing a URL. The easy way to get Solarized light would be concfg import solarized-light

Making your own settings to save or share

concfg export <path>

Help

Type concfg without parameters to see the usage info.

Credits

Thanks to Stephen Edgar(@ntwb) for adding support for Chris Kempson's base16 color settings.

Thanks to Anant Anand Gupta and MindzGroup Technologies for the online preview and edit website.

Concfg uses Ethan Schoonover's Solarized color theme.

License

MIT

concfg's People

Contributors

0x326 avatar adautoneto avatar adityatrivedi avatar anantanandgupta avatar benallred avatar chawyehsu avatar chhh avatar chidea avatar corbob avatar gregkaleka avatar h404bi avatar ibigpapa avatar jozefizso avatar lukesampson avatar michael-wolfenden avatar ntwb avatar parkovski avatar peskyengine avatar ralish avatar ryanelian avatar stamminator avatar theunrepentantgeek avatar tknarr avatar y6nh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

concfg's Issues

Reset default powershell colors

Hello.

concfg affected more terminals on my system then I would like and I wanted to reset my colors to defaults. I ran concfg import defaults as per documentation to get stock colors, however this does not give me standard colors, it turns the blue powershell into a black cmd looking thing.

concfg import solarized fails

When I try importing solarized small, I get the following error.

PS C:\redacted> concfg import solarized small
concfg: ERROR: couldn't load settings from solarized

Syntax errors in pull request 41

There's a syntax error in the preset files in pull request 41. I'm going to fix it and submit a PR to correct the bug this evening.

Intensity is flipped?

Win32 puts the intensity on the upper colors so that intense/bold/light are to the right here:
image
But concfg (at least for solarized) reverses that, so that apps that ask for intense or bold get the opposite. Is that an issue just with your solarized sample, or is it reversed in all of concfg?
image

Shortcuts not modified due to not resolving (roaming) appdata folder correctly

concfg uses the following code to resolve roaming application data folder:
$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\<etc>

However in some (Enterprise) environments, the folder is redirected to a location outside the users profile folder (e.g. on a network share or on a different drive).

I would suggest to resolve the path like this:
[environment]::GetFolderPath("applicationdata")

Or if it's the Start Menu folder you can query the path directly:

[environment]::GetFolderPath("StartMenu")

Output in my environment:

PS C:\> [environment]::GetFolderPath("StartMenu")
D:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu
PS C:\> "$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu"
C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu

Prompts during import

Hi Luke,

This is a very cool script. I'd like to incorporate it in my automated dev box script. When I run:

concfg import solarized

It prompts to clean overrides in the registry. Can a way be added so that it does not prompt for this so that scripts can complete without user interaction?

Thanks,
Dennis

concfg import -y

There doesn't seem to be anyway to tell concfg that you want to accept prompts automatically. For example:

concfg import solarized-dark -y

I'd like to perform some operations in a script.

Color Tool support

Following along from microsoft/terminal#62, it appears there's some differences in behavior between concfg and the Color Tool. Could you assist making concfg compatible with Color Tool? I'd love to have centralized management with these 2 great tools that aim to achieve the same thing.

Thank You!!!

I don't usually make silly posts like this, but from the moment I moved from Mac OS X around 3 years ago until now, the strangeness of colors that don't match between different between Cmd, PowerShell, and eventually WSL has always been nauseating.

I just for the first time ran:

concfg clean

After launching PowerShell, it finally matches cmd and WSL!

Whatever ConHost based task, regardless of being launched from the Start Menu or from Start + Run, or from Keypirinha - they all finally look the same!!!

You fixed it!

Add to chocolatey

I don't know if you use chocolatey or whether you have exclusively chosen scoop, but it would be excellent to have this in chocolatey as well.

'concfg export' for powershell?

It seems concfg export exports settings only from command line in Windows (cmd) even when it's being run in powershell, so output says i.e. "font_face": "Lucida Console" while my powershell uses DejaVu Sans Mono for Powerline font. The same goes for all colors. Is there a way to export actual powershell config?

What controls the coloring of this popup?

When I use wget to download a file, I get this style popup

image

As you can see, that yellow on teal is very difficult to read and quite straining on the eyes. I am using the Back to the Code theme, which has "popup_colors": "dark_magenta,white". My console properties confirm the configured popup style:

image

So what's causing that teal and yellow popup styling? Can this be configured?

Runtime error when importing JSON configs

\ $ concfg import 3024
Method invocation failed because [System.Int32] does not contain a method named 'endswith'.
At \\AppData\Local\scoop\apps\concfg\0.2016.01.25\libexec\import.ps1:70 char:5
+     if(!$name.endswith('.json')) { $name = "$name.json" }
+        ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

concfg: ERROR: couldn't load settings from 3024
\ $ systeminfo
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.10586 N/A Build 10586
System Type:               x64-based PC

I haven't tried any patches yet; let me know if you need anything else to reproduce. Thanks!

concfg import solarized fails

$ concfg import solarized
fatal: Not a git repository (or any of the parent directories): .git
concfg: ERROR: couldn't load settings from solarized

$ pwd

Path
----
C:\Users\xxxxxxx

Is there a verbose mode I can put it into when installing?

Tried the help and got similar failures:

$ concfg --help
usage: concfg <command> [<args]

Some useful commands are:
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git

clean
export
help
import
presets


type 'concfg help <command>' to get help for a specific command
$

I bet this is related to our proxy. Ugh.

Cannot reset colors to default windows scheme [solved]

I have been using concfg for a while, But its starting to get on my nerve when it comes to programming, It sets all of my programs to the solarized color theme (even when i run concfg clean) so i need help doing it, I'd like to keep it on my PowerShell and Command Prompt though, Please help!

Every preset makes 'git diff' look awful

I'm not sure what I'm doing wrong, but doing a 'git diff' always seems to end up with grayscale text colors. I'd really like to see lines removed as red, lines added as green, and file information as yellow. Is there a way to get concfg to do that?

Execution - Any plans to standarized with normal cmdlet and function call format?

I love this project, but I had serious issues getting it running due to the relative paths and argument completion. I was wondering if any plans to standardize with a normal cmdlet parameter/function structure, and not dynamically based on dot sourcing?

My work around to get the import command to finally run was to create a bat file in the project directly that called the command with this syntax

echo Must Run This as Administrator
cd %~dp0
powershell.exe -File "%~dp0bin\concfg.ps1" import solarized
pause

Not that any alteration caused issues for me. Very sensitive to any quotes, parameter changes. Let me know if I can help. This is a great project and I'm thankful for your contributions to removing annoying black cmd windows from the universe :-)

Always install the most recent version (update)

I plan on trying to use ansible to install some scoop packages through WSL. The idea though is that every time the playbook runs it should install the most recent version of the app. This won't work though because it will just report that the app is already installed. I have to do two operations: Install, followed by an update. It would be nice if there were a way to combine these steps into a single operation.

Recent XDG_CONFIG_HOME refactor seems to cause an issue for fresh installs

I haven't had an opportunity to dig deeply, so I'm only seeing what is the most likely culprit, but the recent commit lukesampson/pshazz@9bda1e3 may have adjusted setting up a fresh install in a way that fails to create the config file if it does not exist (as the path does not exist).

This is the error I'm seeing:

Set-Content : Could not find a part of the path 'C:\Users\user\.config\pshazz\config.json'.
At C:\Users\user\scoop\apps\pshazz\current\lib\config.ps1:24 char:27
+     ConvertTo-Json $cfg | Set-Content $configFile -Encoding ASCII
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\user\.config\pshazz\config.json:String) [Set-Content], DirectoryNotFoundException
    + FullyQualifiedErrorId : GetContentWriterDirectoryNotFoundError,Microsoft.PowerShell.Commands.SetContentCommand

This error occurs immediately after:

scoop install --arch 64bit concfg
scoop install pshazz
concfg import gruvbox-dark-medium
pshazz use lambda

Note that running pshazz init does not correct the issue.

Imported settings do not persist across launches (Windows 10)

I suspect this may be a Windows 10 specific issue, but I'm quite the novice with Power Shell; Luke, I'm hoping you can shed some light on this :)

  1. Launch PowerShell from start menu (either cmd+x and arrow up, or cmd, type "powershell" and hit enter once it's found)
  2. concfg import solarized small
  3. "...would you like to find and remove them?" Y
  4. stuff -- overrides removed
  5. "...open new console to see the changes?" Y

New console opens. Nice! But now I exit the console and the previous console (close all Power Shell windows) and then re-open powershell. And then I'm back to the default colors.

The first time you do this, it'll find and remove some overrides, but subsequent times, it can't seem to find any overrides to remove so it just says they're removed and has no further output between those commands:

~ $ concfg import solarized small
console settings were imported from solarized
console settings were imported from small

overrides in the registry and shortcut files might interfere with your concfg
settings.
would you like to find and remove them? (Y/n): y
overrides removed
would you like to open a new console to see the changes? (Y/n): y
~ $

Any ideas what I can do to get this to persist? Thanks!

Can't import defaults: concfg: ERROR: couldn't load settings from defaults

Command I use is
concfg import defaults

I get

concfg: ERROR: couldn't load settings from defaults

System info:

Win 10 Pro, Version: 10.0.17134 Build 17134
$> scoop info concfg
Name: concfg
Description: Import / export Windows console settings
Version: 0.2018.5.27
Website: https://github.com/lukesampson/concfg
Manifest:
  ~\scoop\apps\scoop\current\bucket\concfg.json
Installed:
  ~\scoop\apps\concfg\0.2018.5.27
Binaries:
   bin\concfg.ps1

Windows 10 Version 1709 not saving console settings

I'm not sure what happened. Shortly after updating to the Fall Creators Update I accidentally unpinned PowerShell from my Taskbar, ever since then I can't get concfg changes to stick. Previously the monokai theme was loaded every time I launched PowerShell (I have import monokai -n in my PowerShell Profile script).

Now, if I run
concfg import monokai
and choose yes to launch a new console window then the new console works as expected, the theme is applied.

However, the defaults are not overwritten, I have to do that every time I launch a Powershell window. What am I doing wrong?

Remove non-color registry settings from presets

I use a console scheme/theme based on Monokai, the Source Code Pro font and screen size 125 x 3000, we should be able to select/change/build/combine/omit all these things like so:

config import monokai source-code-pro big
concfg import solarized consolas small

The following should be removed from the color presets and added to their own settings file similar to the big.json, medium,json & small.json files for screen size.

    "font_face":       "Consolas",
    "font_true_type":  true,
    "font_size":       "0x20",
    "font_weight":     700,

Maybe consolas.json?

    "window_size":        "80x25",
    "screen_buffer_size": "80x3000",

This should be taken care of in big.json, medium,json & small.json

    "cursor_size": "small",

    "command_history_length": 200,
    "num_history_buffers":      4,

    "quick_edit":  true,
    "insert_mode": true,
    "fullscreen":  false,

Not sure, maybe a common.json/default.json file that will always be automatically imported

    "load_console_IME":  true

This is a weird one, is this just for pasting alt charecter sets into the console?
(Couldn't find much information on this 'that made sense')

Turns my human console into a tiny console for ants

Regardless of what I import, I get this squished tiny atrocity that I haven't figured out how to resolve.

Does this software work anymore?

image

Windows 10 build 16353
Normal DPI scaling
1920x1200 desktop
Mouse present

scoop + git + monokai + vscode = ugly output from git

I am using concfg and git from scoop, vscode is installed at the user level (not via scoop). I run concfg import monokai and everything works fine in powershell. However, when combine with vscode's built in terminal (which also uses powershell) a simple git status will kill the theme.

Strangely, it seems to be theme specific whether this error will appear. For example, solarized-dark does not suffer from this issue. Maybe some configs are missing from some themes? Maybe the themes randomly conflict with vscode themes (I'm using the default dark theme in vscode)? Not sure, but I figured I'd try posting about it here first.

Discard Old Duplicates not exported

Hi,
Seems like the Discard Old Duplicates flag in the Command History section on the Options tab isn't exported. Think the property is named HistoryNoDup.

Ronny

Update themes for PowerShell 5

Many of the themes behave poorly with the new syntax highlighting in powershell 5. For example, typing numbers in many of the light themes results in white on white, or close to it, and typing command line flags in many of the dark themes results in grey on grey, or close to it. The new Mountain theme seems to do okay.

Examples

white_on_white_numbers

flags_hard_to_read

files in directory listing are illegible with most themes

Most themes I have tried (monokai, tomorrow, oceannext, mocha) have basically illegible file listings from dir/ls as any files which are not text files or executables are presented with a very dark gray color. Any ideas on how this can be resolved? Thanks!

image

No support for Windows Terminal

Windows Terminal is in beta, and there's no support for concfg. When I set a theme, it works fine when I launch powershell directly, but not when I try to launch it through the new terminal (there's no effect and the old white on blue theme is still there).

Colors are wrong

I'm using concfg to customize the theme of my Powershell but it's working.
This are the commands I've launched:
concfg import solarized small (then answered yes to all)
This is the result
powershell

My Win Build is 10.0.14931

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.