Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

[REQUEST] Can we get a .gresource file? #98

Open
eyalch opened this issue Jul 22, 2018 · 17 comments
Open

[REQUEST] Can we get a .gresource file? #98

eyalch opened this issue Jul 22, 2018 · 17 comments

Comments

@eyalch
Copy link

eyalch commented Jul 22, 2018

I noticed there's no gnome-shell-theme.gresource nor gresource.xml file.

Could we get (at least one of) those?

@NicoHood
Copy link
Collaborator

What is the purpose of it? You can create a PR for it and we might merge it. :)

@fossfreedom
Copy link
Collaborator

@NicoHood think this issue is covered by this PR which has been open for a while now #29

@NicoHood
Copy link
Collaborator

NicoHood commented Jul 23, 2018

You say the PR is ready? I currently have very little time to test.
Maybe @eyal0803 can do?

@fossfreedom
Copy link
Collaborator

yep - PR is ready for testing.

@PJ-Singh-001
Copy link

The gnome-shell-theme.gresource file is is found in /usr/share/gnome-shell.

This *.gresource file is used to theme the GDM Login/Lock Screens and to theme the Gnome Top-bar and the Gnome Dash.

Usually, you would want to keep this file under /usr/share/themes/Arc/gnome-shell or /usr/share/themes/Arc-Dark/gnome-shell, so the end user can manually move it into /usr/share/gnome-shell, if he/she wants.

I looked at #29, but that talks about "pre-compilation", so I wasn't sure if it is the same thing as what I mentioned above?.

Is there a plan to introduce an Arc Theme version of gnome-shell-theme.gresource file?

@jnsh
Copy link
Contributor

jnsh commented Sep 26, 2018

#29 was only about compiling .gresource for the gtk3 theme. I can take a look if the same could be achieved with the gnome-shell theme.

Any idea if it'd be really necessary to copy the gresource to /usr/share/gnome-shell to take effect, or if the gresource file could be simply called in the gnome-shell.css similarily to how it's done with the gtk3 theme?

Also, please let me know If you happen know any other shell themes where this is implemented, and I could have a glance at.

@PJ-Singh-001
Copy link

Gnome shell looks for a file named "gnome-shell-theme.gresource" under /usr/share/gnome-shell. So, in order to change the GDM theme, it is necessary to replace this file.

However, Arc should only provide the gnome-shell-theme.gresource file under /usr/share/themes/Arc-Dark/gnome-shell (for a Dark variant) and under /usr/share/themes/Arc/gnome-shell (for a Light variant). We probably only need light and dark variants, because this file only controls GDM, Lock Screen, the Top Bar, and Dash, all of which do not have windows.

Gnome Shell currently doesn't provide a mechanism to manage multiple GDM themes, so advanced users who want a holistic look to their OS can manually copy this file into /usr/share/gnome-shell, themselves, using sudo.

Examples:

@jnsh
Copy link
Contributor

jnsh commented Sep 30, 2018

@PJSingh5000 Thanks for the detailed explanation. That really helps a lot.

I think this should be fairly simple to implement, and a nice to have for making uniform GDM and gnome-shell lock screen look possible. I can have a go at it, once I get some more pressing work out of the way.

@Kirpal
Copy link
Contributor

Kirpal commented Nov 27, 2018

Any updates on this?

@PJ-Singh-001
Copy link

Actually, instead of a gnome-shell-theme.gresource file, I would prefer an XML format file instead.

We can always easily generate the *.gresource whenever needed.

The file gnome-shell-theme.gresource.xml should be placed in a gnome-shell sub-directory for each theme variant.

Then the corresponding gnome-shell-theme.gresource can be generated using the following commands:

Arc

    cd /usr/share/themes/Arc/gnome-shell
    sudo glib-compile-resources --target="/usr/share/gnome-shell/gnome-shell-theme.gresource" gnome-shell-theme.gresource.xml

Arc-Darker

    cd /usr/share/themes/Arc-Darker/gnome-shell
    sudo glib-compile-resources --target="/usr/share/gnome-shell/gnome-shell-theme.gresource" gnome-shell-theme.gresource.xml

Arc-Dark

    cd /usr/share/themes/Arc-Dark/gnome-shell
    sudo glib-compile-resources --target="/usr/share/gnome-shell/gnome-shell-theme.gresource" gnome-shell-theme.gresource.xml

@NicoHood
Copy link
Collaborator

Isnt this autogenerated on ArchLinux?
https://wiki.archlinux.org/index.php/GNOME_package_guidelines#GSettings_schemas

I mean, those files do not exist, but does anyone know why?

@PJ-Singh-001
Copy link

NicoHood,

I'm not clear what you are asking?...

GSettings (dconf) schema is different than a *.gresource file.
The gnome-shell-theme.gresource file is like a "zipped up" or "tarred up" version of your theme.
The gnome-shell-theme.gresource.xml tells the "zipping" program (glib-compile-resources) which files to include in the archive.

Gnome-Shell knows reads the gnome-shell-theme.gresource file and displays the contents on the GDM screen, the dock, and the title bar.

The default gnome-shell-theme.gresource file contains Adwaita assets. If we want to show assets for a different theme (Arc) we have to supply a different gnome-shell-theme.gresource file.

...If I didn't understand your question, I apologize.

@NicoHood
Copy link
Collaborator

NicoHood commented Dec 1, 2018

I dont understand this whole thing, I am possibly wrong. I just knew archlinux does some generation and I was wondering if we cant solve this with the OS itself.

So how do we finally solve this issue? Has anyone got a solution? If so, please open a PR :)

@PJ-Singh-001
Copy link

I don't have experience with creating PRs, but I'm willing to take a crack at it. First, I would like some feedback on the XML at the end of this post. I think it needs a little "tweaking."

  • Does it contain the right assets?
  • Are there too many assets?
  • Is it missing some assets? (For example, I think the restart, lock, and system settings icons look wrong on my system, using Papirus theme).

Here are the steps. Please test and give me some feedback?

(1) Save the XML file at the end of this post as...

    /usr/share/themes/Arc-Dark/gnome-shell/gnome-shell-theme.gresource.xml

(2) Compile it...

    cd /usr/share/themes/Arc-Dark/gnome-shell/
    sudo glib-compile-resources --target="/usr/share/themes/Arc-Dark/gnome-shell/gnome-shell-theme.gresource" gnome-shell-theme.gresource.xml

(3) Backup original...

    cd /usr/share/gnome-shell/
    sudo mv gnome-shell-theme.gresource gnome-shell-theme-original.gresource

(4) Use the new Arc Theme version for the top bar, dash, lock screen, and GDM screen. (We simply create a link to the new gresource file).

    cd /usr/share/gnome-shell/
    sudo ln --symbolic --force /usr/share/themes/Arc-Dark/gnome-shell/gnome-shell-theme.gresource gnome-shell-theme.gresource

(Creating a link is useful because, if you want to revert to the original Adwaita theme, simply point the link to the backed-up gnome-shell-theme-original.gresource file).

Note:

On Ubuntu, the following is needed for GDM to use the Arc theme. (I don't think this is necessary for Arch, Fedora, or Suse).

    cd /usr/share/gnome-shell/theme/
    sudo mv  gnome-shell.css gnome-shell-original.css
    sudo ln --symbolic --force "/usr/share/themes/Arc-Dark/gnome-shell/gnome-shell.css" gdm3.css

(Creating a link is useful because, if you want to revert to the original Adwaita theme for GDM, simply point the link to the backed-up gnome-shell-original.css file).

(5) Restart


gnome-shell-theme.gresource.xml

<?xml version="1.0" encoding="UTF-8"?>
<gresources>
  <gresource prefix="/org/gnome/shell/theme">
    <file>common-assets/dash/dash-left.svg</file>
    <file>common-assets/dash/running3.svg</file>
    <file>common-assets/dash/dash-placeholder.svg</file>
    <file>common-assets/dash/running4.svg</file>
    <file>common-assets/dash/running2.svg</file>
    <file>common-assets/dash/dash-right.svg</file>
    <file>common-assets/dash/running1.svg</file>
    <file>common-assets/menu/menu-hover.svg</file>
    <file>common-assets/menu/menu-separator.svg</file>
    <file>common-assets/panel/panel.svg</file>
    <file>common-assets/panel/activities.svg</file>
    <file>common-assets/panel/activities-active.svg</file>
    <file>common-assets/panel/panel-overview.svg</file>
    <file>common-assets/switch/switch-on-selected.svg</file>
    <file>common-assets/switch/switch-off-selected.svg</file>
    <file>common-assets/misc/close-hover.svg</file>
    <file>common-assets/misc/page-indicator-hover.svg</file>
    <file>common-assets/misc/page-indicator-active.svg</file>
    <file>common-assets/misc/more-results.svg</file>
    <file>common-assets/misc/page-indicator-checked.svg</file>
    <file>common-assets/misc/process-working.svg</file>
    <file>common-assets/misc/ws-switch-arrow-up.png</file>
    <file>common-assets/misc/ws-switch-arrow-down.png</file>
    <file>common-assets/misc/close.svg</file>
    <file>common-assets/misc/close-active.svg</file>
    <file>common-assets/misc/corner-ripple-ltr.svg</file>
    <file>common-assets/misc/bg.svg</file>
    <file>common-assets/misc/osd.svg</file>
    <file>common-assets/misc/corner-ripple-rtl.svg</file>
    <file>common-assets/misc/page-indicator-inactive.svg</file>
    <file>common-assets/misc/calendar-today.svg</file>
    <file>gnome-shell.css</file>
    <file>dark-assets/menu/submenu-open.svg</file>
    <file>dark-assets/menu/submenu.svg</file>
    <file>dark-assets/menu/menu.svg</file>
    <file>dark-assets/switch/switch-on.svg</file>
    <file>dark-assets/switch/switch-off.svg</file>
    <file>dark-assets/misc/message-close-active.svg</file>
    <file>dark-assets/misc/message-active.svg</file>
    <file>dark-assets/misc/message-close-hover.svg</file>
    <file>dark-assets/misc/calendar-arrow-left.svg</file>
    <file>dark-assets/misc/calendar-arrow-right.svg</file>
    <file>dark-assets/misc/message-close.svg</file>
    <file>dark-assets/misc/message.svg</file>
    <file>dark-assets/misc/calendar-arrow-left-hover.svg</file>
    <file>dark-assets/misc/calendar-arrow-right-hover.svg</file>
    <file>dark-assets/misc/message-hover.svg</file>
    <file>dark-assets/misc/modal.svg</file>
    <file>dark-assets/checkbox/checkbox-checked-focused.svg</file>
    <file>dark-assets/checkbox/checkbox-unchecked.svg</file>
    <file>dark-assets/checkbox/checkbox-unchecked-focused.svg</file>
    <file>dark-assets/checkbox/checkbox-checked.svg</file>
  </gresource>
</gresources>

@PJ-Singh-001
Copy link

Quick note: make sure package gnome-session is installed, and make sure you select "Gnome Session" on the GDM screen after rebooting.

@PJ-Singh-001
Copy link

PJ-Singh-001 commented Feb 3, 2019

I need some help...

  1. The View App Grid icon is shifted to the left in the dash-to-dock, instead of lining up with the other icons.
  2. The Settings, Lock, and Power icons in the Indicator Menu are not monochrome, but the screen rotation lock icon is monochrome. Also all the other icons are also monochrome.
  3. The icons in the Notifications menu are not monochrome. I believe they should be.

Please see the attached screen shots to see what I mean.

I think these issues may be due to the gnome-shell.css file, and this file needs "fixes" for these issues.
Also, some required icon assets may be missing in the gnome-shell-theme.gresource.xml above.

Would someone folks please help track down and fix these three issues?

(1)
app grid icon

(2)
indicator menu

(3)
notifications

@banditopazzo
Copy link

To set the Arc-Dark theme to the GDM shell, I used this script in a pacman hook.

It builds the xml file, compiles the .gresource and then make the symlink to it

#!/bin/bash

BASE_DIR=/usr/share/themes/Arc-Dark/gnome-shell
FILE_XML=$BASE_DIR/gnome-shell-theme.gresource.xml
FILE_CSS=$BASE_DIR/gnome-shell.css
COMMON_ASSETS_DIR=$BASE_DIR/common-assets
DARK_ASSETS_DIR=$BASE_DIR/dark-assets
OUTPUT_GRESOURCE_FILE=$BASE_DIR/gnome-shell-theme.gresource
GDM_GRESOURCE_FILE=/usr/share/gnome-shell/gnome-shell-theme.gresource
PREFIX=$BASE_DIR/

# DELETE PREVIOUS
rm -rf $FILE_XML
rm -rf $GDM_GRESOURCE_FILE

# HEAD
/bin/cat <<EOM >>$FILE_XML
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
    <gresource prefix="/org/gnome/shell/theme">
EOM

#BODY
find $COMMON_ASSETS_DIR -type f | while read line; do
    echo -e "\t\t<file>${line#$PREFIX}</file>" >> $FILE_XML
done
echo -e "\t\t<file>${FILE_CSS#$PREFIX}</file>" >> $FILE_XML
find $DARK_ASSETS_DIR -type f | while read line; do
    echo -e "\t\t<file>${line#$PREFIX}</file>" >> $FILE_XML
done

# TAIL
/bin/cat <<EOM >>$FILE_XML
    </gresource>
</gresources>
EOM

# COMPILE RESOURCES
cd $BASE_DIR
sudo glib-compile-resources --target=$OUTPUT_GRESOURCE_FILE $FILE_XML

# CREATE THE SYMBOLIC LINK 
sudo ln -sf $OUTPUT_GRESOURCE_FILE $GDM_GRESOURCE_FILE

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants