Last active
April 6, 2021 01:17
-
-
Save yusent/50c474ad4a2b8c4d14b59d4d97da2200 to your computer and use it in GitHub Desktop.
A script to select a random base16 theme from base16-shell project for the current terminal ignoring some keywords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
scripts_dir="$HOME/.config/base16-shell/scripts" | |
if [ -d $scripts_dir ] | |
then | |
blacklist="light|brushtrees|cupertino|github|cupcake|tomorrow|fruit" | |
entries=($(ls -d "$scripts_dir"/* | grep -Ev "$blacklist")) | |
# Seed random generator | |
random=$$$(date +%s) | |
selected_entry=${entries[$RANDOM % ${#entries[@]} ]} | |
theme_name=$(basename "$selected_entry" | cut -d. -f1) | |
echo "Using $theme_name theme" | |
source $selected_entry | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment