Custom shell/gtk themes
I want to apply a custom GTK and a custom shell theme (gnome) but I can't find a way to do it.
I download user theme extensions, to be able to change the shell theme.
I download themes from the gnome site and test it on my main machine and they work perfectly.
I put those themes in the /usr/share/themes folder of my custom distro and then I try to update the shell and GTK theme using the correct gsettings command (I try the command on my main machine and it works), but when I boot on the iso themes were not apply by default.
How can I apply them by default ?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Cubic Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Cubic PPA
- Solved:
- Last query:
- Last reply:
Related bugs
Related FAQ:
None Link to a FAQ
Revision history for this message
|
#1 |
#!/usr/bin/python3
#######
# #
# install-
# #
# In order to prevent the customized default schema files in #
# /usr/share/
# distribution specific schema override files in this directory by #
# moving them to a backup directory in /tmp. #
# #
# Copyright (C) 2019 PJ Singh <email address hidden> #
# #
#######
#######
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https:/
# #
#######
"""
Install the specified gnome shell extension.
Run this program as root or using sudo.
Example:
$ sudo ./install-
Args:
extension_id (int): The extension number.
Returns:
None
"""
import json
import shutil
import sys
import tempfile
import traceback
import urllib
import urllib.request
import xml.etree.
import zipfile
#######
# References
#######
# https:/
#######
# Globals & Constants
#######
EXTENSION_
EXTENSION_
EXTENSION_
# EXTENSION_
#######
# Functions
#######
#------
# Extension Id
#------
try:
extension_id = int(sys.argv[1])
print('Install extension %i...' % extension_id)
except IndexError:
print('• Error. An extension id number is required.')
exit()
except ValueError:
print('• Error. An extension id number is required.')
exit()
#------
# Gnome Shell Version
#------
version = ''
try:
filepath = '/usr/share/
tree = ElementTree.
root = tree.getroot()
platform = root.find(
version = platform
minor = root.find(
version = version + '.' + minor
try:
micro = root.find(
version = version + '.' + micro
except AttributeError:
print('• Ignoring. Unable to get Gnome micro version. The Gnome version is %s.' % version)
except Exception as exception:
print('• Error. Unable to get the Gnome version. The Gnome version is %s.' % version)
print('• The exception is %s' % exception)
# print('• The tracekback is %s' % traceback.
exit()
print('• The Gnome version is %s.' % version)
#------
# Download the Extension
#------
url = EXTENSION_
print('• The extension information url is %s' % url)
try:
with urllib.
try:
# Get extension information.
data = response.read()
info = json.loads(data)
name = info.get('name')
uuid = info.get('uuid')
# Ex: url = 'https://<email address hidden>
url = EXTENSION_
# Download extension.
try:
except urllib.
# print('• The tracekback is %s' % traceback.
except Exception as exception:
# print('• The tracekback is %s' % traceback.
except urllib.
print('• Error. Unable to access %s' % url)
print('• The exception is %s' % exception)
# print('• The tracekback is %s' % traceback.
Revision history for this message
|
#2 |
Please feel free to use my script, above.
Save the file as `install-
Make it executable:
$ chmod +x ./install-
Then, execute the script inside the Cubic's Terminal as follows:
$ ./install-
The <extension_id> is the number shown in the URL for the extension you want to install.
For example, the URL for the "User Themes" extension is...
https:/
Therefore, you can install the "User Themes" extension by executing:
$ ./install-
This will install the extension globally for *all* users.
Afterwards, if you ever need to update this extension in an installed environment, simply execute this same script using sudo:
$ sudo ./install-
Revision history for this message
|
#3 |
After you've installed your extension, you will need to configure it.
You can not use gsettings in Cubic's terminal environment to set user preferences.
Gsettings makes changes for the current user, but there is really no "current user" because you haven't installed your system. (Yes, you are a "root" user, but this is only to modify files on the system as you customize it).
To setup default user preferences, create a file called 90_ubuntu-
You will need to know the schema, keys, and allowed values for the extension you're configuring.
(You can see what the correct keys and values are using dconf-editor in your host environment).
Here is an example file:
[org.gnome.
picture-uri = 'file:/
show-desktop-icons = false
[org.gnome.
picture-uri = 'file:/
[org.gnome.
button-layout = 'close,
titlebar-font = 'Roboto Regular 10'
[org.gnome.
document-font-name = 'Roboto Regular 10'
font-name = 'Roboto Regular 10'
[org.gnome.shell]
favorite-apps = ['ubiquity.
Then, compile this schema file using:
glib-compile-
All users will have the preferences you specified in 90_ubuntu-
Revision history for this message
|
#4 |
I tried your solution, the GTK theme is applied and the user-theme extension is installed.
But there is still one problem, the user-theme extension is correctly installed bot not enable by default, so my shell theme is not apply by default.
How can I change that ?
Revision history for this message
|
#5 |
The key is "enabled-
Add this to your 90_ubuntu-
You can search find keys on your host machine by using dconf editor.
If you've installed "User Themes" and enabled it on your host machine, you can search for key "enabled-
For example,...
[org.gnome.shell]
enabled-extensions = ['<email address hidden>', '<email address hidden>', '<email address hidden>', '<email address hidden>', '<email address hidden>', '<email address hidden>', '<email address hidden>', '<email address hidden>']
Revision history for this message
|
#6 |
Thanks Cubic PPA, that solved my question.
Revision history for this message
|
#7 |
How do I copy the extension script so cubic can run it?
Revision history for this message
|
#8 |
It's been a while since I last touch to Gnome but if I understand your question correctly, your gnome extensions just go to /usr/share/
Revision history for this message
|
#9 |
I tried multiple times to user your script for adding extensions and it faults out all the time.
Could please help?
Thanks,