Updated auto-fix script, made rebuilt-machine work with icon theme, and added vm script

This commit is contained in:
crowetic 2025-04-10 18:57:11 -07:00
parent a500cee3ce
commit 456f084d51
4 changed files with 128 additions and 16 deletions

89
add-qortal-icon-theme.sh Executable file
View File

@ -0,0 +1,89 @@
#!/bin/bash
# Customize Yaru-blue-dark icon theme locally and add Qortal icons
ICON_THEME_NAME="Yaru-blue-qortal"
ICON_SOURCE_DIR="${HOME}/Pictures/icons/icons_theme"
ICON_CACHE_DIR="${HOME}/.icons/${ICON_THEME_NAME}"
TARGET_THEME_DIR="${ICON_CACHE_DIR}/48x48/apps"
# Mapping of source icons to icon names
declare -A ICON_MAP=(
["qortal-menu-button.png"]="qortal-menu-button"
["qortal-menu-button-2.png"]="qortal-menu-button-2"
["qortal-menu-button-3.png"]="qortal-menu-button-3"
["qortal-menu-button-4.png"]="qortal-menu-button-4"
["qortal-ui.png"]="qortal-ui"
["qortal-hub.png"]="qortal-hub"
["qortal.png"]="qortal"
)
# Step 1: Copy system Yaru-dark theme as base
if [ ! -d "${ICON_CACHE_DIR}" ]; then
echo "[*] Creating local copy of Yaru-dark theme as '${ICON_THEME_NAME}'..."
mkdir -p "${ICON_CACHE_DIR}"
rsync -a /usr/share/icons/Yaru-dark/ "${ICON_CACHE_DIR}/"
# Copy index.theme from Yaru-blue-dark if it exists
if [ -f /usr/share/icons/Yaru-blue-dark/index.theme ]; then
cp /usr/share/icons/Yaru-blue-dark/index.theme "${ICON_CACHE_DIR}/index.theme"
fi
# Update index.theme metadata
sed -i 's/^Name=.*/Name=Yaru-blue-qortal/' "${ICON_CACHE_DIR}/index.theme"
sed -i 's/^Inherits=.*/Inherits=Yaru-blue-dark,Yaru-dark,Yaru,hicolor/' "${ICON_CACHE_DIR}/index.theme"
# Ensure Directories includes 48x48/apps
if ! grep -q "48x48/apps" "${ICON_CACHE_DIR}/index.theme"; then
echo "Directories=48x48/apps" >> "${ICON_CACHE_DIR}/index.theme"
echo "
[48x48/apps]
Size=48
Context=Applications
Type=Fixed" >> "${ICON_CACHE_DIR}/index.theme"
fi
fi
# Step 2: Ensure target icon directory exists
mkdir -p "${TARGET_THEME_DIR}"
# Step 3: Install icons (resized if possible)
install_icon() {
local src="$1"
local name="$2"
local dest="${TARGET_THEME_DIR}/${name}.png"
if [ ! -f "$src" ]; then
echo "[!] Source icon not found: $src"
return
fi
if command -v convert &>/dev/null; then
echo "[*] Resizing and installing $name to ${TARGET_THEME_DIR}"
convert "$src" -resize 48x48 "$dest"
else
echo "[*] Copying $name without resizing to ${TARGET_THEME_DIR}"
cp "$src" "$dest"
fi
}
# Step 4: Loop through and install icons
for src in "${!ICON_MAP[@]}"; do
install_icon "${ICON_SOURCE_DIR}/${src}" "${ICON_MAP[$src]}"
done
# Step 5: Update the icon cache
if [ -f "${ICON_CACHE_DIR}/index.theme" ]; then
echo "[*] Updating icon cache for '${ICON_THEME_NAME}'..."
gtk-update-icon-cache -f "${ICON_CACHE_DIR}" || echo "[!] gtk-update-icon-cache failed or not found."
else
echo "[!] No index.theme file found. Cannot update icon cache."
fi
# Step 6: Set as active icon theme
echo "[*] Setting '${ICON_THEME_NAME}' as the current icon theme..."
gsettings set org.cinnamon.desktop.interface icon-theme "${ICON_THEME_NAME}"
echo "✅ Qortal icons installed into local theme: ${ICON_THEME_NAME}"
echo " You can now use Icon=qortal-ui (etc.) in .desktop files."
echo " Theme is now active with blue-dark base styling."

View File

@ -30,6 +30,12 @@ initial_update() {
}
check_internet() {
echo "${CYAN}....................................................................${NC}\n"
echo "${CYAN}THIS SCRIPT IS MEANT TO RUN AUTOMATICALLY, PLEASE ALLOW IT TO COMPLETELY FINISH AND DO NOT CLOSE IT EARLY!${NC}\n"
echo "${CYAN}CLOSING IT EARLY WILL PREVENT IT FROM DOING ITS JOB, AND ENSURING QORTAL IS UPDATED, AND SYNCHRONIZED.${NC}\n"
echo "${CYAN}PLEASE BE PATIENT AND ALLOW SCRIPT TO RUN. THANK YOU! -crowetic${NC}\n"
echo "${CYAN}....................................................................${NC}\n"
sleep 5
echo "${YELLOW}Checking internet connection${NC}\n"
INTERNET_STATUS="UNKNOWN"
TIMESTAMP=$(date +%s)
@ -194,14 +200,14 @@ check_for_GUI() {
}
setup_raspi_cron() {
echo -e "${YELLOW}Setting up cron jobs for Raspberry Pi or headless machines...${NC}\n"
echo "${YELLOW}Setting up cron jobs for Raspberry Pi or headless machines...${NC}\n"
mkdir -p "${HOME}/backups/cron-backups"
crontab -l > "${HOME}/backups/cron-backups/crontab-backup-$(date +%Y%m%d%H%M%S)"
echo -e "${YELLOW}Checking if autostart desktop shortcut exists to avoid double-launch...${NC}\n"
echo "${YELLOW}Checking if autostart desktop shortcut exists to avoid double-launch...${NC}\n"
if find "${HOME}/.config/autostart" -maxdepth 1 -name "start-qortal*.desktop" | grep -q .; then
echo -e "${RED}Autostart desktop entry found! Using GUI-safe auto-fix cron only.${NC}\n"
@ -212,7 +218,7 @@ setup_raspi_cron() {
return
fi
echo -e "${BLUE}No autostart entries found. Setting up full headless cron...${NC}\n"
echo "${BLUE}No autostart entries found. Setting up full headless cron...${NC}\n"
curl -L -O https://raw.githubusercontent.com/crowetic/QORTector-scripts/refs/heads/main/auto-fix-cron
crontab auto-fix-cron
rm -f auto-fix-cron
@ -281,11 +287,11 @@ no_local_height() {
fi
fi
echo "${GREEN}Starting Qortal Core and sleeping 2.5 min to let it start fully, PLEASE WAIT...${NC}\n"
echo "${GREEN}Starting Qortal Core and sleeping 20 min to let it start fully, PLEASE WAIT...${NC}\n"
potentially_update_settings
cd "${HOME}/qortal" || exit 1
./start.sh
sleep 166
sleep 1220
cd || exit 1
echo "${GREEN}Checking if Qortal started correctly...${NC}\n"
local_height_check=$(curl -sS "http://localhost:12391/blocks/height")

View File

@ -13,17 +13,28 @@ NC='\033[0m'
username=$(whoami)
echo "${YELLOW} UPDATING UBUNTU AND INSTALLING REQUIRED SOFTWARE PACKAGES ${NC}\n"
echo "${YELLOW} 🛠 UPDATING 🛠 UBUNTU AND INSTALLING REQUIRED SOFTWARE 📦 PACKAGES 📦 ${NC}\n"
echo "${YELLOW} creating system folders that require admin permissions..."
echo "${YELLOW} ⚙️ creating system folders that require admin permissions..."
sudo apt update
sudo apt -y upgrade
sudo apt -y install git jq gnome-software unzip vim curl openjdk-21-jre yaru-theme-icon yaru-theme-gtk yaru-theme-unity zlib1g-dev vlc chromium-browser p7zip-full libfuse2 htop net-tools bpytop ffmpeg sysbench smartmontools ksnip xsensors fonts-symbola lm-sensors cinnamon-desktop-environment
sudo apt -y install git jq gnome-software openssh-server unzip vim curl openjdk-21-jre yaru-theme-icon yaru-theme-gtk yaru-theme-unity zlib1g-dev vlc chromium-browser p7zip-full libfuse2 htop net-tools bpytop ffmpeg sysbench smartmontools ksnip xsensors fonts-symbola lm-sensors gparted cinnamon-desktop-environment
echo "${YELLOW} 📦 INSTALLING SENSORS MONITOR APPLET FOR PANEL...${NC}\n"
mkdir -p "${HOME}/.local/share/cinnamon/applets"
cd "${HOME}/.local/share/cinnamon/applets"
wget -O sensors-monitor.zip "https://cinnamon-spices.linuxmint.com/files/applets/Sensors@claudiux.zip"
unzip sensors-monitor.zip -d Sensors@claudiux
rm sensors-monitor.zip
cd ${HOME}
echo "✅ Applet installed. You can now add 'Sensors Monitor' to your panel manually."
### SET DEFAULT SESSION TO CINNAMON ###
echo "${YELLOW} SETTING CINNAMON AS DEFAULT DESKTOP SESSION ${NC}\n"
echo "${YELLOW} ⚙️ SETTING CINNAMON AS DEFAULT DESKTOP SESSION ${NC}\n"
# Works for most LightDM and GDM-based setups
echo "cinnamon" > "${HOME}/.xsession"
@ -37,7 +48,7 @@ EOL
echo "${GREEN} Cinnamon session will be loaded by default on next login! ${NC}\n"
### DOWNLOAD & INSTALL QORTAL CORE ###
echo "${YELLOW} DOWNLOADING QORTAL CORE AND QORT SCRIPT ${NC}\n"
echo "${YELLOW} ⬇️ DOWNLOADING QORTAL CORE AND QORT SCRIPT ${NC}\n"
cd "${HOME}"
mkdir -p backups
@ -93,7 +104,7 @@ rsync -raPz Machine-files/* "${HOME}"
rm -rf download Machine-files
### CINNAMON THEMING - ALWAYS APPLIES EVEN IF CINNAMON ISN'T ACTIVE ###
echo "${YELLOW} INSTALLING WINDOWS 10 THEMES FOR CINNAMON ${NC}\n"
echo "${YELLOW} 📦 INSTALLING WINDOWS 10 THEMES FOR CINNAMON ${NC}\n"
mkdir -p "${HOME}/.themes"
@ -108,7 +119,7 @@ fi
[ ! -d "${HOME}/.themes/Windows-10-Dark" ] && git clone https://github.com/B00merang-Project/Windows-10-Dark.git "${HOME}/.themes/Windows-10-Dark"
### APPLY THEMES (WILL WORK AFTER REBOOT TOO) ###
echo "${YELLOW} APPLYING CINNAMON THEMES ${NC}\n"
echo "${YELLOW} ⚙️ APPLYING CINNAMON THEMES ${NC}\n"
gsettings set org.cinnamon.desktop.wm.preferences theme "Windows-10-Dark" || true
gsettings set org.cinnamon.desktop.interface gtk-theme "Windows-10-Dark" || true
@ -118,7 +129,7 @@ gsettings set org.cinnamon.desktop.interface icon-theme "Yaru-blue-dark" || true
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' || true
### CINNAMON PANEL + MENU CUSTOMIZATION ###
echo "${YELLOW} CREATING CINNAMON PANEL AND MENU CONFIGURATION SCRIPT AND SETTING TO RUN POST-STARTUP NEXT TIME. ${NC}\n"
echo "${YELLOW} ⚙️ CREATING CINNAMON PANEL AND MENU CONFIGURATION SCRIPT AND SETTING TO RUN POST-STARTUP NEXT TIME. ${NC}\n"
cat > "$HOME/apply-cinnamon-settings.sh" <<'EOL'
#!/bin/bash
@ -142,7 +153,7 @@ EOL
chmod +x "$HOME/apply-cinnamon-settings.sh"
echo "${GREEN} Downloading additional ${NC}${YELLOW}CINNAMON${NC}${GREEN}settings${NC}\n"
echo "${GREEN} ⬇️ Downloading additional ${NC}${YELLOW}CINNAMON${NC}${GREEN}settings${NC}\n"
curl -L -O https://raw.githubusercontent.com/crowetic/QORTector-scripts/main/cinnamon-settings.json
mkdir -p "${HOME}/.cinnamon/configs/menu@cinnamon.org"
@ -231,7 +242,7 @@ Categories=Qortal;
EOL
echo "${CYAN} Adding CUSTOM QORTAL ICON THEME...${NC}\n"
cd "${HOME}/Pictures/icons/icons_theme"
curl -L -O https://raw.githubusercontent.com/crowetic/QORTector-scripts/main/add-qortal-icons-theme.sh
chmod +x add-qortal-icons-theme.sh
./add-qortal-icons-theme.sh
cd "${HOME}"
@ -244,7 +255,7 @@ echo "${YELLOW} SETTING CRONTAB TASKS ${NC}\n"
} > rebuilt-machine-cron
crontab rebuilt-machine-cron
rm -f rebuilt-machine-cron configure-terminal-and-more.sh
rm -f rebuilt-machine-cron configure-terminal-and-more.sh add-qortal-icons-theme.sh cinnamon-settings.json
echo "${YELLOW} Refreshing Cinnamon Panel/Menu to apply changes ${NC}"
cinnamon --replace > /dev/null 2>&1 &

6
vm-tool-setup.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
sudo apt update
sudo apt -y upgrade
sudo apt install -y qemu-guest-agent util-linux haveged
sudo fstrim -av
sudo systemctl enable --now qemu-guest-agent