2022-09-13 16:29:43 +00:00
|
|
|
#!/usr/bin/env python3
|
2022-07-17 11:46:05 +00:00
|
|
|
|
2022-08-18 16:50:11 +00:00
|
|
|
# gradience.in
|
2022-07-17 11:46:05 +00:00
|
|
|
#
|
2022-08-11 08:16:44 +00:00
|
|
|
# Change the look of Adwaita, with ease
|
2022-08-15 23:31:07 +00:00
|
|
|
# Copyright (C) 2022 Gradience Team
|
2022-07-17 11:46:05 +00:00
|
|
|
#
|
2022-08-11 08:16:44 +00:00
|
|
|
# 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.
|
2022-09-13 16:29:43 +00:00
|
|
|
#
|
2022-08-11 08:16:44 +00:00
|
|
|
# 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.
|
2022-09-13 16:29:43 +00:00
|
|
|
#
|
2022-08-11 08:16:44 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2022-07-17 11:46:05 +00:00
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import signal
|
|
|
|
import locale
|
2022-09-13 19:53:05 +00:00
|
|
|
import shutil
|
2022-07-17 11:46:05 +00:00
|
|
|
import gettext
|
|
|
|
|
2022-09-13 16:29:43 +00:00
|
|
|
is_local = @local_build@
|
|
|
|
|
|
|
|
if is_local:
|
|
|
|
# In the local use case, use gradience module from the sourcetree
|
|
|
|
sys.path.insert(1, '@PYTHON@')
|
|
|
|
|
|
|
|
# In the local use case the installed schemas go in <builddir>/data
|
|
|
|
os.environ["XDG_DATA_DIRS"] = '@SCHEMAS_DIR@:' + os.environ.get("XDG_DATA_DIRS", "")
|
|
|
|
|
2022-09-13 19:53:05 +00:00
|
|
|
shutil.copyfile(
|
2022-12-02 21:52:47 +00:00
|
|
|
os.path.join('@BUILD_DIR@', "gradience/backend", "constants.py"),
|
|
|
|
os.path.join('@SOURCE_DIR@', "gradience/backend", "constants.py")
|
2022-09-13 19:53:05 +00:00
|
|
|
)
|
|
|
|
|
2022-08-13 10:24:16 +00:00
|
|
|
pkgdatadir = '@PKGDATA_DIR@'
|
|
|
|
localedir = '@LOCALE_DIR@'
|
2022-08-12 21:17:49 +00:00
|
|
|
|
2022-09-13 16:29:43 +00:00
|
|
|
sys.dont_write_bytecode = True
|
2022-07-17 11:46:05 +00:00
|
|
|
|
|
|
|
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
2022-08-18 16:50:11 +00:00
|
|
|
gettext.install('gradience', localedir)
|
2022-08-12 21:17:49 +00:00
|
|
|
|
2022-08-18 16:50:11 +00:00
|
|
|
locale.bindtextdomain('gradience', localedir)
|
|
|
|
locale.textdomain('gradience')
|
2022-08-12 21:17:49 +00:00
|
|
|
|
2022-07-17 11:46:05 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import gi
|
|
|
|
|
2022-07-29 11:56:36 +00:00
|
|
|
gi.require_version('Gtk', '4.0')
|
|
|
|
gi.require_version('Adw', '1')
|
|
|
|
gi.require_version('Xdp', '1.0')
|
|
|
|
gi.require_version('XdpGtk4', '1.0')
|
2022-10-02 01:55:42 +00:00
|
|
|
gi.require_version('Soup', '3.0')
|
2022-07-29 11:56:36 +00:00
|
|
|
|
2022-07-17 11:46:05 +00:00
|
|
|
from gi.repository import Gio
|
2022-08-12 21:17:49 +00:00
|
|
|
resource = Gio.Resource.load(
|
2022-08-18 16:50:11 +00:00
|
|
|
os.path.join(pkgdatadir, 'gradience.gresource'))
|
2022-09-13 16:29:43 +00:00
|
|
|
Gio.Resource._register(resource)
|
2022-08-18 16:50:11 +00:00
|
|
|
|
2022-09-13 18:59:29 +00:00
|
|
|
sys.path.insert(1, "/usr/local/lib/python3.10/site-packages")
|
|
|
|
|
2022-12-02 21:52:47 +00:00
|
|
|
from gradience.frontend import main
|
2022-08-15 18:33:41 +00:00
|
|
|
sys.exit(main.main())
|