File: port_plasma_kirigami.sh

package info (click to toggle)
kde-dev-scripts 4%3A25.04.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,612 kB
  • sloc: perl: 15,615; lisp: 5,627; sh: 4,560; python: 3,892; ruby: 1,386; makefile: 13; sed: 9
file content (54 lines) | stat: -rwxr-xr-x 2,792 bytes parent folder | download
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
#!/bin/sh
# Copyright Laurent Montel <montel@kde.org> 2023
git grep -l "PlasmaCore.Theme.smallestFont" | xargs perl -pi -e 's,PlasmaCore.Theme.smallestFont,Kirigami.Theme.smallFont,g'
git grep -l "PlasmaCore.Theme.NormalColorGroup" | xargs perl -pi -e 's,PlasmaCore.Theme.NormalColorGroup,Kirigami.Theme.Window,g'
git grep -l "PlasmaCore.ColorScope.colorGroup" | xargs perl -pi -e 's,PlasmaCore.ColorScope.colorGroup,Kirigami.Theme.colorSet,g'
git grep -l "PlasmaCore.ColorScope.inherit" | xargs perl -pi -e 's,PlasmaCore.ColorScope.inherit,Kirigami.Theme.inherit,g'
git grep -l "PlasmaCore.Units.largeSpacing" | xargs perl -pi -e 's,PlasmaCore.Units.largeSpacing,Kirigami.Units.gridUnit,g'
git grep -l "PlasmaCore.Units.roundToIconSize" | xargs perl -pi -e 's,PlasmaCore.Units.roundToIconSize,Kirigami.Units.iconSizes.roundedIconSize,g'
git grep -l "height: PlasmaCore.Units.roundToIconSize" | xargs perl -pi -e 's,height: PlasmaCore.Units.roundToIconSize\(.*\),height: Kirigami.Units.iconSizes.sizeForLabels,g'
git grep -l "PlasmaCore.Units.devicePixelRatio" | xargs perl -pi -e 's,PlasmaCore.Units.devicePixelRatio,1,g'
git grep -l "PlasmaCore.Units." | xargs perl -pi -e 's,PlasmaCore.Units.,Kirigami.Units.,g'
git grep -l "PlasmaCore.ColorScope.inherit" | xargs perl -pi -e 's,PlasmaCore.ColorScope.inherit,Kirigami.Theme.inherit,g'
git grep -l "PlasmaCore.Theme." | xargs perl -pi -e 's,PlasmaCore.Theme.,Kirigami.Theme.,g'



# Add import org.kde.kirigami 2.20 as Kirigami

list_import=`git grep -l "as PlasmaCore"`;
echo " list file which has import PlasmaCore $list_import";
for i in $list_import; do
        echo "list2222222:::: $i";
        number=`grep 'mport org.kde.kirigami 2.20 as Kirigami' $i|wc -l`;
        echo $number;
        if test $number == 0 ; then
               echo "insert import org.kde.kirigami 2.20 as Kirigam in $i";
              perl -pi -e 's,as PlasmaCore,as PlasmaCore\nimport org.kde.kirigami 2.20 as Kirigami,' $i;
        fi
done;


#git grep -l "as PlasmaCore" | xargs perl -pi -e 's,as PlasmaCore,as PlasmaCore\nimport org.kde.kirigami 2.20 as Kirigami,'
list_PlasmaKirigami_file=`git grep -l kirigami`;
echo " list file which has kirigami: $list_PlasmaKirigami_file";
for i in $list_PlasmaKirigami_file; do
        echo "list:::: $i";
        number=`grep Kirigami $i|wc -l`;
        echo $number;
        if test $number == 1 ; then
              perl -pi -e 's,import org.kde.kirigami 2.20 as Kirigami\n,,' $i;
        fi
done;


# Remove import org.kde.plasma.core 2.0 as PlasmaCore if we don't need it
list_PlasmaCore_file=`git grep -l PlasmaCore`;
for i in $list_PlasmaCore_file; do 
	echo $i;
	number=`grep PlasmaCore $i|wc -l`;
	if test $number = 1 ; then
		perl -pi -e 's,import org.kde.plasma.core 2.0 as PlasmaCore\n,,' $i;
	fi
done;