3 codename=$(cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2)
5 if [ "$codename" == "impish" ]
7 source="/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource"
10 ----------------------------------------
11 Sorry, Script is only for Ubuntu 21.10
13 ----------------------------------------"
17 pkg=$(dpkg -l | grep libglib2.0-dev >/dev/null && echo "yes" || echo "no")
21 -----------------------------------------------------------------------------------------------------
22 Sorry, the package 'libglib2.0-dev' is not installed. Install the package and then run this Script.
24 -----------------------------------------------------------------------------------------------------"
28 ############################################################################################
29 case "$1" in ###############################################################################
30 ############################################################################################
32 ############################################################################################
36 echo "This Script must be run with sudo"
41 -------------------------------------------------------------------------------------------------------
42 Please note that after setting login screen background,
43 >>>>>>>>> Reboot is highly recomonded to see the changes <<<<<<<<<<<<
45 Do you want to proceed now? [Yes/no] Type n to exit, or press enter to proceed.
46 -------------------------------------------------------------------------------------------------------"
49 if [ "$answer" == "n" ] || [ "$answer" == "N" ]
56 Please Choose any one number from below.
65 echo "Option is not selected.
72 echo "Enter Image Path for Login Screen
73 ----------------------------------------------------
74 Example1: /usr/share/backgrounds/2.jpg
75 Example2: /usr/local/share/backgrounds/spaceship.png
76 Example3: /home/impish/Downloads/myBG.jpeg
77 ----------------------------------------------------"
83 Enter Hex Color Code for Login Screen (you may note down colors of your choice from this link https://www.color-hex.com/)
84 -------------------------------------------------------------------------------------------------------------------------
90 -------------------------------------------------------------------------------------------------------------------------"
94 if [ -z $b ] && [ -z $c ]
96 echo "Input is not Provided.
110 if ! [[ $c =~ ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ ]]; then
112 ------------------------------------------------------------------------------------------------------------
113 Sorry it is not a valid Hex color, Please choose the valid HEX color first and then run this script.
114 ------------------------------------------------------------------------------------------------------------"
123 ---------------------------------------------------------------------------------------------------
124 Image path you entered does not exist, script defined background color is going to be used for now.
125 Please notedown the correct file path of the Image and then run this script.
126 ---------------------------------------------------------------------------------------------------"
130 prefix="/org/gnome/shell/theme"
131 dest="/usr/local/share/gnome-shell/theme/impishgdm"
133 install -D /dev/null $dest/gdm.css
134 install -D /dev/null $dest/impishgdm.gresource.xml
135 install -d $dest/icons/scalable/actions
137 gresource extract $source $prefix/gdm.css > $dest/original.css
138 gresource extract $source $prefix/checkbox.svg > $dest/checkbox.svg
139 gresource extract $source $prefix/checkbox-off.svg > $dest/checkbox-off.svg
140 gresource extract $source $prefix/checkbox-focused.svg > $dest/checkbox-focused.svg
141 gresource extract $source $prefix/checkbox-off-focused.svg > $dest/checkbox-off-focused.svg
142 gresource extract $source $prefix/toggle-on.svg > $dest/toggle-on.svg
143 gresource extract $source $prefix/toggle-off.svg > $dest/toggle-off.svg
144 gresource extract $source $prefix/icons/scalable/actions/pointer-drag-symbolic.svg > $dest/icons/scalable/actions/pointer-drag-symbolic.svg
145 gresource extract $source $prefix/icons/scalable/actions/keyboard-enter-symbolic.svg > $dest/icons/scalable/actions/keyboard-enter-symbolic.svg
146 gresource extract $source $prefix/icons/scalable/actions/keyboard-hide-symbolic.svg > $dest/icons/scalable/actions/keyboard-hide-symbolic.svg
147 gresource extract $source $prefix/icons/scalable/actions/pointer-secondary-click-symbolic.svg > $dest/icons/scalable/actions/pointer-secondary-click-symbolic.svg
148 gresource extract $source $prefix/icons/scalable/actions/keyboard-shift-filled-symbolic.svg > $dest/icons/scalable/actions/keyboard-shift-filled-symbolic.svg
149 gresource extract $source $prefix/icons/scalable/actions/keyboard-caps-lock-filled-symbolic.svg > $dest/icons/scalable/actions/keyboard-caps-lock-filled-symbolic.svg
150 gresource extract $source $prefix/icons/scalable/actions/pointer-primary-click-symbolic.svg > $dest/icons/scalable/actions/pointer-primary-click-symbolic.svg
151 gresource extract $source $prefix/icons/scalable/actions/keyboard-layout-filled-symbolic.svg > $dest/icons/scalable/actions/keyboard-layout-filled-symbolic.svg
152 gresource extract $source $prefix/icons/scalable/actions/eye-not-looking-symbolic.svg > $dest/icons/scalable/actions/eye-not-looking-symbolic.svg
153 gresource extract $source $prefix/icons/scalable/actions/pointer-double-click-symbolic.svg > $dest/icons/scalable/actions/pointer-double-click-symbolic.svg
154 gresource extract $source $prefix/icons/scalable/actions/eye-open-negative-filled-symbolic.svg > $dest/icons/scalable/actions/eye-open-negative-filled-symbolic.svg
156 echo '@import url("resource:///org/gnome/shell/theme/original.css");
158 background: '$color' url(file://'$b');
159 background-repeat: no-repeat;
160 background-size: cover;
161 background-position: center; }' > $dest/gdm.css
163 echo '<?xml version="1.0" encoding="UTF-8"?>
165 <gresource prefix="/org/gnome/shell/theme">
166 <file>original.css</file>
168 <file>toggle-off.svg</file>
169 <file>checkbox-off.svg</file>
170 <file>toggle-on.svg</file>
171 <file>checkbox-off-focused.svg</file>
172 <file>checkbox-focused.svg</file>
173 <file>checkbox.svg</file>
174 <file>icons/scalable/actions/pointer-drag-symbolic.svg</file>
175 <file>icons/scalable/actions/keyboard-enter-symbolic.svg</file>
176 <file>icons/scalable/actions/keyboard-hide-symbolic.svg</file>
177 <file>icons/scalable/actions/pointer-secondary-click-symbolic.svg</file>
178 <file>icons/scalable/actions/keyboard-shift-filled-symbolic.svg</file>
179 <file>icons/scalable/actions/keyboard-caps-lock-filled-symbolic.svg</file>
180 <file>icons/scalable/actions/pointer-primary-click-symbolic.svg</file>
181 <file>icons/scalable/actions/keyboard-layout-filled-symbolic.svg</file>
182 <file>icons/scalable/actions/eye-not-looking-symbolic.svg</file>
183 <file>icons/scalable/actions/pointer-double-click-symbolic.svg</file>
184 <file>icons/scalable/actions/eye-open-negative-filled-symbolic.svg</file>
186 </gresources>' > $dest/impishgdm.gresource.xml
189 glib-compile-resources impishgdm.gresource.xml
190 mv impishgdm.gresource ..
192 update-alternatives --quiet --install /usr/share/gnome-shell/gdm-theme.gresource gdm-theme.gresource /usr/local/share/gnome-shell/theme/impishgdm.gresource 0
193 update-alternatives --quiet --set gdm-theme.gresource /usr/local/share/gnome-shell/theme/impishgdm.gresource
195 check=$(update-alternatives --query gdm-theme.gresource | grep Value | grep /usr/local/share/gnome-shell/theme/impishgdm.gresource >/dev/null && echo "pass" || echo "fail")
196 if [ "$check" == "pass" ]
207 ############################################################################################
208 --reset) ###################################################################################
209 ############################################################################################
211 if [ -e /usr/local/share/gnome-shell/theme/impishgdm.gresource ]
213 rm /usr/local/share/gnome-shell/theme/impishgdm.gresource
214 update-alternatives --quiet --set gdm-theme.gresource "$source"
216 rmdir --ignore-fail-on-non-empty -p gnome-shell/theme
223 -----------------------------------------------------------------------------
224 No need, Already Reset. (or unlikely background is not set using this Script.)
225 -----------------------------------------------------------------------------"
229 ############################################################################################
230 *) #########################################################################################
231 ############################################################################################
232 echo "Use the parameter '--set' or '--reset'; example: './impishgdm --set' or './impishgdm --reset'"