Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Pane {
id: root

height: config.ScreenHeight || Screen.height
width: config.ScreenWidth || Screen.ScreenWidth
width: config.ScreenWidth || Screen.width
padding: config.ScreenPadding

LayoutMirroring.enabled: config.RightToLeftLayout == "true" ? true : Qt.application.layoutDirection === Qt.RightToLeft
Expand Down Expand Up @@ -227,14 +227,15 @@ Pane {
Image.AlignBottom : Image.AlignVCenter

speed: config.BackgroundSpeed == "" ? 1.0 : config.BackgroundSpeed
paused: config.PauseBackground == "true" ? 1 : 0
paused: config.PauseBackground == "true"
fillMode: config.CropBackground == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit
asynchronous: true
cache: true
clip: true
mipmap: true

Component.onCompleted:{
if (!config.Background) return
var fileType = config.Background.substring(config.Background.lastIndexOf(".") + 1)
const videoFileTypes = ["avi", "mp4", "mov", "mkv", "m4v", "webm"];
if (videoFileTypes.includes(fileType)) {
Expand All @@ -243,7 +244,7 @@ Pane {
player.play();
}
else{
backgroundImage.source = config.background || config.Background
backgroundImage.source = config.Background
}
}
}
Expand Down
43 changes: 32 additions & 11 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,35 +119,52 @@ install_deps() {

# Clone repository
clone_repo() {
[[ -d "$PATH_TO_GIT_CLONE" ]] && mv "$PATH_TO_GIT_CLONE" "${PATH_TO_GIT_CLONE}_$DATE"
[[ -d "$PATH_TO_GIT_CLONE" ]] && rm -rf "$PATH_TO_GIT_CLONE"
spin "Cloning repository..." git clone -b master --depth 1 "$THEME_REPO" "$PATH_TO_GIT_CLONE"
info "Repository cloned to $PATH_TO_GIT_CLONE"
}

# Install theme
install_theme() {
local src="$HOME/$THEME_NAME"
local src="${1:-$HOME/$THEME_NAME}"
local dst="$THEMES_DIR/$THEME_NAME"

[[ ! -d "$src" ]] && { error "Clone repository first"; return 1;}
[[ ! -d "$src" ]] && { error "Source directory not found: $src"; return 1;}

# Backup and copy
[[ -d "$dst" ]] && sudo mv "$dst" "${dst}_$DATE"
# Remove existing install and copy fresh
[[ -d "$dst" ]] && sudo rm -rf "$dst"
sudo mkdir -p "$dst"
spin "Installing theme files..." sudo cp -r "$src"/* "$dst"/

# Install fonts
[[ -d "$dst/Fonts" ]] && spin "Installing fonts..." sudo cp -r "$dst/Fonts"/* /usr/share/fonts/

# Configure SDDM
echo "[Theme]
Current=$THEME_NAME" | sudo tee /etc/sddm.conf >/dev/null
printf '[Theme]\nCurrent=%s\n' "$THEME_NAME" | sudo tee /etc/sddm.conf >/dev/null

sudo mkdir -p /etc/sddm.conf.d
echo "[General]
InputMethod=qtvirtualkeyboard" | sudo tee /etc/sddm.conf.d/virtualkbd.conf >/dev/null
printf '[General]\nInputMethod=qtvirtualkeyboard\n' | sudo tee /etc/sddm.conf.d/virtualkbd.conf >/dev/null

info "Theme installed"
info "Available themes:"
for theme in "${THEMES[@]}"; do
echo " - $theme"
done
}

# Install from local repo (no clone needed)
install_local() {
local script_dir
script_dir="$(dirname "$(realpath "$0")")"
install_theme "$script_dir"
info "Installed from local files: $script_dir"
}

# Remove the git clone staging folder from $HOME
cleanup_clone() {
[[ ! -d "$PATH_TO_GIT_CLONE" ]] && { warn "No clone found at $PATH_TO_GIT_CLONE"; return; }
rm -rf "$PATH_TO_GIT_CLONE"
info "Removed $PATH_TO_GIT_CLONE"
}

# Select theme variant
Expand All @@ -172,7 +189,7 @@ enable_sddm() {
preview_theme(){
local log_file="/tmp/${THEME_NAME}_$DATE.txt"

sddm-greeter-qt6 --test-mode --theme /usr/share/sddm/themes/sddm-astronaut-theme/ > $log_file 2>&1 &
sddm-greeter-qt6 --test-mode --theme $THEMES_DIR/$THEME_NAME > $log_file 2>&1 &
greeter_pid=$!

# wait for ten seconds
Expand All @@ -188,7 +205,7 @@ preview_theme(){
fi


local theme="$(sed -n 's|^ConfigFile=Themes/\(.*\)\.conf|\1|p' $METADATA)"
local theme="$(sed -n 's|^ConfigFile=Themes/\(.*\)\.conf|\1|p' "$METADATA")"
info "Preview closed ($theme theme found)."
info "Log file: $log_file"
}
Expand All @@ -212,19 +229,23 @@ main() {
"📦 Install Dependencies" \
"📥 Clone Repository" \
"📂 Install Theme" \
"🔄 Install Local Theme" \
"🔧 Enable SDDM Service" \
"🎨 Select Theme Variant" \
"✨ Preview the set theme" \
"🗑️ Clean Up Clone" \
"❌ Exit")

case "$choice" in
"🚀 Complete Installation (recommended)") install_deps && clone_repo && install_theme && select_theme && enable_sddm && info "Everything done!" && exit 0;;
"📦 Install Dependencies") install_deps ;;
"📥 Clone Repository") clone_repo ;;
"📂 Install Theme") install_theme ;;
"🔄 Install Local Theme") install_local ;;
"🔧 Enable SDDM Service") enable_sddm ;;
"🎨 Select Theme Variant") select_theme ;;
"✨ Preview the set theme") preview_theme;;
"🗑️ Clean Up Clone") cleanup_clone ;;
"❌ Exit") info "Goodbye!"; exit 0 ;;
esac

Expand Down