Gradience/src/gradience.in
2022-08-22 13:26:55 +02:00

65 lines
1.9 KiB
Text
Executable file

#!@PYTHON@
# gradience.in
#
# Change the look of Adwaita, with ease
# Copyright (C) 2022 Gradience Team
#
# 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://www.gnu.org/licenses/>.
import os
import sys
import signal
import locale
import gettext
pkgdatadir = '@PKGDATA_DIR@'
localedir = '@LOCALE_DIR@'
builddir = os.environ.get('MESON_BUILD_ROOT')
if builddir:
sys.dont_write_bytecode = True
sys.path.insert(1, os.environ['MESON_SOURCE_ROOT'])
data_dir = os.path.join(builddir, '@DATA_DIR@')
os.putenv('XDG_DATA_DIRS', '%s:%s' % (data_dir, os.getenv('XDG_DATA_DIRS', '/usr/local/share/:/usr/share/')))
sys.path.insert(1, pkgdatadir)
signal.signal(signal.SIGINT, signal.SIG_DFL)
gettext.install('gradience', localedir)
locale.bindtextdomain('gradience', localedir)
locale.textdomain('gradience')
if __name__ == '__main__':
import gi
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
gi.require_version('Xdp', '1.0')
gi.require_version('XdpGtk4', '1.0')
if '@BUILD_TYPE@' == "debug":
sys.path.append("/usr/local/local/lib/python3.10/site-packages")
from gi.repository import Gio
resource = Gio.Resource.load(
os.path.join(pkgdatadir, 'gradience.gresource'))
resource._register()
sys.path.append("/usr/local/lib/python3.10/site-packages/")
from gradience import main
sys.exit(main.main())