mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-06-11 00:47:22 +00:00
159 lines
6.6 KiB
Bash
159 lines
6.6 KiB
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
# SPDX-FileCopyrightText: 2026 Marco Allegretti
|
||
|
|
# SPDX-License-Identifier: EUPL-1.2
|
||
|
|
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||
|
|
cd "$repo_dir"
|
||
|
|
|
||
|
|
fail() {
|
||
|
|
printf '%s\n' "$1" >&2
|
||
|
|
exit 1
|
||
|
|
}
|
||
|
|
|
||
|
|
require_line() {
|
||
|
|
local file="$1"
|
||
|
|
local pattern="$2"
|
||
|
|
local message="$3"
|
||
|
|
|
||
|
|
grep -Eq "$pattern" "$file" || fail "$message"
|
||
|
|
}
|
||
|
|
|
||
|
|
reject_line() {
|
||
|
|
local file="$1"
|
||
|
|
local pattern="$2"
|
||
|
|
local message="$3"
|
||
|
|
|
||
|
|
! grep -Eq "$pattern" "$file" || fail "$message"
|
||
|
|
}
|
||
|
|
|
||
|
|
require_line CMakeLists.txt '^add_subdirectory\(cursors\)$' \
|
||
|
|
"top-level build must install the Shift cursor theme"
|
||
|
|
require_line CMakeLists.txt '^add_subdirectory\(desktoptheme\)$' \
|
||
|
|
"top-level build must install the Shift Plasma desktop themes"
|
||
|
|
|
||
|
|
require_line lookandfeel/metadata.json '"Id": "org\.shift\.mobile"' \
|
||
|
|
"look-and-feel id must remain org.shift.mobile"
|
||
|
|
require_line lookandfeel/metadata.json '"Name": "SHIFT"' \
|
||
|
|
"look-and-feel visible name must be SHIFT"
|
||
|
|
|
||
|
|
require_line color-schemes/ShiftDark.colors '^ColorScheme=ShiftDark$' \
|
||
|
|
"dark color scheme id must remain ShiftDark"
|
||
|
|
require_line color-schemes/ShiftDark.colors '^Name=SHIFT Dark$' \
|
||
|
|
"dark color scheme visible name must be SHIFT Dark"
|
||
|
|
require_line color-schemes/ShiftLight.colors '^ColorScheme=ShiftLight$' \
|
||
|
|
"light color scheme id must remain ShiftLight"
|
||
|
|
require_line color-schemes/ShiftLight.colors '^Name=SHIFT Light$' \
|
||
|
|
"light color scheme visible name must be SHIFT Light"
|
||
|
|
|
||
|
|
require_line icons/org.shift.icons/index.theme '^Name=SHIFT$' \
|
||
|
|
"icon theme visible name must be SHIFT"
|
||
|
|
require_line kwin/decorations/org.shift.decoration/metadata.json '"Name": "SHIFT"' \
|
||
|
|
"window decoration visible name must be SHIFT"
|
||
|
|
require_line wallpapers/SHIFT/metadata.json '"Name": "SHIFT"' \
|
||
|
|
"wallpaper visible name must be SHIFT"
|
||
|
|
|
||
|
|
require_line desktoptheme/shift-dark/metadata.json '"Id": "shift-dark"' \
|
||
|
|
"dark Plasma desktop theme id must be shift-dark"
|
||
|
|
require_line desktoptheme/shift-dark/metadata.json '"Name": "SHIFT Dark"' \
|
||
|
|
"dark Plasma desktop theme visible name must be SHIFT Dark"
|
||
|
|
require_line desktoptheme/shift-light/metadata.json '"Id": "shift-light"' \
|
||
|
|
"light Plasma desktop theme id must be shift-light"
|
||
|
|
require_line desktoptheme/shift-light/metadata.json '"Name": "SHIFT Light"' \
|
||
|
|
"light Plasma desktop theme visible name must be SHIFT Light"
|
||
|
|
require_line cursors/shift-cursors/index.theme '^Name=SHIFT$' \
|
||
|
|
"cursor theme visible name must be SHIFT"
|
||
|
|
|
||
|
|
require_line lookandfeel/contents/defaults '^ColorScheme=ShiftDark$' \
|
||
|
|
"look-and-feel defaults must select ShiftDark"
|
||
|
|
require_line lookandfeel/contents/defaults '^Theme=org\.shift\.icons$' \
|
||
|
|
"look-and-feel defaults must select org.shift.icons"
|
||
|
|
require_line lookandfeel/contents/defaults '^cursorTheme=shift-cursors$' \
|
||
|
|
"look-and-feel defaults must select shift-cursors"
|
||
|
|
require_line lookandfeel/contents/defaults '^name=shift-dark$' \
|
||
|
|
"look-and-feel defaults must select the Shift dark Plasma desktop theme"
|
||
|
|
require_line lookandfeel/contents/defaults '^theme=org\.shift\.decoration$' \
|
||
|
|
"look-and-feel defaults must select org.shift.decoration"
|
||
|
|
reject_line lookandfeel/contents/defaults 'breeze-dark|breeze-light|breeze_cursors|org\.kde\.Breeze' \
|
||
|
|
"look-and-feel defaults must not select Breeze desktop, cursor, or splash themes"
|
||
|
|
|
||
|
|
[[ -f lookandfeel/contents/splash/Splash.qml ]] || fail "look-and-feel must provide a Shift splash implementation"
|
||
|
|
reject_line lookandfeel/contents/logout/Logout.qml 'plasma_lookandfeel_org\.kde\.lookandfeel' \
|
||
|
|
"look-and-feel QML must use the Shift translation domain"
|
||
|
|
require_line lookandfeel/contents/logout/Logout.qml 'plasma_lookandfeel_org\.shift\.mobile' \
|
||
|
|
"look-and-feel logout QML must use plasma_lookandfeel_org.shift.mobile"
|
||
|
|
require_line lookandfeel/Messages.sh 'plasma_lookandfeel_org\.shift\.mobile\.pot' \
|
||
|
|
"look-and-feel Messages.sh must generate the Shift translation domain"
|
||
|
|
|
||
|
|
while IFS= read -r po_file; do
|
||
|
|
[[ "$po_file" == *'/plasma_lookandfeel_org.shift.mobile.po' ]] \
|
||
|
|
|| fail "look-and-feel translation file must use the Shift domain: $po_file"
|
||
|
|
require_line "$po_file" 'Project-Id-Version: plasma_lookandfeel_org\.shift\.mobile' \
|
||
|
|
"$po_file header must use the Shift translation domain"
|
||
|
|
done < <(find po -path '*/plasma_lookandfeel_*.po' -print | sort)
|
||
|
|
|
||
|
|
require_line preview.sh 'PLASMA_THEME=shift-light' \
|
||
|
|
"preview light mode must select the Shift light Plasma desktop theme"
|
||
|
|
require_line preview.sh 'PLASMA_THEME=shift-dark' \
|
||
|
|
"preview dark mode must select the Shift dark Plasma desktop theme"
|
||
|
|
reject_line preview.sh 'PLASMA_THEME=breeze-' \
|
||
|
|
"preview must not select Breeze Plasma desktop themes"
|
||
|
|
|
||
|
|
generic_attribution_pattern='Shift contributor[s]|SHIFT Contributor[s]'
|
||
|
|
|
||
|
|
if grep -RInE "$generic_attribution_pattern" \
|
||
|
|
.reuse \
|
||
|
|
color-schemes/CMakeLists.txt \
|
||
|
|
cursors \
|
||
|
|
desktoptheme \
|
||
|
|
fonts/CMakeLists.txt \
|
||
|
|
fonts/README.md \
|
||
|
|
icons/sc-places-start-here-shift.svg \
|
||
|
|
kwin/decorations/org.shift.decoration/metadata.json \
|
||
|
|
lookandfeel/contents/splash \
|
||
|
|
lookandfeel/metadata.json \
|
||
|
|
org.shift.mobile.metainfo.xml \
|
||
|
|
shell/metadata.json \
|
||
|
|
tests/check-shift-theme-identity.sh >/dev/null; then
|
||
|
|
fail "Shift-owned theme identity files must not use generic Shift contributor attribution"
|
||
|
|
fi
|
||
|
|
|
||
|
|
for license_file in \
|
||
|
|
color-schemes/CMakeLists.txt \
|
||
|
|
cursors/CMakeLists.txt \
|
||
|
|
desktoptheme/CMakeLists.txt \
|
||
|
|
desktoptheme/shift-dark/plasmarc \
|
||
|
|
desktoptheme/shift-light/plasmarc \
|
||
|
|
fonts/CMakeLists.txt \
|
||
|
|
fonts/README.md \
|
||
|
|
icons/sc-places-start-here-shift.svg \
|
||
|
|
lookandfeel/contents/splash/Splash.qml \
|
||
|
|
tests/check-shift-theme-identity.sh; do
|
||
|
|
require_line "$license_file" 'SPDX-FileCopyrightText: 2026 Marco Allegretti' \
|
||
|
|
"$license_file must attribute Shift-owned work to Marco Allegretti"
|
||
|
|
require_line "$license_file" 'SPDX-License-Identifier: EUPL-1\.2' \
|
||
|
|
"$license_file must use EUPL-1.2"
|
||
|
|
done
|
||
|
|
|
||
|
|
for metadata_file in \
|
||
|
|
desktoptheme/shift-dark/metadata.json \
|
||
|
|
desktoptheme/shift-light/metadata.json \
|
||
|
|
kwin/decorations/org.shift.decoration/metadata.json; do
|
||
|
|
require_line "$metadata_file" '"Name": "Marco Allegretti"' \
|
||
|
|
"$metadata_file must attribute Shift-owned metadata to Marco Allegretti"
|
||
|
|
require_line "$metadata_file" '"License": "EUPL-1\.2"' \
|
||
|
|
"$metadata_file must use EUPL-1.2"
|
||
|
|
done
|
||
|
|
|
||
|
|
for author_file in \
|
||
|
|
lookandfeel/metadata.json \
|
||
|
|
shell/metadata.json \
|
||
|
|
org.shift.mobile.metainfo.xml; do
|
||
|
|
require_line "$author_file" 'Marco Allegretti' \
|
||
|
|
"$author_file must not use generic Shift contributor attribution"
|
||
|
|
done
|
||
|
|
|
||
|
|
result='shift-theme-identity-ok'
|
||
|
|
printf '%s\n' "$result"
|