Git Product home page Git Product logo

Comments (6)

rkeithhill avatar rkeithhill commented on June 12, 2024 1

+1 for Test-Elevated or something like that. Currently, I use:

$global:Prompt_IsAdmin = (New-Object Security.Principal.WindowsPrincipal ([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)

Also, while I like the idea of smaller, more granular modules, the colors I would use for PowerLine would heavily influenced by the color theme I'm currently running. So if you don't do theming in this module, then perhaps there is some hook/registration between the theming module and this one so when I change color themes, my PowerLine block colors get updated as well.

from powerline.

rkeithhill avatar rkeithhill commented on June 12, 2024

I like @Jaykul handling of prompt, lines and blocks better and I like the module name PowerLine better. But I do like @JanJoris color theming support, Posh-Git support and admin/failed command indicators.

from powerline.

JanDeDobbeleer avatar JanDeDobbeleer commented on June 12, 2024

Thx. oh-my-posh started out as more than just theming. I should rename it to posh-theme or something as it supports a lot more than just powerline styled prompts. You can do whatever with it. I do like this implementation, there's some cool stuff in here.

from powerline.

Jaykul avatar Jaykul commented on June 12, 2024

Having used oh-my-zsh, I loved the idea of oh-my-posh, but in both cases, their idea of a "theme" is really just a full-blown custom prompt function ... my goal is something much more modular, so it's easier to share and tweak other people's prompts.

I'm desperate to get rid of this mess I created and avoid creating a new mess.

For what it's worth:

You can already style the PowerLine prompt to not use background colors, and ditch PowerLine separators, so you should be able to build any prompt you like. That is simply not well documented yet.

I'm working on the nested blocks support and a few other pieces like #5 which seem important to finish before writing docs for themeing 😜

I would definitely like to collect themes, once I've stopped changing the design.

There are a few more built-in functions necessary. I have included a Get-Elapsed but turning this into a module broke using $? for success, so I need to publish the hack I'm using as Test-Success to show how to change background colors if there's an error (or just output an "x"), and probably need to add a couple others like Test-Elevation ...

I'd be happy to take suggestions and/or pull requests ;-)

from powerline.

Jaykul avatar Jaykul commented on June 12, 2024

Yeah ... I don't think I know an API for switching the color theme of the console. I mean, I have scripts to change the colors of console window shortcuts, but I don't know how to change it in a running window...

ConEmu, of course, has functionality for themes -- and I'm thinking about sharing my config for that and some of the color-switching scripts that I have (it's not much, but I switch between normal, elevated, and presentation themes).

from powerline.

Jaykul avatar Jaykul commented on June 12, 2024

By the way, you can use the slightly shorter string overload:

([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("Administrators")

And I've been testing using the well-known Administrators SID, it seems to work. Both of these return nothing if you're not elevated:

[Security.Principal.WindowsIdentity]::GetCurrent().Groups -eq "S-1-5-32-544"
[Security.Principal.WindowsIdentity]::GetCurrent().Owner -eq 'S-1-5-32-544'

from powerline.

Related Issues (20)

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.