Debian Codegraph @

debian/prerm

raw
1 #!/bin/sh
2 set -e
3
4 # Tag to allow some debhelper commands to inject relevant code
5 #DEBHELPER#
6
7 if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
8 # Remove vendor logos alternative, all slaves get removed automatically
9 update-alternatives --remove \
10 vendor-logos \
11 /usr/share/desktop-base/debian-logos
12
13 # Remove background alternatives for theme packages
14 while read theme filename; do
15 update-alternatives --remove \
16 desktop-background \
17 /usr/share/desktop-base/$theme-theme/wallpaper/contents/images/$filename
18 done << EOF
19 ceratopsian 1920x1080.svg
20 emerald 1920x1080.svg
21 homeworld 1920x1080.svg
22 futureprototype 1920x1080.svg
23 moonlight 1920x1080.svg
24 softwaves 1024x768.svg
25 softwaves 1280x720.svg
26 softwaves 1280x800.svg
27 softwaves 1280x1024.svg
28 softwaves 1600x1200.svg
29 softwaves 1920x1080.svg
30 softwaves 1920x1200.svg
31 softwaves 2560x1440.svg
32 softwaves 2560x1600.svg
33 lines 1280x1024.svg
34 lines 1600x1200.svg
35 lines 1920x1080.svg
36 lines 1920x1200.svg
37 lines 2560x1080.svg
38 joy 1280x720.svg
39 joy 1280x1024.svg
40 joy 1600x1200.svg
41 joy 1920x1080.svg
42 joy 1920x1200.svg
43 joy-inksplat 1280x720.svg
44 joy-inksplat 1280x1024.svg
45 joy-inksplat 1600x1200.svg
46 joy-inksplat 1920x1080.svg
47 joy-inksplat 1920x1200.svg
48 spacefun 1280x720.svg
49 spacefun 1280x1024.svg
50 spacefun 1920x1080.svg
51 spacefun 1920x1200.svg
52 EOF
53 # *Last* remove background *highest priority* alternatives for active theme
54 update-alternatives --remove desktop-background /usr/share/desktop-base/active-theme/wallpaper/contents/images/1920x1080.svg
55
56 # Remove desktop-background.xml alternatives
57 # For theme packages
58 while read theme; do
59 update-alternatives --remove \
60 desktop-background.xml \
61 /usr/share/desktop-base/$theme-theme/wallpaper/gnome-background.xml
62 done << EOF
63 ceratopsian
64 emerald
65 homeworld
66 futureprototype
67 moonlight
68 softwaves
69 lines
70 joy
71 joy-inksplat
72 spacefun
73 EOF
74 # *Lastly* remove *highest priority* alternative for active theme
75 update-alternatives --remove \
76 desktop-background.xml \
77 /usr/share/desktop-base/active-theme/wallpaper/gnome-background.xml
78
79 # Remove desktop-lockscreen.xml alternatives
80 # For theme packages
81 while read theme; do
82 update-alternatives --remove \
83 desktop-lockscreen.xml \
84 /usr/share/desktop-base/$theme-theme/lockscreen/gnome-background.xml
85 done << EOF
86 ceratopsian
87 emerald
88 homeworld
89 futureprototype
90 moonlight
91 softwaves
92 lines
93 joy
94 spacefun
95 EOF
96 # *Last* remove *highest priority* alternative for active theme
97 update-alternatives --remove \
98 desktop-lockscreen.xml \
99 /usr/share/desktop-base/active-theme/lockscreen/gnome-background.xml
100
101 # Remove Plasma 5/KDE wallpaper alternatives
102 # For theme packages
103 while read theme; do
104 update-alternatives --remove \
105 desktop-plasma5-wallpaper \
106 /usr/share/desktop-base/$theme-theme/wallpaper
107 done << EOF
108 ceratopsian
109 emerald
110 homeworld
111 futureprototype
112 moonlight
113 softwaves
114 lines
115 joy
116 joy-inksplat
117 spacefun
118 EOF
119 # *Last* remove *highest priority* alternative for active theme
120 update-alternatives --remove \
121 desktop-plasma5-wallpaper \
122 /usr/share/desktop-base/active-theme/wallpaper
123
124 # Remove login theme alternatives
125 # For theme packages
126 # Alternative for theme packages
127 while read theme background; do
128 update-alternatives --remove \
129 desktop-login-background \
130 /usr/share/desktop-base/$theme-theme/login/$background
131 done << EOF
132 ceratopsian background.svg
133 emerald background.svg
134 homeworld background.svg
135 futureprototype background.svg
136 moonlight background.svg
137 softwaves background.svg
138 lines background.svg
139 lines background-nologo.svg
140 joy background.svg
141 spacefun background.svg
142 EOF
143 # *Last* remove *highest priority* alternative for active theme
144 update-alternatives --remove \
145 desktop-login-background \
146 /usr/share/desktop-base/active-theme/login/background.svg
147
148 # Remove GRUB background alternatives
149 while read theme ratio; do
150 update-alternatives --remove \
151 desktop-grub \
152 /usr/share/desktop-base/$theme-theme/grub/grub-$ratio.png
153 done << EOF
154 ceratopsian 4x3
155 ceratopsian 16x9
156 emerald 4x3
157 emerald 16x9
158 homeworld 4x3
159 homeworld 16x9
160 futureprototype 4x3
161 futureprototype 16x9
162 moonlight 4x3
163 moonlight 16x9
164 softwaves 4x3
165 softwaves 16x9
166 lines 4x3
167 lines 16x9
168 joy 4x3
169 joy 16x9
170 spacefun 4x3
171 spacefun 16x9
172 EOF
173 ## *Lastly* remove *highest priority* alternative
174 num_grub_efi_installed=$(dpkg-query --list "grub-efi*" 2> /dev/null | grep "^i" | wc -l)
175 if [ $num_grub_efi_installed -gt 0 ] ; then
176 remove_first_ratio=4x3
177 remove_last_ratio=16x9
178 else
179 remove_first_ratio=16x9
180 remove_last_ratio=4x3
181 fi
182 update-alternatives --remove \
183 desktop-grub.sh \
184 /usr/share/desktop-base/active-theme/grub/grub_background.sh
185 update-alternatives --remove \
186 desktop-grub \
187 /usr/share/desktop-base/active-theme/grub/grub-$remove_first_ratio.png
188 update-alternatives --remove \
189 desktop-grub \
190 /usr/share/desktop-base/active-theme/grub/grub-$remove_last_ratio.png
191
192
193 # Remove theme package alternatives
194 while read theme; do
195 update-alternatives --remove \
196 desktop-theme \
197 /usr/share/desktop-base/$theme-theme
198 done << EOF
199 ceratopsian
200 emerald
201 futureprototype
202 moonlight
203 softwaves
204 lines
205 joy
206 joy-inksplat
207 spacefun
208 EOF
209 ## *Lastly* remove *highest priority* alternative
210 update-alternatives --remove \
211 desktop-theme \
212 /usr/share/desktop-base/homeworld-theme
213
214 fi