Ostatnio aktywny 2 weeks ago

Hardened interactive Ubuntu/Debian setup scripts, including CCUsage multi-device sync for Claude Code, Codex CLI, and OpenCode.

Rewizja 217e2df3064ec07ac09e9c2a9731b12c7bb8c8f5

READMD.md Surowy
bash -c "$(curl -fsSL https://opengist.rmrf.online/weehong/2de15ba0106a475fa41215159203a63b/raw/HEAD/install_font.sh)"
install_font.sh Surowy
1#!/bin/bash
2
3# Exit immediately if a command exits with a non-zero status
4set -e
5
6FONT_NAME="UbuntuSans"
7FONT_ZIP="${FONT_NAME}.zip"
8FONT_DIR="$HOME/.local/share/fonts/NerdFonts/${FONT_NAME}"
9TMP_DIR=$(mktemp -d)
10
11echo "Searching for the latest release of $FONT_NAME Nerd Font..."
12
13# Use GitHub API to find the latest release download URL for UbuntuSans.zip
14DOWNLOAD_URL=$(curl -s https://api.github.com/repos/ryanoasis/nerd-fonts/releases/latest \
15 | grep "browser_download_url.*${FONT_ZIP}" \
16 | cut -d '"' -f 4)
17
18if [ -z "$DOWNLOAD_URL" ]; then
19 echo "Error: Could not find the download URL for $FONT_NAME. Check your internet connection or GitHub API limits."
20 rm -rf "$TMP_DIR"
21 exit 1
22fi
23
24echo "Latest version found!"
25echo "Downloading from: $DOWNLOAD_URL"
26
27# Download the zip file to the temporary directory
28curl -L -q "$DOWNLOAD_URL" -o "$TMP_DIR/$FONT_ZIP"
29
30echo "Extracting fonts..."
31# Ensure unzip is installed (will fail gracefully if not)
32if ! command -v unzip &> /dev/null; then
33 echo "Error: 'unzip' is not installed. Please install it using 'sudo apt install unzip' and try again."
34 rm -rf "$TMP_DIR"
35 exit 1
36fi
37
38unzip -q -o "$TMP_DIR/$FONT_ZIP" -d "$TMP_DIR/extracted"
39
40echo "Installing fonts to $FONT_DIR..."
41# Create the font directory if it doesn't exist
42mkdir -p "$FONT_DIR"
43
44# Move only the TrueType (.ttf) or OpenType (.otf) files to the fonts directory
45find "$TMP_DIR/extracted" -name '*.[ot]tf' -type f -exec cp {} "$FONT_DIR/" \;
46
47echo "Updating the system font cache..."
48fc-cache -f "$FONT_DIR"
49
50echo "Cleaning up temporary files..."
51rm -rf "$TMP_DIR"
52
53echo "Done! $FONT_NAME Nerd Font has been successfully installed."