summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Alff2020-08-02 15:20:11 -0400
committerTed Alff2020-08-02 15:20:11 -0400
commit9944991d4b6c0f0349bdd817e073c9763b5a5178 (patch)
tree422d58a0a3c758968925d547db2a72570d0fdda2
parent410f565355d47fdbaefe4d082bce9f183df583f0 (diff)
downloadaur-9944991d4b6c0f0349bdd817e073c9763b5a5178.tar.gz
Switch to GTK3 branch.
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD41
-rw-r--r--fixes.patch222
3 files changed, 258 insertions, 25 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7af2384758a5..d295943af4b8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,22 @@
pkgbase = xfce4-dockbarx-plugin-git
pkgdesc = Embed DockbarX in the xfce4-panel
- pkgver = 49.a2dcb66
- pkgrel = 3
- url = https://github.com/TiZ-EX1/xfce4-dockbarx-plugin
+ pkgver = 0.6+r62+f7585b5
+ pkgrel = 1
+ url = https://github.com/m7s/xfce4-dockbarx-plugin
arch = i686
arch = x86_64
+ arch = armv7h
+ arch = aarch64
license = X11
- makedepends = python2
makedepends = git
makedepends = vala
- depends = dockbarx>=0.91
- depends = xfce4-panel<4.15.0
- provides = xfce4-dockbarx-plugin
- conflicts = xfce4-dockbarx-plugin
- source = xfce4-dockbarx-plugin::git+https://github.com/TiZ-EX1/xfce4-dockbarx-plugin.git
+ depends = dockbarx>=1.0beta
+ depends = xfce4-panel>=4.12
+ provides = xfce4-dockbarx-plugin=0.6+r62+f7585b5
+ source = xfce4-dockbarx-plugin::git+https://github.com/M7S/xfce4-dockbarx-plugin#branch=pygi-python3
+ source = fixes.patch
sha256sums = SKIP
+ sha256sums = 8f529817c1de28dc4ef2047254863d446f6c83a0120f90af9eac3f1524179f31
pkgname = xfce4-dockbarx-plugin-git
diff --git a/PKGBUILD b/PKGBUILD
index 97278d39735e..ece16547be94 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,34 +1,43 @@
# Contributor: twa022 <twa022 at gmail dot com>
_pkgname=xfce4-dockbarx-plugin
-pkgname=$_pkgname-git
-pkgver=49.a2dcb66
-pkgrel=3
+pkgname=${_pkgname}-git
+_pkgver=0.6
+pkgver=0.6+r62+f7585b5
+pkgrel=1
pkgdesc="Embed DockbarX in the xfce4-panel"
-arch=('i686' 'x86_64')
-url="https://github.com/TiZ-EX1/xfce4-dockbarx-plugin"
+arch=('i686' 'x86_64' 'armv7h' 'aarch64')
+url="https://github.com/m7s/xfce4-dockbarx-plugin"
license=('X11')
-depends=('dockbarx>=0.91' 'xfce4-panel<4.15.0')
-makedepends=('python2' 'git' 'vala')
-provides=("${_pkgname}")
-conflicts=("${_pkgname}")
-source=( ${_pkgname}::git+https://github.com/TiZ-EX1/${_pkgname}.git )
-sha256sums=('SKIP')
+depends=('dockbarx>=1.0beta' 'xfce4-panel>=4.12')
+makedepends=('git' 'vala')
+provides=("${_pkgname}=${pkgver}")
+_branch='pygi-python3'
+source=("${_pkgname}::git+https://github.com/M7S/${_pkgname}#branch=${_branch}"
+ 'fixes.patch')
+sha256sums=('SKIP'
+ '8f529817c1de28dc4ef2047254863d446f6c83a0120f90af9eac3f1524179f31')
pkgver() {
cd "${srcdir}/${_pkgname}"
- echo "$(git rev-list --count master).$(git rev-parse --short master)"
+ printf "%s+r%s+%s" "${_pkgver}" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "${srcdir}/${_pkgname}"
+ # Apply xuzhen's fixes for background color while waiting on pull request to be accepted
+ patch -Np1 -r- -i ../fixes.patch
+
+ PREFIX=/usr python ./waf configure
}
build() {
cd "${srcdir}/${_pkgname}"
- sed -i 's:env python$:&2:' waf wscript
- PREFIX=/usr ./waf configure
- ./waf build
+ python ./waf build
}
package() {
cd "${srcdir}/${_pkgname}"
- DESTDIR="${pkgdir}" ./waf install
+ DESTDIR="${pkgdir}" python ./waf install
}
diff --git a/fixes.patch b/fixes.patch
new file mode 100644
index 000000000000..4644185d1e92
--- /dev/null
+++ b/fixes.patch
@@ -0,0 +1,222 @@
+From db5051bf76aff2ac01c8f4203c63870f40f00b52 Mon Sep 17 00:00:00 2001
+From: xuzhen <xuzhen@users.noreply.github.com>
+Date: Sat, 27 Jun 2020 14:46:21 +0800
+Subject: [PATCH 1/2] Remove an unnecessary requirement
+
+---
+ wscript | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/wscript b/wscript
+index 2c06b4c..3d8d464 100644
+--- a/wscript
++++ b/wscript
+@@ -43,7 +43,6 @@ def configure (ctx):
+ ctx.load('vala')
+ ctx.env.append_value('CFLAGS', '-DGETTEXT_PACKAGE="gtk30"')
+ args = '--cflags --libs'
+- ctx.find_program('dockx')
+ ctx.check_cfg(package = 'glib-2.0', atleast_version = '2.42',
+ uselib_store = 'GLIB', mandatory = True, args = args)
+ ctx.check_cfg(package = 'gtk+-3.0', atleast_version = '3.22',
+
+From aa9c974d82df99ede2c6eabf4d7b1663bfd69f42 Mon Sep 17 00:00:00 2001
+From: xuzhen <xuzhen@users.noreply.github.com>
+Date: Sat, 18 Jul 2020 14:08:20 +0800
+Subject: [PATCH 2/2] fixed Gtk3 & xfce4-panel 4.14 compatibility
+
+---
+ src/dockbarx.vala | 3 ---
+ src/preferences.vala | 28 +++++++++-------------------
+ src/xfce4-dockbarx-plug.py | 37 ++++++++++++++++++++-----------------
+ 3 files changed, 29 insertions(+), 39 deletions(-)
+
+diff --git a/src/dockbarx.vala b/src/dockbarx.vala
+index 56006c1..a0cc65e 100644
+--- a/src/dockbarx.vala
++++ b/src/dockbarx.vala
+@@ -35,7 +35,6 @@ public class DockbarXPlugin : PanelPlugin {
+ private bool starting_dbx = false;
+ public int bgmode { get; set; }
+ public string color { get; set; }
+- public int alpha { get; set; }
+ public string image { get; set; }
+ public int offset { get; set; }
+ public int max_size { get; set; }
+@@ -64,7 +63,6 @@ public class DockbarXPlugin : PanelPlugin {
+
+ bgmode = xfc.get_int("/bgmode", 2);
+ color = xfc.get_string("/color", "#000");
+- alpha = xfc.get_int("/alpha", 100);
+ image = xfc.get_string("/image", "");
+ offset = xfc.get_int("/offset", 0);
+ max_size = xfc.get_int("/max-size", 0);
+@@ -74,7 +72,6 @@ public class DockbarXPlugin : PanelPlugin {
+
+ Xfconf.property_bind(xfc, "/mode", typeof(int), this, "bgmode");
+ Xfconf.property_bind(xfc, "/color", typeof(string), this, "color");
+- Xfconf.property_bind(xfc, "/alpha", typeof(int), this, "alpha");
+ Xfconf.property_bind(xfc, "/image", typeof(string), this, "image");
+ Xfconf.property_bind(xfc, "/offset", typeof(int), this, "offset");
+ Xfconf.property_bind(xfc, "/max-size", typeof(int), this, "max-size");
+diff --git a/src/preferences.vala b/src/preferences.vala
+index f380d66..f552585 100755
+--- a/src/preferences.vala
++++ b/src/preferences.vala
+@@ -29,7 +29,6 @@ class PrefDialog : Dialog {
+ private RadioButton image_radio;
+ private RadioButton blend_radio;
+ private ColorButton color_button;
+- private Scale alpha_scale;
+ private FileChooserButton image_button;
+ private SpinButton offset_spin;
+ private SpinButton max_size_spin;
+@@ -40,7 +39,7 @@ class PrefDialog : Dialog {
+ title = "DockbarX Preferences";
+ response.connect((i) => { destroy(); });
+ unowned Box content = get_content_area() as Box;
+- content.spacing = 12;
++ content.spacing = 12;
+ content.orientation = Orientation.VERTICAL;
+
+ color_radio = new RadioButton.with_label(null, "Solid color");
+@@ -49,8 +48,6 @@ class PrefDialog : Dialog {
+ blend_radio = new RadioButton.with_label_from_widget(
+ image_radio, "Blend with panel");
+ color_button = new ColorButton();
+- alpha_scale = new Scale.with_range(Orientation.HORIZONTAL, 0, 100, 1);
+- alpha_scale.value_pos = PositionType.RIGHT;
+ image_button = new FileChooserButton("Select background image",
+ FileChooserAction.OPEN);
+ offset_spin = new SpinButton.with_range(-32767, 32767, 1);
+@@ -81,25 +78,22 @@ class PrefDialog : Dialog {
+ var color_table = new Grid();
+ color_table.set_column_spacing( 8 );
+ var color_label = new Label("Color:");
+- var alpha_label = new Label("Alpha:");
+ color_table.attach(color_label, 0, 0, 1, 1);
+- color_table.attach(alpha_label, 0, 1, 1, 1);
+- color_button.set_hexpand(false);
++ color_button.set_hexpand(true);
++ ((Gtk.ColorChooser) color_button).set_use_alpha(true);
+ color_table.attach(color_button, 1, 0, 1, 1);
+- alpha_scale.set_hexpand(true);
+- color_table.attach(alpha_scale, 1, 1, 5, 1);
+ color_frame.add(color_table);
+
+ var image_table = new Grid();
+ image_table.set_column_spacing( 8 );
+ var image_label = new Label("Image:");
+ var offset_label = new Label("Offset:");
+- image_table.attach(image_label, 0, 0, 1, 1); //, 0, 0, 0, 0);
+- image_table.attach(offset_label, 0, 1, 1, 1); //, 0, 0, 0, 0);
+- image_table.attach(image_button, 1, 0, 3, 1); //, AttachOptions.EXPAND |
+- //AttachOptions.FILL, 0, 0, 0);
+- image_table.attach(offset_spin, 1, 1, 1, 1); //, AttachOptions.EXPAND |
+- //AttachOptions.FILL, 0, 0, 0);
++ image_table.attach(image_label, 0, 0, 1, 1);
++ image_table.attach(offset_label, 0, 1, 1, 1);
++ image_button.set_hexpand(true);
++ image_table.attach(image_button, 1, 0, 1, 1);
++ offset_spin.set_hexpand(true);
++ image_table.attach(offset_spin, 1, 1, 1, 1);
+ image_frame.add(image_table);
+
+ var size_box = new Box(Orientation.HORIZONTAL, 2);
+@@ -123,7 +117,6 @@ class PrefDialog : Dialog {
+ var color = Gdk.RGBA();
+ color.parse(plugin.color);
+ color_button.rgba = color;
+- alpha_scale.set_value(plugin.alpha);
+ image_button.set_filename(plugin.image);
+ offset_spin.value = plugin.offset;
+ max_size_spin.value = plugin.max_size;
+@@ -155,9 +148,6 @@ class PrefDialog : Dialog {
+ color_button.color_set.connect(() => {
+ plugin.color = color_button.rgba.to_string();
+ });
+- alpha_scale.value_changed.connect(() => {
+- plugin.alpha = (int)alpha_scale.get_value();
+- });
+ image_button.file_set.connect(() => {
+ plugin.image = image_button.get_filename();
+ });
+diff --git a/src/xfce4-dockbarx-plug.py b/src/xfce4-dockbarx-plug.py
+index a3898b1..88fedae 100755
+--- a/src/xfce4-dockbarx-plug.py
++++ b/src/xfce4-dockbarx-plug.py
+@@ -29,6 +29,7 @@
+ gi.require_version("Gtk", "3.0")
+ from gi.repository import Gtk
+ from gi.repository import Gdk
++from gi.repository import GdkPixbuf
+ from gi.repository import GObject
+ import cairo
+ import dbus
+@@ -123,8 +124,9 @@ def xfconf_changed (self, channel, prop, val):
+ elif "block-autohide" in prop:
+ pass # This is one way comm from the plug to the socket.
+ elif self.mode == 0 and ("color" in prop or "alpha" in prop):
+- self.color_pattern(Gdk.color_parse(self.xfconf_get_dbx(
+- "color", "#000")), self.xfconf_get_dbx("alpha", 100))
++ color = Gdk.RGBA()
++ color.parse(self.xfconf_get_dbx("color", "#000"))
++ self.color_pattern(color)
+ elif self.mode == 1 and ("image" in prop or "offset" in prop):
+ self.image_pattern(self.xfconf_get_dbx("image", ""))
+ else:
+@@ -157,25 +159,22 @@ def config_bg (self):
+ if self.mode == 1:
+ self.image_pattern(self.xfconf_get_dbx("image", ""))
+ elif self.mode == 0:
+- self.color_pattern(Gdk.color_parse(self.xfconf_get_dbx(
+- "color", "#000")), self.xfconf_get_dbx("alpha", 100))
++ color = Gdk.RGBA()
++ color.parse(self.xfconf_get_dbx("color", "#000"))
++ self.color_pattern(color)
+ else:
+ self.pattern_from_dbus()
+
+- def color_pattern (self, color, alpha):
+- if Gdk.Screen.get_default().get_rgba_visual() is None: alpha = 100
+- self.pattern = cairo.SolidPattern(color.red_float, color.green_float,
+- color.blue_float, alpha / 100.0)
++ def color_pattern (self, color):
++ if Gdk.Screen.get_default().get_rgba_visual() is None:
++ color.alpha = 1
++ self.pattern = cairo.SolidPattern(color.red, color.green, color.blue, color.alpha)
+
+ def image_pattern (self, image, from_dbus=False):
+ self.offset = self.xfconf_get_dbx("offset", 0)
+ try:
+- if str(image).endswith("svg"):
+- # Todo: Get a better height and width. How does xfcepanel handle it?
+- surface = Cairo.SVGSurface(image, self.get_allocation_height(), self.get_allocation_width())
+- else:
+- surface = cairo.ImageSurface.create_from_png(image)
+-
++ pixbuf = GdkPixbuf.Pixbuf.new_from_file(image)
++ surface = Gdk.cairo_surface_create_from_pixbuf(pixbuf, 0)
+ self.pattern = cairo.SurfacePattern(surface)
+ self.pattern.set_extend(cairo.EXTEND_REPEAT)
+ tx = self.offset if self.orient in ("up", "down") else 0
+@@ -194,12 +193,16 @@ def image_pattern (self, image, from_dbus=False):
+ def pattern_from_dbus (self):
+ bgstyle = self.xfconf_get_panel("background-style", 0)
+ image = self.xfconf_get_panel("background-image", "")
+- alpha = self.xfconf_get_panel("background-alpha", 100)
+ if bgstyle == 2 and os.path.isfile(image):
+ self.image_pattern(image, from_dbus=True)
+ elif bgstyle == 1:
+- col = self.xfconf_get_panel("background-color", [0, 0, 0, 0])
+- self.color_pattern(Gdk.Color(col[0], col[1], col[2]), alpha)
++ col = self.xfconf_get_panel("background-rgba", None)
++ if col is None:
++ # xfce4-panel < 4.14
++ col = self.xfconf_get_panel("background-color", [0, 0, 0, 0])
++ col = [v / 65535.0 for v in col]
++ col[3] = self.xfconf_get_panel("background-alpha", 100) / 100.0
++ self.color_pattern(Gdk.RGBA(col[0], col[1], col[2], col[3]))
+ else:
+ self.pattern = None
+