Skip to content

Instantly share code, notes, and snippets.

View MRDGH2821's full-sized avatar

Mihir Rabade MRDGH2821

View GitHub Profile
MRDGH2821 /
Created May 12, 2024 07:09
Installs Oh My Posh in linux OS with random theme loader config
#!/user/bin/env bash
mkdir -p ~/bin
# Random theme loader
curl -s >> ~/.bashrc
# Add ~/bin to path
export PATH=~/bin:$PATH
MRDGH2821 /
Last active May 9, 2024 15:07
Symlinks Casa OS files to external storage
#!/usr/bin/env bash
# Made by
# Migrates the /DATA sub folders to specified external storage.
# Run as sudo if there are problems in stoping or symlinking.
# Stops casa os & docker services to symlink folders without problems.
systemctl stop casaos*
systemctl stop docker*
MRDGH2821 /
Created April 5, 2024 14:21
A random theme loader for Oh My Posh for bash shell
#!/usr/bin/env bash
# Oh my posh random theme initializer
export PATH=~/bin:$PATH #provide path to oh-my-posh install folder
omp_themes_dir="$HOME/.cache/oh-my-posh/themes" #provide path to oh-my-posh installed themes
# Get a list of all JSON theme files in the directory
omp_themes=($(ls $omp_themes_dir/*.json))
# Get the number of JSON theme files
MRDGH2821 / oh-my-posh-random.ps1
Created December 27, 2021 14:11
A random theme loader for Oh-my-posh in Windows Powershell
$theme = Get-ChildItem $env:UserProfile\AppData\Local\Programs\oh-my-posh\themes\ | Get-Random
echo $
oh-my-posh --init --shell pwsh --config $theme.FullName | Invoke-Expression
MRDGH2821 / oh-my-posh-random.lua
Created December 27, 2021 13:38
A random oh-my-posh theme loader for Command Prompt
function math.randomchoice(t) --Selects a random item from a table
local keys = {}
for key, value in pairs(t) do
keys[#keys + 1] = key --Store keys in another table
index = keys[math.random(1, #keys)]