Comments (6)
+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.
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.
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.
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.
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.
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)
- PowerLine fails to import saved prompt including a single-quoted string HOT 2
- Get-SegmentedPath variably handles alternative PSDrives with bugs
- Conditional block colors HOT 1
- Special characters is not shown in powershell. HOT 4
- List available blocks + how to add them.
- Run this every time ? HOT 2
- Install fails without -AllowClobber HOT 1
- Can't install with Pansies 1.4.0-beta03 HOT 1
- Error with separator HOT 1
- Support for no background colour HOT 4
- Loading profile info from Documents\WindowsPowerShell even when running on PSCore HOT 1
- Where is the prompt settings stored? HOT 4
- Doesn't work in Powershell Core HOT 3
- Needed to install prerelease Pansies HOT 4
- Error With New PowerShell 7.1 preview 2 - Get-Date Usage Needs Full Parameter Name HOT 2
- Exception in PowerLinePrompt HOT 7
- PowerLine 3.4.0 fails to read a config that worked with 3.3.0 HOT 8
- Req: A community theme repo HOT 2
- "Exception thrown from prompt block" even when the exception is handled within the block HOT 5
- What is the correct way to write a clear final separator?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerline.