Hello community, here is the log from the commit of package azote for openSUSE:Factory checked in at 2020-06-23 21:06:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/azote (Old) and /work/SRC/openSUSE:Factory/.azote.new.2956 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "azote" Tue Jun 23 21:06:23 2020 rev:4 rq:816536 version:1.7.12 Changes: -------- --- /work/SRC/openSUSE:Factory/azote/azote.changes 2020-06-03 20:34:24.525527357 +0200 +++ /work/SRC/openSUSE:Factory/.azote.new.2956/azote.changes 2020-06-23 21:07:05.142325137 +0200 @@ -1,0 +2,13 @@ +Tue Jun 23 09:40:06 UTC 2020 - Michael Vetter <[email protected]> + +- Update to 1.7.12: + * scale and crop to triple display width / height; + * split vertical images vertically (is_horizontal = width >= height); + * detect which screen Azote window is displayed on; the screen + dimensions will be used as the base of the Scale and crop to + double/triple screen width/height option. This may be useful + if you use multiple-headed setup with various screen resolutions. + * added some error handling on colour definitions missing from + the allacritty.yml file. + +------------------------------------------------------------------- Old: ---- azote-1.7.11.tar.gz New: ---- azote-1.7.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ azote.spec ++++++ --- /var/tmp/diff_new_pack.K7wE9f/_old 2020-06-23 21:07:05.902327592 +0200 +++ /var/tmp/diff_new_pack.K7wE9f/_new 2020-06-23 21:07:05.906327605 +0200 @@ -18,7 +18,7 @@ %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} Name: azote -Version: 1.7.11 +Version: 1.7.12 Release: 0 Summary: Wallpaper manager for Sway, i3 and some other WMs License: GPL-3.0-only ++++++ azote-1.7.11.tar.gz -> azote-1.7.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azote-1.7.11/CHANGELOG.md new/azote-1.7.12/CHANGELOG.md --- old/azote-1.7.11/CHANGELOG.md 2020-06-02 23:57:51.000000000 +0200 +++ new/azote-1.7.12/CHANGELOG.md 2020-06-23 02:04:54.000000000 +0200 @@ -1,5 +1,16 @@ # CHANGELOG +## v1.7.12 (2020-06-22) +- scale and crop to triple display with / height; +- split vertical images vertically (is_horizontal = width >= height); +- detect which screen Azote window is displayed on; the screen dimensions will be used as the base of the +`Scale and crop to double/triple screen width/height` option. This may be useful if you use multiple-headed setup with +various screen resolutions. +- added some error handling on colour definitions missing from the `allacritty.yml` file. + +## v1.7.11 (2020-06-03) +Python version-independent launcher script + ## v1.7.10 (2020-03-15) "Open with" issue [#82](https://github.com/nwg-piotr/azote/issues/82) fixed. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azote-1.7.11/azote/languages/de_DE new/azote-1.7.12/azote/languages/de_DE --- old/azote-1.7.11/azote/languages/de_DE 2020-06-02 23:57:51.000000000 +0200 +++ new/azote-1.7.12/azote/languages/de_DE 2020-06-23 02:04:54.000000000 +0200 @@ -19,11 +19,14 @@ copy_as = Kopieren als: copy_paste_into = Kopieren & Einfügen in {} create_palette = Farbpalette erstellen +current = Aktuell custom_display = Benutzerdefinierter Bildschirm delete = Löschen display_mode = Anzeigemodus dual_height = doppelte Höhe dual_width = doppelte Breite +dual_height = dreifache Höhe +dual_width = dreifache Breite exact = Exakt: {} exit= Beenden flip_image = Bild spiegeln @@ -35,6 +38,7 @@ move = In den Papierkorb verschieben move_to_trash = Auswahl in den Papierkorb verschieben name = Name +no_colour_definitions = Keine Farbdefinitionen in {} no_picture_selected = Kein Bild ausgewählt ok = OK open_another_folder = Anderen Ordner öffnen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azote-1.7.11/azote/languages/en_EN new/azote-1.7.12/azote/languages/en_EN --- old/azote-1.7.11/azote/languages/en_EN 2020-06-02 23:57:51.000000000 +0200 +++ new/azote-1.7.12/azote/languages/en_EN 2020-06-23 02:04:54.000000000 +0200 @@ -19,12 +19,15 @@ copy_as = Copy as: copy_paste_into = Copy & paste into {} create_palette = Create palette +current = Current custom_display = Custom display delete = Delete display_mode = Display mode dotfiles = .dotfiles dual_height = dual height dual_width = dual width +triple_height = triple height +triple_width = triple width exact = Exact: {} exit = Exit flip_image = Flip image @@ -36,6 +39,7 @@ move = To trash move_to_trash = Move selected to trash name = Name +no_colour_definitions = No colour definitions in {} no_picture_selected = No picture selected ok = OK open_another_folder = Open another folder diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azote-1.7.11/azote/languages/fr_FR new/azote-1.7.12/azote/languages/fr_FR --- old/azote-1.7.11/azote/languages/fr_FR 2020-06-02 23:57:51.000000000 +0200 +++ new/azote-1.7.12/azote/languages/fr_FR 2020-06-23 02:04:54.000000000 +0200 @@ -19,11 +19,14 @@ copy_as = Copier en tant que: copy_paste_into = Copier et coller dans {} create_palette = Créer une palette +current = Actuel custom_display = Écran personnalisé delete = Effacer display_mode = Mode d’affichage dual_height = double hauteur dual_width = double largeur +dual_height = triple hauteur +dual_width = triple largeur exact = Exact: {} exit= Terminer flip_image = Retourner l’image @@ -35,6 +38,7 @@ move = Vers la corbeille move_to_trash = Déplacer la sélection vers la corbeille name = Nom +no_colour_definitions = Aucune définition de couleur dans {} no_picture_selected = Aucune image sélectionnée ok = OK open_another_folder = Ouvrir un autre dossier diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azote-1.7.11/azote/languages/pl_PL new/azote-1.7.12/azote/languages/pl_PL --- old/azote-1.7.11/azote/languages/pl_PL 2020-06-02 23:57:51.000000000 +0200 +++ new/azote-1.7.12/azote/languages/pl_PL 2020-06-23 02:04:54.000000000 +0200 @@ -19,11 +19,14 @@ copy_as = Kopiuj jako: copy_paste_into = Skopiuj i wklej do {} create_palette = Utwórz paletę +current = Aktualny custom_display = Niestandardowy ekran delete = Usuń display_mode = Tryb wyświetlania dual_height = podwójna wysokość dual_width = podwójna szerokość +triple_height = potrójna wysokość +triple_width = potrójna szerokość exact = Dokładny: {} exit = Zakończ flip_image = Odwróć obraz @@ -35,6 +38,7 @@ move = Do kosza move_to_trash = Przenieś wybrany do kosza name = Nazwa +no_colour_definitions = Brak definicji kolorów w {} no_picture_selected = Nie wybrano obrazu ok = OK open_another_folder = Wybierz inny folder diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azote-1.7.11/azote/main.py new/azote-1.7.12/azote/main.py --- old/azote-1.7.11/azote/main.py 2020-06-02 23:57:51.000000000 +0200 +++ new/azote-1.7.12/azote/main.py 2020-06-23 02:04:54.000000000 +0200 @@ -42,7 +42,7 @@ from gi.repository import Gtk, GdkPixbuf, Gdk, GLib from gi.repository.GdkPixbuf import InterpType from tools import set_env, hash_name, create_thumbnails, file_allowed, update_status_bar, flip_selected_wallpaper, \ - copy_backgrounds, create_pixbuf, split_selected_wallpaper, scale_and_crop, clear_thumbnails + copy_backgrounds, create_pixbuf, split_selected_wallpaper, scale_and_crop, clear_thumbnails, current_display from color_tools import rgba_to_hex, hex_to_rgb, rgb_to_hex, rgb_to_rgba from plugins import Alacritty, Xresources from color_tools import WikiColours @@ -555,6 +555,7 @@ def show_image_menu(widget, event=None, parent=None, from_toolbar=False): + cd = current_display() if common.selected_wallpaper: if common.associations: # not None if /usr/share/applications/mimeinfo.cache found and parse openers = common.associations[common.selected_wallpaper.source_path.split('.')[-1]] @@ -614,18 +615,34 @@ submenu.append(subitem) # Scale and crop to double width of the primary display - display = common.displays[0] + display = common.displays[cd] width, height = display['width'] * 2, display['height'] subitem = Gtk.MenuItem.new_with_label( - '{} x {} ({} {})'.format(width, height, display['name'], common.lang['dual_width'])) + '{} x {} ({} {} {})'.format(width, height, common.lang['current'], display['name'], common.lang['dual_width'])) subitem.connect('activate', scale_and_crop, common.selected_wallpaper.source_path, width, height) submenu.append(subitem) # Scale and crop to double height of the primary display - display = common.displays[0] + display = common.displays[cd] width, height = display['width'], display['height'] * 2 subitem = Gtk.MenuItem.new_with_label( - '{} x {} ({} {})'.format(width, height, display['name'], common.lang['dual_height'])) + '{} x {} ({} {} {})'.format(width, height, common.lang['current'], display['name'], common.lang['dual_height'])) + subitem.connect('activate', scale_and_crop, common.selected_wallpaper.source_path, width, height) + submenu.append(subitem) + + # Scale and crop to triple width of the primary display + display = common.displays[cd] + width, height = display['width'] * 3, display['height'] + subitem = Gtk.MenuItem.new_with_label( + '{} x {} ({} {} {})'.format(width, height, common.lang['current'], display['name'], common.lang['triple_width'])) + subitem.connect('activate', scale_and_crop, common.selected_wallpaper.source_path, width, height) + submenu.append(subitem) + + # Scale and crop to triple height of the primary display + display = common.displays[cd] + width, height = display['width'], display['height'] * 3 + subitem = Gtk.MenuItem.new_with_label( + '{} x {} ({} {} {})'.format(width, height, common.lang['current'], display['name'], common.lang['triple_height'])) subitem.connect('activate', scale_and_crop, common.selected_wallpaper.source_path, width, height) submenu.append(subitem) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azote-1.7.11/azote/plugins.py new/azote-1.7.12/azote/plugins.py --- old/azote-1.7.11/azote/plugins.py 2020-06-02 23:57:51.000000000 +0200 +++ new/azote-1.7.12/azote/plugins.py 2020-06-23 02:04:54.000000000 +0200 @@ -44,7 +44,10 @@ f = open(common.alacritty_config, "rb") self.data = load(f, Loader=Loader) - output = dump(self.data['colors'], Dumper=Dumper, default_flow_style=False, sort_keys=False) + try: + output = dump(self.data['colors'], Dumper=Dumper, default_flow_style=False, sort_keys=False) + except KeyError: + output = None scrolled_window = Gtk.ScrolledWindow() scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) @@ -55,53 +58,65 @@ self.textview.set_editable(False) self.textbuffer = self.textview.get_buffer() - self.textbuffer.set_text(output) + if output: + self.textbuffer.set_text(output) + else: + self.textbuffer.set_text("No color definitions found") scrolled_window.add(self.textview) - - hbox0.add(scrolled_window) - - vbox = Gtk.VBox() - vbox.set_spacing(3) - vbox.set_border_width(5) - - for key in self.data['colors']: - label = Gtk.Label() - label.set_property("name", "dotfiles-header") - label.set_text(key.upper()) - vbox.add(label) - for key1 in self.data['colors'][key]: - hbox = Gtk.HBox() - label = Gtk.Label() - label.set_property("name", "dotfiles") - label.set_text(key1) - hbox.pack_start(label, True, False, 0) - label = Gtk.Label() - label.set_property("name", "dotfiles") - hex_color = self.data['colors'][key][key1].replace('0x', '#') - label.set_text(hex_color) - hbox.pack_start(label, True, False, 0) - - preview_box = ColorPreviewBox(hex_color) - preview_box.connect('button-press-event', self.on_box_press, label, key, key1) - - hbox.pack_start(preview_box, False, False, 0) - - vbox.pack_start(hbox, False, False, 0) - - hbox0.add(vbox) - - vbox0.add(hbox0) + + if output: + hbox0.add(scrolled_window) + + vbox = Gtk.VBox() + vbox.set_spacing(3) + vbox.set_border_width(5) + + if self.data['colors']: + for key in self.data['colors']: + label = Gtk.Label() + label.set_property("name", "dotfiles-header") + label.set_text(key.upper()) + vbox.add(label) + try: + for key1 in self.data['colors'][key]: + hbox = Gtk.HBox() + label = Gtk.Label() + label.set_property("name", "dotfiles") + label.set_text(key1) + hbox.pack_start(label, True, False, 0) + label = Gtk.Label() + label.set_property("name", "dotfiles") + hex_color = self.data['colors'][key][key1].replace('0x', '#') + label.set_text(hex_color) + hbox.pack_start(label, True, False, 0) + + preview_box = ColorPreviewBox(hex_color) + preview_box.connect('button-press-event', self.on_box_press, label, key, key1) + + hbox.pack_start(preview_box, False, False, 0) + + vbox.pack_start(hbox, False, False, 0) + except: + pass + + hbox0.add(vbox) + + vbox0.add(hbox0) hbox = Gtk.HBox() hbox.set_spacing(5) hbox.set_border_width(5) - label = Gtk.Label(common.lang['copy_paste_into'].format(common.alacritty_config)) + label = Gtk.Label() + if output: + label.set_text(common.lang['copy_paste_into'].format(common.alacritty_config)) + else: + label.set_text(common.lang['no_colour_definitions'].format(common.alacritty_config)) label.set_property('name', 'dotfiles') hbox.add(label) button = Gtk.Button.new_with_label(common.lang['close']) button.connect_after('clicked', self.close_window) hbox.pack_start(button, False, False, 0) - + vbox0.pack_start(hbox, False, False, 0) self.add(vbox0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azote-1.7.11/azote/tools.py new/azote-1.7.12/azote/tools.py --- old/azote-1.7.11/azote/tools.py 2020-06-02 23:57:51.000000000 +0200 +++ new/azote-1.7.12/azote/tools.py 2020-06-23 02:04:54.000000000 +0200 @@ -111,17 +111,21 @@ names = subprocess.check_output("xrandr | awk '/ connected/{print $1}'", shell=True).decode( "utf-8").splitlines() res = subprocess.check_output("xrandr | awk '/*/{print $1}'", shell=True).decode("utf-8").splitlines() + coords = subprocess.check_output("xrandr --listmonitors | awk '{print $3}'", shell=True).decode("utf-8").splitlines() displays = [] for i in range(len(names)): w_h = res[i].split('x') + try: + x_y = coords[i + 1].split('+') + except: + x_y = (0, 0, 0) display = {'name': names[i], - 'x': 0, - 'y': 0, + 'x': x_y[1], + 'y': x_y[2], 'width': int(w_h[0]), 'height': int(w_h[1])} displays.append(display) log("Output found: {}".format(display), common.INFO) - return displays else: @@ -129,6 +133,43 @@ exit(1) +def current_display(): + display_number = 0 + x, y = 0, 0 + if common.env['wm'] == "sway": + string = subprocess.getoutput("swaymsg -t get_outputs") + outputs = json.loads(string) + for i in range(len(outputs)): + if outputs[i]["focused"]: + rect = outputs[i]["rect"] + x, y = rect["x"], rect["y"] + elif common.env['wm'] == "i3": + # Unfortunately `i3-msg -t get_outputs` output does not have the "focused" key. + # Let's find the active workspace and its rectangle. + string = subprocess.getoutput("i3-msg -t get_workspaces") + workspaces = json.loads(string) + for i in range(len(workspaces)): + if workspaces[i]['focused']: + rect = workspaces[i]["rect"] + x, y = rect["x"], rect["y"] + else: + # For not sway nor i3. This rises deprecation warnings and won't work w/o `pynput` module. + screen = common.main_window.get_screen() + try: + display_number = screen.get_monitor_at_window(screen.get_active_window()) + rectangle = screen.get_monitor_geometry(display_number) + x, y = rectangle.x, rectangle.y + except Exception as e: + print(e) + + for i in range(len(common.displays)): + display = common.displays[i] + if display["x"] == x and display['y'] == y: + display_number = i + break + return display_number + + def set_env(language=None): xdg_config_home = os.getenv('XDG_CONFIG_HOME') common.config_home = xdg_config_home if xdg_config_home else os.path.join(os.getenv("HOME"), ".config") @@ -469,10 +510,19 @@ try: img = Image.open(common.selected_wallpaper.source_path) width, height = img.size - part_width = width // num_parts + is_horizontal = width >= height + if is_horizontal: + part_width = width // num_parts + part_height = height + else: + part_width = width + part_height = height // num_parts paths_list = [] for i in range(num_parts): - box = (i * part_width, 0, i * part_width + part_width, height) + if is_horizontal: + box = (i * part_width, 0, i * part_width + part_width, part_height) + else: + box = (0, i * part_height, part_width, i * part_height + part_height) part = img.crop(box) img_path = os.path.join(common.bcg_dir, "part{}-{}".format(i, common.selected_wallpaper.filename)) part.save(os.path.join(common.tmp_dir, "part{}-{}".format(i, common.selected_wallpaper.filename)), "PNG") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azote-1.7.11/setup.py new/azote-1.7.12/setup.py --- old/azote-1.7.11/setup.py 2020-06-02 23:57:51.000000000 +0200 +++ new/azote-1.7.12/setup.py 2020-06-23 02:04:54.000000000 +0200 @@ -8,7 +8,7 @@ setup( name='azote', - version='1.7.11', + version='1.7.12', description='Wallpaper manager for Sway, i3 and some other WMs', packages=['azote'], include_package_data=True,
