How to use the wpgtk.data.themer function in wpgtk

To help you get started, we’ve selected a few wpgtk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deviantfero / wpgtk / wpgtk / __main__.py View on Github external
color.write_colors(arg, colors)

            sample.create_sample(colors, files.get_sample_path(arg))
            logging.info("shuffled %s" % arg)
        exit(0)

    if args.link:
        files.add_template(args.link[1], args.link[0])
        exit(0)

    if args.i:
        themer.import_theme(args.i[0], args.i[1], args.T)
        exit(0)

    if args.o:
        themer.export_theme(*args.o)
        exit(0)

    if args.R:
        try:
            any(themer.reset_theme(arg) for arg in args.R)
        except IOError:
            logging.error("file not found")
            exit(1)
        exit(0)

    if args.theme == "list":
        dark = settings['light_theme'] != "true"
        name_dic = pywal.theme.list_themes(dark)
        name_list = [t.name.replace(".json", "") for t in name_dic]
        print("\n".join(name_list))
        exit(0)
github deviantfero / wpgtk / wpgtk / __main__.py View on Github external
for arg in arg_list:
            colors = color.get_color_list(arg)
            colors = alter_action(colors)
            color.write_colors(arg, colors)

            sample.create_sample(colors, files.get_sample_path(arg))
            logging.info("shuffled %s" % arg)
        exit(0)

    if args.link:
        files.add_template(args.link[1], args.link[0])
        exit(0)

    if args.i:
        themer.import_theme(args.i[0], args.i[1], args.T)
        exit(0)

    if args.o:
        themer.export_theme(*args.o)
        exit(0)

    if args.R:
        try:
            any(themer.reset_theme(arg) for arg in args.R)
        except IOError:
            logging.error("file not found")
            exit(1)
        exit(0)

    if args.theme == "list":
        dark = settings['light_theme'] != "true"
github deviantfero / wpgtk / wpgtk / __main__.py View on Github external
if args.link:
        files.add_template(args.link[1], args.link[0])
        exit(0)

    if args.i:
        themer.import_theme(args.i[0], args.i[1], args.T)
        exit(0)

    if args.o:
        themer.export_theme(*args.o)
        exit(0)

    if args.R:
        try:
            any(themer.reset_theme(arg) for arg in args.R)
        except IOError:
            logging.error("file not found")
            exit(1)
        exit(0)

    if args.theme == "list":
        dark = settings['light_theme'] != "true"
        name_dic = pywal.theme.list_themes(dark)
        name_list = [t.name.replace(".json", "") for t in name_dic]
        print("\n".join(name_list))
        exit(0)

    if args.sat:
        cl = color.get_color_list(args.sat[0])
        val = float(args.sat[1])
        cl = [util.alter_brightness(x, 0, val) for x in cl]
github deviantfero / wpgtk / wpgtk / __main__.py View on Github external
exit(0)

    if args.d:
        delete_action = files.delete_template if args.t \
                        else themer.delete_theme
        try:
            any(delete_action(x) for x in args.d)
        except IOError:
            logging.error("file not found")
            exit(1)

        exit(0)

    if args.a:
        add_action = files.add_template if args.t \
                     else themer.create_theme
        for x in args.a:
            if path.isfile(glob.glob(x)[0]):
                add_action(glob.glob(x)[0])
        exit(0)

    if args.c:
        print(themer.get_current())
        exit(0)

    if args.z or args.A:
        alter_action = color.shuffle_colors if args.z \
                       else color.auto_adjust
        arg_list = args.z if args.z else args.A

        for arg in arg_list:
            colors = color.get_color_list(arg)
github deviantfero / wpgtk / wpgtk / __main__.py View on Github external
if args.l:
        if args.t:
            templates = files.get_file_list(OPT_DIR, False)
            any(print(t) for t in templates if ".base" in t)
        else:
            print("\n".join(files.get_file_list()))
        exit(0)

    if args.version:
        print("current version: " + __version__)
        exit(0)

    if args.d:
        delete_action = files.delete_template if args.t \
                        else themer.delete_theme
        try:
            any(delete_action(x) for x in args.d)
        except IOError:
            logging.error("file not found")
            exit(1)

        exit(0)

    if args.a:
        add_action = files.add_template if args.t \
                     else themer.create_theme
        for x in args.a:
            if path.isfile(glob.glob(x)[0]):
                add_action(glob.glob(x)[0])
        exit(0)
github deviantfero / wpgtk / wpgtk / gui / theme_picker.py View on Github external
def on_rm_clicked(self, widget):
        x = self.option_combo.get_active()
        current_walls = files.get_file_list()
        if current_walls:
            filename = current_walls[x]
            themer.delete_theme(filename)
            option_list = Gtk.ListStore(str)
            for elem in list(files.get_file_list()):
                option_list.append([elem])
            self.option_combo.set_model(option_list)
            self.option_combo.set_entry_text_column(0)
            self.colorscheme.set_model(option_list)
            self.colorscheme.set_entry_text_column(0)
            self.cpage.update_combo(option_list)
github deviantfero / wpgtk / wpgtk / gui / color_grid.py View on Github external
def render_theme(self):
        sample_path = files.get_sample_path(self.selected_file)

        try:
            self.color_list = color.get_color_list(self.selected_file)
        except SystemExit:
            self.color_list = themer.set_fallback_theme(self.selected_file)
        self.render_buttons()

        try:
            self.pixbuf_sample = GdkPixbuf.Pixbuf\
                .new_from_file_at_size(sample_path, width=500, height=300)
        except:
            sample.create_sample(self.color_list, sample_path)
            self.pixbuf_sample = GdkPixbuf.Pixbuf\
                .new_from_file_at_size(sample_path, width=500, height=300)

        self.sample.set_from_pixbuf(self.pixbuf_sample)
        self.parent.sample.set_from_pixbuf(self.pixbuf_sample)
github deviantfero / wpgtk / wpgtk / gui / color_grid.py View on Github external
def on_reset_click(self, widget):
        themer.reset_theme(self.selected_file)
        self.render_theme()