PDA

View Full Version : Change Kali Login Background on Gnome 3.20.2



razorspells
2016-06-06, 14:09
After hours of researching on how to change my login background on this Kali Rolling Version, I finally found this solution.

This instruction is for Kali Rolling Version only! If you are looking for Kali 2.0 scroll down, find the post.

I'm on Kali Rolling Version
*Kernel release: 4.6.0-kali1-amd64
*Kernel version: #1 SMP Debian 4.6.4-1kali1 (2016-07-21)
*GNOME Shell 3.21.90

Got the instructions from here (https://wiki.archlinux.org/index.php/GDM#Log-in_screen_background_image), but I corrected the script and added a forward slash after theme/ to make it work. See below.

1. Save the script below to a file - myscript.sh



#!/bin/sh

workdir=${HOME}/shell-theme/
if [ ! -d ${workdir}/theme ]; then
mkdir -p ${workdir}/theme
fi
gst=/usr/share/gnome-shell/gnome-shell-theme.gresource

for r in `gresource list $gst`; do
gresource extract $gst $r >$workdir${r#\/org\/gnome\/shell/}
done


2. Run the script on the command line: bash myscript.sh
- the script just extracted files from "/usr/share/gnome-shell/gnome-shell-theme.gresource"

3. You should now have a directory "/shell-theme/theme/"
- CHANGE to this directory and copy your file background here
- view the extracted files via the command line (e.g. ls -l)

4. create a file called "gnome-shell-theme.gresource.xml"
- add the code below
- on the line that has FILENAME replace it with the filename of your background
- save and exit



<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/shell/theme">
<file>calendar-arrow-left.svg</file>
<file>calendar-arrow-right.svg</file>
<file>calendar-today.svg</file>
<file>checkbox-focused.svg</file>
<file>checkbox-off-focused.svg</file>
<file>checkbox-off.svg</file>
<file>checkbox.svg</file>
<file>close-window.svg</file>
<file>close.svg</file>
<file>corner-ripple-ltr.png</file>
<file>corner-ripple-rtl.png</file>
<file>dash-placeholder.svg</file>
<file>filter-selected-ltr.svg</file>
<file>filter-selected-rtl.svg</file>
<file>gnome-shell.css</file>
<file>gnome-shell-high-contrast.css</file>
<file>logged-in-indicator.svg</file>
<file>FILENAME</file>
<file>more-results.svg</file>
<file>no-events.svg</file>
<file>no-notifications.svg</file>
<file>noise-texture.png</file>
<file>page-indicator-active.svg</file>
<file>page-indicator-inactive.svg</file>
<file>page-indicator-checked.svg</file>
<file>page-indicator-hover.svg</file>
<file>process-working.svg</file>
<file>running-indicator.svg</file>
<file>source-button-border.svg</file>
<file>summary-counter.svg</file>
<file>toggle-off-us.svg</file>
<file>toggle-off-intl.svg</file>
<file>toggle-on-hc.svg</file>
<file>toggle-on-us.svg</file>
<file>toggle-on-intl.svg</file>
<file>ws-switch-arrow-up.png</file>
<file>ws-switch-arrow-down.png</file>
</gresource>
</gresources>


5. Open gnome-shell.css, find and modify the following id element: #lockDialogGroup
- add the filename of your background.
- add dimensions of your background (optional)
- add "no-repeat" means no tiled effect
- save and exit



#lockDialogGroup {
background: #2e3436 url(resource:///org/gnome/shell/theme/FILENAME);
background-size: [WIDTH]px [HEIGHT]px;
background-repeat: no-repeat;
}


6. Compile this resource
- on the command line type: glib-compile-resources gnome-shell-theme.gresource.xml
- the result would be a new file called: gnome-shell-theme.gresource

Note: Disregard the error, "XMLLINT not set and xmllint not found in path; skipping xml preprocessing."
the compilation will still produce a "gnome-shell-theme.gresource" file. list your directory to see it.

7. Rename the OLD: gnome-shell-theme.gresource to whatever you like
- mv /usr/share/gnome-shell/gnome-shell-theme.gresource /usr/share/gnome-shell/gnome-shell-theme.gresource.bak
(add sudo if you are not on root)

8. Copy the NEW: gnome-shell-theme.gresource TO /usr/share/gnome-shell/
cp gnome-shell-theme.gresource /usr/share/gnome-shell/
(add sudo if you are not on root)

- reboot and your new login background is now applied.

Hope this helps...:cool:

TheMantis
2016-06-09, 14:02
Hi razorspells,

I ran the script and it said "Don't know how to handle /usr/share/gnome-shell/gnome-shell-theme.gresource"
my modified background only show when I locked the screen and re-login. please help.

Thanks.

razorspells
2016-06-10, 01:12
Hi Mantis, sorry fixed a typo on the filename of my post. Did you run? "bash myscript.sh" on the commandline?

Does "gnome-shell-theme.gresource" exists on your "/usr/share/gnome-shell/" directory?
Please post your kernel release version (uname -r) and what gnome version is installed?
Are you on root? Thanks

TheMantis
2016-06-10, 11:21
Hi Razorspells,

Yes, I ran "bash myscript.sh" and that was the error.
No, I don't have "gnome-shell-theme.gresource"
uname -r: 4.0.0-kali1-amd64
yes, I am on root.

Thanks for your help,

razorspells
2016-06-12, 04:07
Hi Mantis, I see that you are on the old Kali 2.0 version, the instructions that I posted above is for the NEW Kali rolling version.

I'm on Kali Rolling Version
*Kernel release: 4.5.0-kali1-amd64
*Kernel version: #1 SMP Debian 4.5.5-1kali1 (2016-06-06)
*GNOME Shell 3.20.2

============================

However you can try this method on your current Kali 2.0 build.

Change Login Background Screen (Kali 2.0 only)

1. rename the KaliLogin.png to another filename on this directory.
2. add your new .png image and name it also as KaliLogin.png

/usr/share/gnome-shell/theme/KaliLogin.png

3. reboot
================================================== =======

Change Background for Grub Screen (Kali 2.0 and up to Kali Rolling Version)

1. rename kali-grub.png to another filename on this directory.
2. add your new .png image and name it also as kali-grub.png

/usr/share/images/desktop-base/kali-grub.png

3. sudo update-grub

4. reboot

Hope this helps!

Grantt
2016-06-14, 03:42
Quite helpful, yet to try it out

R.3volv3.R
2016-06-24, 01:08
when i compile get this error :
XMLLINT not set and xmllint not found in path; skipping xml preprocessing.

razorspells
2016-06-26, 06:12
when i compile get this error :
XMLLINT not set and xmllint not found in path; skipping xml preprocessing.

Disregard the error, the compilation will still produce a "gnome-shell-theme.gresource" file. list your directory to see it.
proceed to step 7 and 8

post back your results. Thank you.

dorianpro
2018-02-11, 08:34
Hello guys,

In the 2017.1 and 2018.1 versions there's no need for all that work.
Just do this:

Chose your favourite picture, open terminal in the folder you saved the picture and do the following.


cp yourpicture.jpg /boot/grub
update-grub
reboot

That's all.