Skip to content

Commit

Permalink
Merge pull request #58 from Sourcastic/dev
Browse files Browse the repository at this point in the history
Feat: Port splashcreen to KDE6, Remove lightly in favour of default breeze
  • Loading branch information
Sourcastic authored Mar 12, 2024
2 parents 0352cee + 6cb451b commit 4495a06
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 104 deletions.
38 changes: 21 additions & 17 deletions Installer/color-build.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
#!/bin/sh -eu
#!/bin/sh

# From github.com/skinatro/theme-tool

help() {
cat <<EOF
cat <<EOF
Usage: ${0##*/} -o <output> -s <source>
Usage: ${0##*/} -o <output> -s <source> -f <flavour>
-o <path> Output directory
-s <path> Source file
-f <flavour> Flavour name (Mocha, Macchiato, Frappe, Latte)
EOF
exit 1 # Exit script after printing help
exit 1 # Exit script after printing help
}

while getopts o:s: opt; do
case "$opt" in
o) OUT="$OPTARG" ;;
s) SOURCE="$OPTARG" ;;
?) help ;; # Print help in case parameter is non-existent
esac
while getopts o:s:f: opt; do
case "$opt" in
o) OUT="$OPTARG" ;;
s) SOURCE="$OPTARG" ;;
f) FLAVOURNAME="$OPTARG" ;; # New case for -f
?) help ;;
esac
done

# Print help in case parameters are empty
if [ -z "$OUT" ] || [ -z "$SOURCE" ]; then
echo "Some or all of the parameters are empty"
help
if [ -z "$OUT" ] || [ -z "$SOURCE" ] || [ -z "$FLAVOURNAME" ]; then
echo "Some or all of the parameters are empty"
help
fi

# no arrays due to posix compliancy
if echo "$FLAVOURNAME" | grep -Evq 'Mocha|Macchiato|Frappe|Latte'; then
clear
echo "Invalid palette $FLAVOURNAME"
exit
clear
echo "Invalid palette $FLAVOURNAME"
exit
fi
sed -f Installer/Pallets/"$FLAVOURNAME".sed "$SOURCE" > "$OUT"

FLAVOUR_SED="Installer/Pallets/${FLAVOURNAME}.sed"
sed -f "$FLAVOUR_SED" "$SOURCE" > "$OUT"
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,14 @@


## Notes
1. To get a modern, more consistent look, install the [Lightly application style](https://github.com/Luwx/Lightly) and select it from System Settings > Appearance > Application Style > Lightly.
2. If you encounter an error similar to 'connection refused' while running the installation script, it may be due to store.kde.org being down or issues with your internet connection.
If you encounter an error similar to 'connection refused' while running the installation script, it may be due to store.kde.org being down or issues with your internet connection.

## Licensing
The theme makes modifications to [doncsugar's](https://github.com/doncsugar) [lightly plasma style](https://github.com/doncsugar/lightly-plasma). It is licensed under GPL 3.0 and as such, all the changes to the plasma theme are also licensed under GPL. The MIT License still applies to the color scheme, splash screen and the window decorations theme.

## 💝 Current Maintainer
- [Sourcastic](https://github.com/Sourcastic)

## 💝 Thanks to

## 💖 Past Maintainers
- [Prayag2](https://github.com/Prayag2)
- [Sourcastic](https://github.com/Sourcastic)
- [Cequallium](https://github.com/Cequallium)
- [justTOBBI](https://github.com/justTOBBI)



&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion Resources/LookAndFeel/defaults
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ library=org.kde.kwin.aurorae
theme=--aurorae

[plasmarc][Theme]
name=lightly-plasma-git
name=default

[KSplash]
Theme=Catppuccin---flavour---accentName-splash
2 changes: 1 addition & 1 deletion Resources/LookAndFeel/metadata.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ X-KDE-PluginInfo-Name=Catppuccin---flavour---accentName
X-KDE-PluginInfo-Version=0.2.6
X-KDE-PluginInfo-Website=github.com/catppuccin/KDE
X-KDE-ServiceTypes=Plasma/LookAndFeel
X-KPackage-Dependencies=kns://plasma-themes.knsrc/api.kde-look.org/1879921,kns://aurorae.knsrc/api.kde-look.org/--StoreAuroraeNo
X-KPackage-Dependencies=kns://aurorae.knsrc/api.kde-look.org/--StoreAuroraeNo
1 change: 0 additions & 1 deletion Resources/LookAndFeel/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"Version": "0.2.6"
},
"X-KPackage-Dependencies": [
"kns://plasma-themes.knsrc/api.kde-look.org/1879921",
"kns://aurorae.knsrc/api.kde-look.org/--StoreAuroraeNo"
]
}
23 changes: 11 additions & 12 deletions Resources/splash-screen/contents/splash/Splash.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
SPDX-License-Identifier: MIT
*/

import Qt5Compat.GraphicalEffects 1.15
import QtQuick 2.5
import QtQuick.Window 2.2
import org.kde.plasma.core as PlasmaCore
import QtQuick
import org.kde.kirigami 2 as Kirigami

Rectangle {
id: root
Expand All @@ -33,7 +31,8 @@ Rectangle {
id: content
anchors.fill: parent
opacity: 0

//TODO: Figure out how to port DropShadow to KDE6, erase comment when ported.
/*
DropShadow {
anchors.fill: logo
horizontalOffset: 0
Expand All @@ -44,17 +43,17 @@ Rectangle {
source: logo
opacity: 0.1
}

*/
Image {
id: logo
//match SDDM/lockscreen avatar positioning
property real size: PlasmaCore.Units.gridUnit * 8
readonly property real size: Kirigami.Units.gridUnit * 8

anchors.centerIn: parent
source: "images/Logo.png"

sourceSize.width: size
sourceSize.height: size
sourceSize.height: sizes
smooth: true
visible: true
}
Expand All @@ -65,15 +64,15 @@ Rectangle {
y: parent.height - (parent.height - logo.y) / 2 - height/2
anchors.horizontalCenter: parent.horizontalCenter
source: "images/busywidget.svg"
sourceSize.height: PlasmaCore.Units.gridUnit * 3.5
sourceSize.width: PlasmaCore.Units.gridUnit * 3.5
sourceSize.height: Kirigami.Units.gridUnit * 3.5
sourceSize.width: Kirigami.Units.gridUnit * 3.5
RotationAnimator on rotation {
id: rotationAnimator
from: 0
to: 360
duration: 2000
loops: Animation.Infinite
running: PlasmaCore.Units.longDuration > 1
running: Kirigami.Units.longDuration > 1
}
}
}
Expand All @@ -84,7 +83,7 @@ Rectangle {
target: content
from: 0
to: 1
duration: PlasmaCore.Units.veryLongDuration * 2
duration: Kirigami.Units.veryLongDuration * 2
easing.type: Easing.InOutQuad
}
}
81 changes: 19 additions & 62 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Syntax <Flavour = 1-4 > <Accent = 1-14> <WindowDec = 1/2> <Debug = aurorae/global/color/splash/cursor>

check_command_exists() {
command_name="$@"
command_name="${*}"

if ! command -v "$command_name" &> /dev/null; then
if ! command -v "$command_name" >/dev/null 2>&1; then
echo "Error: Dependency '$command_name' is not met."
echo "Exiting.."
exit 1
Expand All @@ -20,11 +20,10 @@ check_command_exists "lookandfeeltool"
COLORDIR="${XDG_DATA_HOME:-$HOME/.local/share}/color-schemes"
AURORAEDIR="${XDG_DATA_HOME:-$HOME/.local/share}/aurorae/themes"
LOOKANDFEELDIR="${XDG_DATA_HOME:-$HOME/.local/share}/plasma/look-and-feel"
DESKTOPTHEMEDIR="${XDG_DATA_HOME:-$HOME/.local/share}/plasma/desktoptheme"
CURSORDIR="${XDG_DATA_HOME:-$HOME/.local/share}/icons"

echo "Creating theme directories.."
mkdir -p "$COLORDIR" "$AURORAEDIR" "$LOOKANDFEELDIR" "$DESKTOPTHEMEDIR" "$CURSORDIR"
mkdir -p "$COLORDIR" "$AURORAEDIR" "$LOOKANDFEELDIR" "$CURSORDIR"
mkdir ./dist

# Fast install
Expand Down Expand Up @@ -238,7 +237,7 @@ case "$WINDECSTYLE" in
1)
WINDECSTYLENAME=Modern
WINDECSTYLECODE=__aurorae__svg__Catppuccin"$FLAVOURNAME"-Modern

case "$FLAVOUR" in
1) StoreAuroraeNo="2135229" ;;
2) StoreAuroraeNo="2135227" ;;
Expand All @@ -259,7 +258,7 @@ EOF
2)
WINDECSTYLENAME=Classic
WINDECSTYLECODE=__aurorae__svg__Catppuccin"$FLAVOURNAME"-Classic

case "$FLAVOUR" in
1) StoreAuroraeNo="2135228" ;;
2) StoreAuroraeNo="2135226" ;;
Expand All @@ -275,29 +274,11 @@ EOF
*) echo "Not a valid Window decoration" ;;
esac

ModifyLightlyPlasma() {
rm -rf "$DESKTOPTHEMEDIR"/lightly-plasma-git/icons/*
rm -rf "$DESKTOPTHEMEDIR"/lightly-plasma-git/translucent
rm "$DESKTOPTHEMEDIR"/lightly-plasma-git/widgets/tabbar.svgz
rm "$DESKTOPTHEMEDIR"/lightly-plasma-git/dialogs/background.svgz

# Copy Patches
cp -rf "$DESKTOPTHEMEDIR"/lightly-plasma-git/solid/* "$DESKTOPTHEMEDIR"/lightly-plasma-git
cp -rf ./Patches/glowbar.svg "$DESKTOPTHEMEDIR"/lightly-plasma-git/widgets
cp -rf ./Patches/background.svg "$DESKTOPTHEMEDIR"/lightly-plasma-git/widgets
cp ./Patches/panel-background.svgz "$DESKTOPTHEMEDIR"/lightly-plasma-git/widgets

# Modify description to state that it has been modified by the KDE Catppuccin Installer
sed -i 's/A plasma style with close to the look of the newest Lightly./*MODIFIED BY CATPPUCCIN KDE INSTALLER* &/g' "$DESKTOPTHEMEDIR"/lightly-plasma-git/metadata.desktop
cp -f "$DESKTOPTHEMEDIR"/metadata.desktop "$DESKTOPTHEMEDIR"/lightly-plasma-git/metadata.desktop
rm "$DESKTOPTHEMEDIR"/metadata.desktop
}

BuildColorscheme() {
# Add Metadata & Replace Accent in colors file
sed "s/--accentColor/$ACCENTCOLOR/g; s/--flavour/$FLAVOURNAME/g; s/--accentName/$ACCENTNAME/g" ./Resources/Base.colors > ./dist/base.colors
# Hydrate Dummy colors according to Pallet
FLAVOURNAME="$FLAVOURNAME" ./Installer/color-build.sh -o ./dist/Catppuccin"$FLAVOURNAME$ACCENTNAME".colors -s ./dist/base.colors
./Installer/color-build.sh -f "$FLAVOURNAME" -o ./dist/Catppuccin"$FLAVOURNAME$ACCENTNAME".colors -s ./dist/base.colors
}

BuildSplashScreen() {
Expand All @@ -323,13 +304,13 @@ BuildSplashScreen() {
else
cp ./Resources/splash-screen/contents/splash/images/Latte_Logo.png ./dist/"$SPLASHSCREENNAME"/contents/splash/images/Logo.png
fi
sed "s/--accentName/$ACCENTNAME/g; s/--flavour/$FLAVOURNAME/g" ./Resources/splash-screen/metadata.desktop > ./dist/"$SPLASHSCREENNAME"/metadata.desktop
sed "s/--accentName/$ACCENTNAME/g; s/--flavour/$FLAVOURNAME/g" ./Resources/splash-screen/metadata.json > ./dist/"$SPLASHSCREENNAME"/metadata.json
cp ./dist/"$GLOBALTHEMENAME"/contents/defaults ./dist/"$SPLASHSCREENNAME"/contents/defaults
#sed "s/--accentName/$ACCENTNAME/g; s/--flavour/$FLAVOURNAME/g" ./Resources/splash-screen/metadata.desktop > ./dist/"$SPLASHSCREENNAME"/metadata.desktop
#sed "s/--accentName/$ACCENTNAME/g; s/--flavour/$FLAVOURNAME/g" ./Resources/splash-screen/metadata.json > ./dist/"$SPLASHSCREENNAME"/metadata.json
mkdir ./dist/"$SPLASHSCREENNAME"/contents/previews
cp ./Resources/splash-previews/"$FLAVOURNAME".png ./dist/"$SPLASHSCREENNAME"/contents/previews/splash.png
cp ./Resources/splash-previews/"$FLAVOURNAME".png ./dist/"$SPLASHSCREENNAME"/contents/previews/preview.png
cp -r ./dist/"$SPLASHSCREENNAME" "$LOOKANDFEELDIR"/
# cp ./Resources/splash-previews/"$FLAVOURNAME".png ./dist/"$SPLASHSCREENNAME"/contents/previews/preview.png
cp -r ./dist/"$SPLASHSCREENNAME"/contents/splash/ "$LOOKANDFEELDIR"/"$GLOBALTHEMENAME"/contents/
cp -r ./dist/"$SPLASHSCREENNAME"/contents/previews/* "$LOOKANDFEELDIR"/"$GLOBALTHEMENAME"/contents/previews/
}

InstallAuroraeTheme() {
Expand Down Expand Up @@ -357,9 +338,7 @@ InstallGlobalTheme() {
# Modify 'defaults' to set the correct Aurorae Theme
sed "s/--accentName/$ACCENTNAME/g; s/--flavour/$FLAVOURNAME/g; s/--aurorae/$WINDECSTYLECODE/g" ./Resources/LookAndFeel/defaults > ./dist/Catppuccin-"$FLAVOURNAME"-"$ACCENTNAME"/contents/defaults

# Build SplashScreen
echo "Building SplashScreen.."
BuildSplashScreen


# Install Global Theme.
# This refers to the QDBusConnection: error: could not send signal to service error
Expand All @@ -368,42 +347,20 @@ InstallGlobalTheme() {
cat <<EOF
WARNING: There might be some errors that might not affect the installer at all during this step, Please advise.
EOF
sleep 1
echo "Installing Global Theme.."
(
cd ./dist
cd ./dist || exit
tar -cf "$GLOBALTHEMENAME".tar.gz "$GLOBALTHEMENAME"
kpackagetool6 -i "$GLOBALTHEMENAME".tar.gz
cp -r $GLOBALTHEMENAME $LOOKANDFEELDIR
cp -r "$GLOBALTHEMENAME" "$LOOKANDFEELDIR"
)

if [ ! -d "$DESKTOPTHEMEDIR/lightly-plasma-git/" ]; then
clear
cat <<EOF
Installation failed, could not fetch the lightly plasma theme lightly-plasma-git from store.kde.org
Here are some things you can do to try fixing this:
1: Rerunning the install script
2: Check your intenet connection
3: See if https://store.kde.org is blocked
4: Manually installing Lightly-Plasma from https://pling.com/p/1879921/
Would you like to install Catppuccin/KDE without lightly plasma? [Y/n]:
EOF
read -r CONFIRMATION
if [ "$CONFIRMATION" = "N" ] || [ "$CONFIRMATION" = "n" ]; then
echo
echo "Exiting..."
exit
fi
echo
echo "Continuing without lightly plasma.."
else
echo "Modifying lightly plasma theme.."
ModifyLightlyPlasma
fi
# Build SplashScreen
echo "Building SplashScreen.."
BuildSplashScreen
}

InstallColorscheme() {
Expand All @@ -424,7 +381,7 @@ GetCursor() {
wget -q -P ./dist https://github.com/catppuccin/cursors/releases/download/v0.2.0/Catppuccin-"$FLAVOURNAME"-"$ACCENTNAME"-Cursors.zip
wget -q -P ./dist https://github.com/catppuccin/cursors/releases/download/v0.2.0/Catppuccin-"$FLAVOURNAME"-Dark-Cursors.zip
(
cd ./dist
cd ./dist || exit
unzip -q Catppuccin-"$FLAVOURNAME"-"$ACCENTNAME"-Cursors.zip
unzip -q Catppuccin-"$FLAVOURNAME"-Dark-Cursors.zip
)
Expand Down

0 comments on commit 4495a06

Please sign in to comment.