imarkoff / Marble-shell-theme

Shell theme for GNOME DE
GNU General Public License v3.0
261 stars 8 forks source link

GDM theming #9

Closed Roblex09 closed 11 months ago

Roblex09 commented 11 months ago

How can I apply the theme to the login screen?

imarkoff commented 11 months ago

Marble theme is currently not designed for login screen, so not all elements are stylized

GNOME Shell themes are stored as binary files. According to this tutorial:

Note: you are going to modify system files, so do it at your own risk.

  1. Extract the existing GNOME Shell theme to a directory in your home directory. You can do this using the following script:

    #!/bin/sh
    gst=/usr/share/gnome-shell/gnome-shell-theme.gresource
    workdir=${HOME}/shell-theme
    
    for r in `gresource list $gst`; do
      r=${r#\/org\/gnome\/shell/}
      if [ ! -d $workdir/${r%/*} ]; then
         mkdir -p $workdir/${r%/*}
      fi
    done
    
    for r in `gresource list $gst`; do
      gresource extract $gst $r >$workdir/${r#\/org\/gnome\/shell/}
    done
  2. Navigate to the created directory - ~/shell-theme/theme

  3. Create gnome-shell-theme.gresource.xml in the directory with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <gresources>
     <gresource prefix="/org/gnome/shell/theme">
       <file>calendar-today.svg</file>
       <file>calendar-today-light.svg</file>
       <file>checkbox.svg</file>
       <file>checkbox-focused.svg</file>
       <file>checkbox-off-focused-light.svg</file>
       <file>checkbox-off-focused.svg</file>
       <file>checkbox-off-light.svg</file>
       <file>checkbox-off.svg</file>
       <file>gnome-shell.css</file>
       <file>gnome-shell-high-contrast.css</file>
       <file>gnome-shell-start.svg</file>
       <file>pad-osd.css</file>
       <file>process-working.svg</file>
       <file>toggle-off.svg</file>
       <file>toggle-off-hc.svg</file>
       <file>toggle-off-light.svg</file>
       <file>toggle-on.svg</file>
       <file>toggle-on-hc.svg</file>
       <file>toggle-on-light.svg</file>
       <file>workspace-placeholder.svg</file>
     </gresource>
    </gresources>
  4. Go to ~/.themes/ folder and choose Marble variation what you prefer.

  5. Copy all SVGs from generated theme to ~/shell-theme/theme and replace them.

  6. Open gnome-shell.css in generated theme folder and copy its entire content.

  7. Open gnome-shell.css in ~/shell-theme/theme and paste copied content below.

  8. Open ~/shell-theme/theme folder in the terminal.

  9. Compile the theme using the following command:

    glib-compile-resources gnome-shell-theme.gresource.xml
  10. Backup default theme:

    sudo cp /usr/share/gnome-shell/gnome-shell-theme.gresource /usr/share/gnome-shell/gnome-shell-theme_backup.gresource
  11. Copy the resulting gnome-shell-theme.gresource file to the /usr/share/gnome-shell directory:

    sudo mv gnome-shell-theme.gresource /usr/share/gnome-shell/gnome-shell-theme.gresource
  12. Restart gdm.service (note that simply logging out is not enough):

    sudo systemctl restart gdm.service

    and you should find that it is using your preferred theme.

Roblex09 commented 11 months ago

Thank you! <3