Skip to content

Instantly share code, notes, and snippets.

@Linhieng
Last active August 26, 2023 06:28
Show Gist options
  • Select an option

  • Save Linhieng/092192b87a23e9c53f77249f14e267dd to your computer and use it in GitHub Desktop.

Select an option

Save Linhieng/092192b87a23e9c53f77249f14e267dd to your computer and use it in GitHub Desktop.

Revisions

  1. Linhieng revised this gist Aug 26, 2023. 2 changed files with 74 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions Microsoft.PowerShell_profile.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    function prompt {
    $identity = [Security.Principal.WindowsIdentity]::GetCurrent()
    $principal = [Security.Principal.WindowsPrincipal] $identity
    $adminRole = [Security.Principal.WindowsBuiltInRole]::Administrator
    $fullpath = (Get-Location) -replace "\\", "/"

    if($principal.IsInRole($adminRole)) {
    ([System.Environment]::NewLine) + "[Admin] " + "$([char]0x1b)[92m" + "$fullpath" + "$([char]0x1b)[91m" + ([System.Environment]::NewLine) + "> "
    } else {
    ([System.Environment]::NewLine) + "$([char]0x1b)[92m" + "$fullpath" + "$([char]0x1b)[91m" + ([System.Environment]::NewLine) + "> "
    }
    }
    62 changes: 62 additions & 0 deletions lim-simple.omp.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    {
    "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
    "blocks": [
    {
    "alignment": "left",
    "newline": true,
    "segments": [
    {
    "foreground": "#FFFF00",
    "style": "plain",
    "template": "\u256d\u2500",
    "type": "text"
    },
    {
    "foreground": "#ffffff",
    "style": "plain",
    "properties": {
    "folder_separator_icon": "/",
    "style": "full"
    },
    "template": " {{ .Path }} ",
    "type": "path"
    }
    ],
    "type": "prompt"
    },
    {
    "alignment": "right",
    "segments": [
    {
    "background": "#e4e4e4",
    "foreground": "#585858",
    "properties": {
    "style": "austin",
    "always_enabled": true
    },
    "invert_powerline": true,
    "style": "powerline",
    "powerline_symbol": "\ue0b2",
    "template": " \uf0e7 {{ .FormattedMs }} ",
    "type": "executiontime"
    }
    ],
    "type": "prompt"
    },
    {
    "alignment": "left",
    "newline": true,
    "segments": [
    {
    "foreground": "#FFFF00",
    "style": "plain",
    "template": "\u2570\u2500\ue285",
    "type": "text"
    }
    ],
    "type": "prompt"
    }
    ],
    "final_space": true,
    "version": 2
    }
  2. Linhieng renamed this gist Aug 26, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. Linhieng created this gist Aug 26, 2023.
    68 changes: 68 additions & 0 deletions lim-diamond.omp.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,68 @@
    {
    "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
    "blocks": [
    {
    "alignment": "left",
    "newline": true,
    "segments": [
    {
    "background": "#ffffff",
    "foreground": "#61AFEF",
    "leading_diamond": "\u256d\u2500\ue0b2",
    "style": "diamond",
    "template": " \uf007 {{ .HostName }} ",
    "trailing_diamond": "\ue0b0",
    "type": "session"
    },
    {
    "background": "#91ddff",
    "foreground": "#100e23",
    "powerline_symbol": "\ue0b0",
    "properties": {
    "folder_icon": "\uf115",
    "folder_separator_icon": " \ue0b1 ",
    "style": "full"
    },
    "style": "powerline",
    "template": " {{ .Path }} ",
    "type": "path"
    }
    ],
    "type": "prompt"
    },
    {
    "alignment": "right",
    "segments": [
    {
    "background": "#e4e4e4",
    "foreground": "#585858",
    "properties": {
    "style": "austin",
    "always_enabled": true
    },
    "invert_powerline": true,
    "style": "powerline",
    "powerline_symbol": "\ue0b2",
    "template": " \ueba2 {{ .FormattedMs }} ",
    "type": "executiontime"
    }
    ],
    "type": "prompt"
    },
    {
    "alignment": "left",
    "newline": true,
    "segments": [
    {
    "foreground": "#FFFF00",
    "style": "plain",
    "template": "\u2570\u2500\ue285",
    "type": "text"
    }
    ],
    "type": "prompt"
    }
    ],
    "final_space": true,
    "version": 2
    }