Add Ricing/Dracula for GTK/install.sh

This commit is contained in:
Gabe committed 2026-10-22 01:46:17 +00:00
1 parent 96d2fa5e61
commit dda97601d5
1 file changed
+62
+62
View File
@@ -0,0 +1,62 @@
#!/bin/sh
# install-dracula.sh - install the Dracula GTK theme (and optionally icons) for the current user.
# Run as your normal user, from a terminal inside the desktop session.
set -e
[ "$(id -u)" -ne 0 ] || { echo "Run this as your normal user, not root."; exit 1; }
command -v curl >/dev/null 2>&1 || sudo apt install -y curl
command -v unzip >/dev/null 2>&1 || sudo apt install -y unzip
WORKDIR=$(mktemp -d)
trap 'rm -rf "$WORKDIR"' EXIT
THEME_DIR="$HOME/.themes/Dracula"
ICON_DIR="$HOME/.icons"
# ---------- theme ----------
echo "Downloading Dracula GTK theme..."
curl -fsSL "https://github.com/dracula/gtk/archive/refs/heads/master.tar.gz" -o "$WORKDIR/dracula-gtk.tar.gz"
rm -rf "$THEME_DIR"
mkdir -p "$THEME_DIR"
# The archive unpacks to gtk-master/; strip that level so the folder is named "Dracula"
tar xzf "$WORKDIR/dracula-gtk.tar.gz" -C "$THEME_DIR" --strip-components=1
echo "Installed theme to $THEME_DIR"
# ---------- icons (optional) ----------
ICONS=0
printf "Also install the Dracula icon theme? [y/N]: "
read -r answer || answer=""
case "$answer" in
y|Y|yes|YES)
curl -fsSL "https://github.com/dracula/gtk/files/5214870/Dracula.zip" -o "$WORKDIR/Dracula-icons.zip"
mkdir -p "$ICON_DIR"
unzip -qo "$WORKDIR/Dracula-icons.zip" -d "$ICON_DIR"
ICONS=1
echo "Installed icons to $ICON_DIR"
;;
esac
# ---------- activate (optional) ----------
printf "Activate Dracula now? [y/N]: "
read -r answer || answer=""
case "$answer" in
y|Y|yes|YES)
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
echo "No desktop session found; run the activation from a terminal inside the desktop."
exit 1
fi
gsettings set org.cinnamon.desktop.interface gtk-theme "Dracula"
gsettings set org.cinnamon.desktop.wm.preferences theme "Dracula"
gsettings set org.cinnamon.theme name "Dracula"
if [ "$ICONS" -eq 1 ]; then
gsettings set org.cinnamon.desktop.interface icon-theme "Dracula"
fi
echo "Activated. If anything looks half-applied, press Ctrl+Alt+Esc to restart Cinnamon."
;;
*)
echo "Not activated. Pick it in Menu → Themes, or re-run and answer y."
;;
esac