Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/wallpapers_example/86.mp4
Binary file not shown.
Binary file added assets/wallpapers_example/skyyy.mp4
Binary file not shown.
58 changes: 23 additions & 35 deletions config/settings_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,17 @@ def ensure_matugen_config():
with the expected settings.
"""
expected_config = {
"config": {
"reload_apps": True,
"wallpaper": {
"command": "swww",
"arguments": [
"img",
"-t",
"fade",
"--transition-duration",
"0.5",
"--transition-step",
"255",
"--transition-fps",
"60",
"-f",
"Nearest",
],
"set": True,
},
"custom_colors": {
"red": {"color": "#FF0000", "blend": True},
"green": {"color": "#00FF00", "blend": True},
"yellow": {"color": "#FFFF00", "blend": True},
"blue": {"color": "#0000FF", "blend": True},
"magenta": {"color": "#FF00FF", "blend": True},
"cyan": {"color": "#00FFFF", "blend": True},
"white": {"color": "#FFFFFF", "blend": True},
},
'config': {
'reload_apps': True,
'custom_colors': {
'red': {'color': "#FF0000", 'blend': True},
'green': {'color': "#00FF00", 'blend': True},
'yellow': {'color': "#FFFF00", 'blend': True},
'blue': {'color': "#0000FF", 'blend': True},
'magenta': {'color': "#FF00FF", 'blend': True},
'cyan': {'color': "#00FFFF", 'blend': True},
'white': {'color': "#FFFFFF", 'blend': True}
}
},
"templates": {
"hyprland": {
Expand All @@ -97,14 +80,13 @@ def ensure_matugen_config():
existing_config = toml.load(f)
shutil.copyfile(config_path, config_path + ".bak")
except toml.TomlDecodeError:
print(
f"Warning: Could not decode TOML from {config_path}. A new default config will be created."
)
existing_config = {} # Resetear si está corrupto
print(f"Warning: Could not decode TOML from {config_path}. A new default config will be created.")
existing_config = {} # Reset if corrupt
except Exception as e:
print(f"Error reading or backing up {config_path}: {e}")
# existing_config podría estar parcialmente cargado o vacío.
# Continuar para intentar fusionar con defaults.
# existing_config could be partially loaded or empty.
# Continue to try merging with defaults.


# Usamos una copia de existing_config para deep_update si no queremos modificarlo directamente
# o asegurarse que deep_update no lo haga si no es deseado.
Expand All @@ -116,18 +98,22 @@ def ensure_matugen_config():
existing_config, expected_config
) # existing_config se modifica in-place


try:
with open(config_path, "w") as f:
toml.dump(merged_config, f)
except Exception as e:
print(f"Error writing matugen config to {config_path}: {e}")


#generate the stuff only if any of these doesnt exist
current_wall = os.path.expanduser("~/.current.wall")
hypr_colors = os.path.expanduser(
f"~/.config/{APP_NAME_CAP}/config/hypr/colors.conf"
)
css_colors = os.path.expanduser(f"~/.config/{APP_NAME_CAP}/styles/colors.css")


if (
not os.path.exists(current_wall)
or not os.path.exists(hypr_colors)
Expand All @@ -143,10 +129,12 @@ def ensure_matugen_config():
)
if os.path.exists(example_wallpaper_path):
try:

# Si ya existe (posiblemente un enlace roto o archivo regular), eliminar y re-enlazar
if os.path.lexists(
current_wall
): # lexists para no seguir el enlace si es uno

os.remove(current_wall)
os.symlink(example_wallpaper_path, current_wall)
image_path = example_wallpaper_path
Expand All @@ -160,6 +148,7 @@ def ensure_matugen_config():
)

if image_path and os.path.exists(image_path):

print(f"Generating color theme from wallpaper: {image_path}")
try:
matugen_cmd = f"matugen image '{image_path}'"
Expand All @@ -178,7 +167,6 @@ def ensure_matugen_config():
f"Warning: Wallpaper at {image_path} not found. Cannot generate matugen theme."
)


def load_bind_vars():
"""
Load saved key binding variables from JSON, if available.
Expand Down
87 changes: 53 additions & 34 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/bash

set -e # Exit immediately if a command fails
set -u # Treat unset variables as errors
set -o pipefail # Prevent errors in a pipeline from being masked
set -e # Exit immediately if a command fails
set -u # Treat unset variables as errors
set -o pipefail # Prevent errors in a pipeline from being masked

REPO_URL="https://github.com/Axenide/Ax-Shell.git"
# --- CONFIGURATION ---
REPO_URL="https://github.com/xNovyz/Ax-Shell.git"
REPO_BRANCH="animated-wallpaper"
INSTALL_DIR="$HOME/.config/Ax-Shell"
# ----------------------

PACKAGES=(
brightnessctl
cava
Expand Down Expand Up @@ -48,76 +52,91 @@ PACKAGES=(
vte3
webp-pixbuf-loader
wl-clipboard
mpvpaper
)

# Prevent running as root
if [ "$(id -u)" -eq 0 ]; then
echo "Please do not run this script as root."
exit 1
echo "Please do not run this script as root."
exit 1
fi

# Detect AUR helper
aur_helper="yay"

# Check if paru exists, otherwise use yay
if command -v paru &>/dev/null; then
aur_helper="paru"
aur_helper="paru"
elif ! command -v yay &>/dev/null; then
echo "Installing yay-bin..."
tmpdir=$(mktemp -d)
git clone --depth=1 https://aur.archlinux.org/yay-bin.git "$tmpdir/yay-bin"
(cd "$tmpdir/yay-bin" && makepkg -si --noconfirm)
rm -rf "$tmpdir"
echo "Installing yay-bin..."
tmpdir=$(mktemp -d)
git clone --depth=1 https://aur.archlinux.org/yay-bin.git "$tmpdir/yay-bin"
(cd "$tmpdir/yay-bin" && makepkg -si --noconfirm)
rm -rf "$tmpdir"
fi

# Clean if repo exists but is invalid or points to the wrong origin
if git -C "$INSTALL_DIR" rev-parse --is-inside-work-tree &>/dev/null; then
CURRENT_REMOTE=$(git -C "$INSTALL_DIR" remote get-url origin || echo "")
if [ "$CURRENT_REMOTE" != "$REPO_URL" ]; then
echo "Removing old repository from $INSTALL_DIR..."
rm -rf "$INSTALL_DIR"
fi
elif [ -d "$INSTALL_DIR" ]; then
echo "$INSTALL_DIR exists but is not a valid git repository. Removing it..."
rm -rf "$INSTALL_DIR"
fi


# Clone or update the repository
if [ -d "$INSTALL_DIR" ]; then
echo "Updating Ax-Shell..."
git -C "$INSTALL_DIR" pull
echo "Updating Ax-Shell..."
git -C "$INSTALL_DIR" pull
git -C "$INSTALL_DIR" checkout "$REPO_BRANCH"
else
echo "Cloning Ax-Shell..."
git clone --depth=1 "$REPO_URL" "$INSTALL_DIR"
echo "Cloning Ax-Shell from $REPO_URL..."
git clone --depth=1 --branch "$REPO_BRANCH" "$REPO_URL" "$INSTALL_DIR"
fi

# Install required packages using the detected AUR helper (only if missing)
# Install required packages
echo "Installing required packages..."
$aur_helper -Syy --needed --devel --noconfirm "${PACKAGES[@]}" || true

echo "Installing gray-git..."
yes | $aur_helper -Syy --needed --devel --noconfirm gray-git || true

# Install fonts
echo "Installing required fonts..."

FONT_URL="https://github.com/zed-industries/zed-fonts/releases/download/1.2.0/zed-sans-1.2.0.zip"
FONT_DIR="$HOME/.fonts/zed-sans"
TEMP_ZIP="/tmp/zed-sans-1.2.0.zip"

# Check if fonts are already installed
if [ ! -d "$FONT_DIR" ]; then
echo "Downloading fonts from $FONT_URL..."
curl -L -o "$TEMP_ZIP" "$FONT_URL"
echo "Downloading fonts from $FONT_URL..."
curl -L -o "$TEMP_ZIP" "$FONT_URL"

echo "Extracting fonts to $FONT_DIR..."
mkdir -p "$FONT_DIR"
unzip -o "$TEMP_ZIP" -d "$FONT_DIR"
echo "Extracting fonts to $FONT_DIR..."
mkdir -p "$FONT_DIR"
unzip -o "$TEMP_ZIP" -d "$FONT_DIR"

echo "Cleaning up..."
rm "$TEMP_ZIP"
echo "Cleaning up..."
rm "$TEMP_ZIP"
else
echo "Fonts are already installed. Skipping download and extraction."
echo "Fonts are already installed. Skipping download and extraction."
fi

# Copy local fonts if not already present
if [ ! -d "$HOME/.fonts/tabler-icons" ]; then
echo "Copying local fonts to $HOME/.fonts/tabler-icons..."
mkdir -p "$HOME/.fonts/tabler-icons"
cp -r "$INSTALL_DIR/assets/fonts/"* "$HOME/.fonts"
echo "Copying local fonts to $HOME/.fonts/tabler-icons..."
mkdir -p "$HOME/.fonts/tabler-icons"
cp -r "$INSTALL_DIR/assets/fonts/"* "$HOME/.fonts"
else
echo "Local fonts are already installed. Skipping copy."
echo "Local fonts are already installed. Skipping copy."
fi

# Start Ax-Shell
python "$INSTALL_DIR/config/config.py"
echo "Starting Ax-Shell..."
killall ax-shell 2>/dev/null || true
uwsm app -- python "$INSTALL_DIR/main.py" > /dev/null 2>&1 & disown
uwsm app -- python "$INSTALL_DIR/main.py" >/dev/null 2>&1 &
disown

echo "Installation complete."
Loading