|
|
@@ -20,6 +20,7 @@ def main():
|
|
|
eza()
|
|
|
git_whence()
|
|
|
lazygit()
|
|
|
+ oh_my_posh()
|
|
|
starship()
|
|
|
|
|
|
def bat():
|
|
|
@@ -118,7 +119,6 @@ def dust():
|
|
|
os.unlink(tarball_path)
|
|
|
dust_path.chmod(0o755)
|
|
|
|
|
|
-
|
|
|
def eza():
|
|
|
if platform.system() == 'Darwin':
|
|
|
print('$ brew install eza')
|
|
|
@@ -173,6 +173,26 @@ def lazygit():
|
|
|
tar.extract('lazygit', CURRENT_DIR)
|
|
|
os.unlink(CURRENT_DIR / 'lazygit.tgz')
|
|
|
|
|
|
+def oh_my_posh():
|
|
|
+ if platform.system() == 'Darwin':
|
|
|
+ print('$ brew install oh-my-posh')
|
|
|
+ subprocess.run(['brew', 'install', 'oh-my-posh'], check=True)
|
|
|
+ return
|
|
|
+ else:
|
|
|
+ assert platform.system() == 'Linux'
|
|
|
+
|
|
|
+ if (CURRENT_DIR / 'oh-my-posh').exists():
|
|
|
+ print('oh-my-posh already downloaded')
|
|
|
+ return
|
|
|
+
|
|
|
+ client = httpx.Client()
|
|
|
+ arch = platform.machine()
|
|
|
+ if arch == 'aarch64':
|
|
|
+ arch = 'arm64'
|
|
|
+ url = f'https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-{arch}'
|
|
|
+ download(client, url, CURRENT_DIR / 'oh-my-posh')
|
|
|
+ os.chmod(CURRENT_DIR / 'oh-my-posh', 0o755)
|
|
|
+
|
|
|
def starship():
|
|
|
if platform.system() == 'Darwin':
|
|
|
print('$ brew install starship')
|
|
|
@@ -198,7 +218,6 @@ def starship():
|
|
|
tar.extract('starship', CURRENT_DIR)
|
|
|
tarball_path.unlink()
|
|
|
|
|
|
-
|
|
|
def get_output(argv: list[str]) -> str:
|
|
|
proc = subprocess.run(argv, check=True, capture_output=True, encoding='ascii')
|
|
|
return proc.stdout.rstrip('\n')
|