Subversion Repositories My Stuff

Rev

Rev 5 | Rev 7 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 6
Line 26... Line 26...
26
        PATH="/usr/share/icons/"       
26
        PATH="/usr/share/icons/"       
27
elif [ "${1}" = "local" ]; then
27
elif [ "${1}" = "local" ]; then
28
        PATH=`echo ~/.kde4/share/icons/`
28
        PATH=`echo ~/.kde4/share/icons/`
29
else
29
else
30
        echo
30
        echo
31
        echo "Usage ./kde-icon.sh local | global [theme_name]"
-
 
32
        echo "For example ./kde-icon.sh local OxygenRefit2-black-version"
-
 
-
 
31
        echo "Usage ./kde-icon.sh local | global [theme_name] [restore]"
-
 
32
        echo
-
 
33
        echo "Examples:"
-
 
34
        echo "If you want to change the icons just run:"
-
 
35
        echo "./kde-icon.sh local OxygenRefit2-black-version"
-
 
36
        echo
-
 
37
        echo "If you want to restore old icons run:"
-
 
38
        echo "./kde-icon.sh local OxygenRefit2-black-version restore"
33
        echo
39
        echo
34
        exit 1
40
        exit 1
35
fi
41
fi
36
42
37
if [ "${#}" -eq 1 ]; then
43
if [ "${#}" -eq 1 ]; then
Line 57... Line 63...
57
echo
63
echo
58
if [ -w ${PATH}${THEME} ]; then
64
if [ -w ${PATH}${THEME} ]; then
59
        echo "Your rights seems ok"
65
        echo "Your rights seems ok"
60
        echo
66
        echo
61
else
67
else
62
        echo "You do not have write access to the theme path you will not be able to change the icons"
-
 
-
 
68
        echo "You do not have write access to the theme path you will not be able to change the icons" 
63
        echo "Maybe you should run the script as root"
69
        echo "Maybe you should run the script as root"
64
        echo
70
        echo
65
        exit 1
71
        exit 1
66
fi
72
fi
67
73
68
echo "Downloading the logo icon"
-
 
69
echo
-
 
70
${WGET} --output-document=${ICON} ${URL} || die "downloading of the icon failed"
-
 
-
 
74
if [ "${3}" == "restore" ] ; then
-
 
75
        echo "You requested restoration of previously stored icons"
-
 
76
        echo
-
 
77
        echo "Checking if stored copies of old icons are available and performing restore if possible"
-
 
78
        for i in  "${RESOLUTION[@]}";
-
 
79
        do
-
 
80
                echo processing ${PATH}${THEME}/$i/places/start-here-kde.png
-
 
81
                if [ -w ${PATH}${THEME}/$i/places/start-here-kde.png.bak ]; then
-
 
82
                        if  [ -w ${PATH}${THEME}/$i/places/start-here-kde.svg ]; then
-
 
83
                                echo "Removing svg icon: ${PATH}${THEME}/$i/places/start-here-kde.svg"
-
 
84
                                ${RM} ${PATH}${THEME}/$i/places/start-here-kde.svg
-
 
85
                                echo
-
 
86
                        fi
-
 
87
                        echo "Restoring old icons"
-
 
88
                        ${MV} -f ${PATH}${THEME}/$i/places/start-here-kde.png.bak ${PATH}/${THEME}/$i/places/start-here-kde.png
-
 
89
                        echo
-
 
90
                else
-
 
91
                        echo "Can't find ${PATH}${THEME}/$i/places/start-here-kde.png.bak or you do not have write access to file"
-
 
92
                        echo
-
 
93
                fi
-
 
94
        done
-
 
95
        echo "Finished"
-
 
96
        echo "To see the changes you need to change the icon set using KDE system settings"
-
 
97
        echo
-
 
98
else
-
 
99
        echo "Downloading the logo icon"
-
 
100
        echo
-
 
101
        ${WGET} --output-document=${ICON} ${URL} || die "downloading of the icon failed"
71
102
72
echo "Making backup of existing icons"
-
 
73
echo
-
 
74
for i in  "${RESOLUTION[@]}";
-
 
75
do
-
 
76
        echo procesing ${PATH}${THEME}/$i/places/start-here-kde.png
-
 
77
        ${MV} ${PATH}${THEME}/$i/places/start-here-kde.png ${PATH}/${THEME}/$i/places/start-here-kde.png.bak
-
 
78
done
-
 
-
 
103
        echo "Making backup of existing icons"
-
 
104
        echo
-
 
105
        for i in  "${RESOLUTION[@]}";
-
 
106
        do
-
 
107
                echo processing ${PATH}${THEME}/$i/places/start-here-kde.png
-
 
108
                if [ -w ${PATH}${THEME}/$i/places/start-here-kde.png ]; then
-
 
109
                        if (${MV} -f ${PATH}${THEME}/$i/places/start-here-kde.png ${PATH}/${THEME}/$i/places/start-here-kde.png.bak) then
-
 
110
                                echo "Storing ${PATH}${THEME}/$i/places/start-here-kde.png as ${PATH}/${THEME}/$i/places/start-here-kde.png.bak succsesfull"
-
 
111
                                echo
-
 
112
                        else
-
 
113
                                echo "There was error while storing icon ${PATH}${THEME}/$i/places/start-here-kde.png"
-
 
114
                        fi
-
 
115
                else
-
 
116
                        echo "Icon ${PATH}${THEME}/$i/places/start-here-kde.png dosn't exist or you don't have the write access to it!"
-
 
117
                        echo "I have nothing to do here"
-
 
118
                        echo
-
 
119
                fi
-
 
120
        done
79
121
80
echo "Placing new Icon"
-
 
81
echo
-
 
82
for i in  "${RESOLUTION[@]}";
-
 
83
do
-
 
84
        echo procesing ${PATH}${THEME}/$i/places/start-here-kde.svg
-
 
85
        ${CP} ${ICON} ${PATH}${THEME}/$i/places/start-here-kde.svg
-
 
86
done
-
 
87
echo "I'm Removing the downloaded icon"
-
 
88
${RM} -f ${ICON}
-
 
89
echo
-
 
90
echo "That's all!"
-
 
91
echo "To see the changes you need to change the icon set using KDE system settings"
-
 
92
echo
-
 
-
 
122
        echo
-
 
123
        echo "Placing new Icon"
-
 
124
        echo
-
 
125
        for i in  "${RESOLUTION[@]}";
-
 
126
        do
-
 
127
                echo processing ${PATH}${THEME}/$i/places/start-here-kde.svg
-
 
128
                if (${CP} ${ICON} ${PATH}${THEME}/$i/places/start-here-kde.svg) then
-
 
129
                        echo "Placing icon ${PATH}${THEME}/$i/places/start-here-kde.svg succsesfull"
-
 
130
                        echo
-
 
131
                else
-
 
132
                        echo "There was error while placing icon ${PATH}${THEME}/$i/places/start-here-kde.svg"
-
 
133
                        echo
-
 
134
                fi
-
 
135
        done
-
 
136
        echo "I'm Removing the downloaded icon"
-
 
137
        ${RM} -f ${ICON}
-
 
138
        echo
-
 
139
        echo "That's all!"
-
 
140
        echo "To see the changes you need to change the icon set using KDE system settings"
-
 
141
        echo
-
 
142
fi