-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-package.sh
More file actions
executable file
·83 lines (70 loc) · 2.23 KB
/
create-package.sh
File metadata and controls
executable file
·83 lines (70 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
# Create .plasmoid package for ActionPad
echo "=========================================="
echo " Creating ActionPad Package"
echo "=========================================="
echo ""
PACKAGE_NAME="actionpad"
VERSION="1.0.0"
BUILD_DIR="build"
PACKAGE_DIR="package"
OUTPUT_FILE="${PACKAGE_NAME}-${VERSION}.plasmoid"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if package directory exists
if [ ! -d "$PACKAGE_DIR" ]; then
echo -e "${RED}ERROR: Package directory not found!${NC}"
echo "Expected: $PACKAGE_DIR"
exit 1
fi
# Verify required files exist
echo "Verifying package contents..."
REQUIRED_FILES=(
"$PACKAGE_DIR/metadata.json"
"$PACKAGE_DIR/contents/ui/main.qml"
"$PACKAGE_DIR/contents/ui/configGeneral.qml"
"$PACKAGE_DIR/contents/config/main.xml"
"$PACKAGE_DIR/contents/config/config.qml"
)
for file in "${REQUIRED_FILES[@]}"; do
if [ ! -f "$file" ]; then
echo -e "${RED}ERROR: Required file missing: $file${NC}"
exit 1
fi
echo -e "${GREEN}✓${NC} $file"
done
echo ""
echo "Creating .plasmoid package..."
# Create the plasmoid package (it's just a zip file with .plasmoid extension)
cd "$PACKAGE_DIR" || exit 1
zip -r "../$OUTPUT_FILE" . -x "*.git*" -x "*~" -x "*.swp"
cd ..
if [ $? -eq 0 ]; then
echo ""
echo -e "${GREEN}SUCCESS!${NC} Package created: $OUTPUT_FILE"
echo ""
# Show package info
echo "Package Information:"
echo " File: $OUTPUT_FILE"
echo " Size: $(du -h "$OUTPUT_FILE" | cut -f1)"
echo ""
# Show contents
echo "Package contents:"
unzip -l "$OUTPUT_FILE" | tail -n +4 | head -n -2
echo ""
echo -e "${YELLOW}Note:${NC} This package only includes the QML widget."
echo "The C++ plugin must be built and installed separately using:"
echo " ./build-and-install.sh"
echo ""
echo "Installation options:"
echo " 1. System-wide: kpackagetool6 -t Plasma/Applet -i $OUTPUT_FILE"
echo " 2. User-only: kpackagetool6 -t Plasma/Applet -g -i $OUTPUT_FILE"
echo " 3. GUI: Right-click panel → Add Widgets → Install Widget From Local File"
echo ""
else
echo -e "${RED}ERROR: Failed to create package!${NC}"
exit 1
fi