Eureka Moment Wiki

One eureka moment at the time

User Tools

Site Tools


windows:scripting:conemu_shell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
windows:scripting:conemu_shell [2016/12/19 14:31]
tplecko created
windows:scripting:conemu_shell [2017/08/10 13:00] (current)
Line 1: Line 1:
 +====== Script to modify ConEmu prompt ======
 + to "​username@computername architecture path" and a $ if run as admin, and > if not run as admin
 +<code bash |Cmd>​@echo off
 +rem username@pc
 +set P1=$E[32m$E]9;​8;"​USERNAME"​$E\@$E]9;​8;"​COMPUTERNAME"​$E\$S
  
 +rem path
 +if "​%PROCESSOR_ARCHITECTURE%"​ == "​AMD64"​ (
 +    set P2=$E[95m$P$E[90m
 +) else (
 +    set P2=$E[92m$P$E[90m
 +)
 +
 +rem Is admin or user?
 +if "​%ConEmuIsAdmin%"​ == "​ADMIN"​ (
 +  set P3=$E[90m$$
 +) else (
 +  set P3=$E[90m$G
 +)
 +
 +rem Finally reset color and add space
 +set P4=$E[m$S
 +
 +prompt %P1%%P2%%P3%%P4%</​code>​
windows/scripting/conemu_shell.txt · Last modified: 2017/08/10 13:00 (external edit)