Skip to content

Instantly share code, notes, and snippets.

View elanora96's full-sized avatar
🤠

Elanora Manson elanora96

🤠
View GitHub Profile
@elanora96
elanora96 / opkgrade.sh
Created October 20, 2024 22:04
OpenWRT opkg upgrade all
confirm() {
while true; do
read -rp "[y/n]: " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
*) echo "Please answer yes or no." ;;
esac
done
}
@elanora96
elanora96 / .zshrc.$ZSH_CUSTOM.workaround.gist.sh
Last active August 4, 2024 18:42
Oh My Zsh multiple "$ZSH_CUSTOM/plugins" workaround
# oh-my-zsh doesn't allow multiple ZSH_CUSTOM folders, here's a workaround
# Source: https://gist.github.com/elanora96/b2424fa9f70d7549fd0590c58949f686
local other_plugins_folders=("/usr/share/zsh/plugins" "$HOME/Projects/zsh-plugins")
for dir in "${other_plugins_folders[@]}"; do
if [[ -d "$dir" ]]; then
for sdir in "$dir"/*; do
if [[ -d "$sdir" ]] && [[ ! -e "$ZSH/custom/plugins/$(basename "$sdir")" ]]; then
ln -s "$sdir" "$ZSH/custom/plugins"
fi