示例#1
0
    def get_theme(icon_name):
        """Get the theme to be used dark or light."""
        from src.app import App

        if isinstance(App.theme(), dict):
            is_dark = "dark" in icon_name.lower()
            if is_dark:
                theme = App.theme()["dark"]
            else:
                theme = App.theme()["light"]
        else:
            theme = App.theme()

        return theme
示例#2
0
                    help=_("Replace a color with an other one, "
                           "works only with SVG."))
parser.add_argument("--clear-cache", action="store_true",
                    help=_("Clear backup files"))

args = parser.parse_args()
App.set_args(args)

if (not DESKTOP_ENV or DESKTOP_ENV == "other") and not App.icon_size():
    exit(_("You need to run the script using 'sudo -E'.\nPlease try again"))

print(_("Welcome to Hardcode-Tray!"))
print(_("Desktop Environment: {}").format(DESKTOP_ENV.title()))
print(_("Scaling Factor: {}").format(App.scaling_factor()))
print(_("Icon Size: {}").format(App.icon_size()))
if not isinstance(App.theme(), dict):
    print(_("Icon Theme: {}").format(App.theme()))
else:
    print(_("Dark Icon Theme: {}").format(App.theme("dark")))
    print(_("Light Icon Theme: {}").format(App.theme("light")))
print(_("Conversion Tool: {}").format(App.svg()))
print(_("To Do: "), end="")
print(", ".join(map(lambda x: x.title(), App.get("only")))
      if App.get("only") else _("All"))


action = App.get("action")
if action == Action.APPLY:
    print(_("Applying now.."))
elif action == Action.REVERT:
    print(_("Reverting now.."))