summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorConnor Behan2015-06-08 18:24:17 -0400
committerConnor Behan2015-06-08 18:24:17 -0400
commita4c038dd474a3e62f17895e6a9543b9a3d8e4b66 (patch)
tree03887929fb3453da9086a40a3d50744940464979
downloadaur-a4c038dd474a3e62f17895e6a9543b9a3d8e4b66.tar.gz
Initial import
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD32
-rw-r--r--update.diff81
3 files changed, 136 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f228770b0e86
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = xfce4-mpc-plugin-update
+ pkgdesc = Updates the toggle button icon depending on what MPD is doing
+ pkgver = 0.4.5
+ pkgrel = 1
+ url = http://goodies.xfce.org/projects/panel-plugins/xfce4-mpc-plugin
+ arch = i686
+ arch = x86_64
+ groups = xfce4-goodies
+ license = GPL2
+ makedepends = pkgconfig
+ makedepends = intltool
+ depends = xfce4-panel
+ depends = libmpd>=0.16.1
+ provides = xfce4-mpc-plugin
+ replaces = xfce4-mpc-plugin
+ options = !libtool
+ source = http://archive.xfce.org/src/panel-plugins/xfce4-mpc-plugin/0.4/xfce4-mpc-plugin-0.4.5.tar.bz2
+ source = update.diff
+ md5sums = 718e64748e46908a44cd0b96eacbda28
+ md5sums = 8019c8201fb32d7659bbb3ea66fdca80
+
+pkgname = xfce4-mpc-plugin-update
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..30efed6ba37c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Contributor: Connor Behan <connor.behan@gmail.com>
+
+pkgname=xfce4-mpc-plugin-update
+pkgver=0.4.5
+pkgrel=1
+pkgdesc="Updates the toggle button icon depending on what MPD is doing"
+arch=(i686 x86_64)
+license=('GPL2')
+url="http://goodies.xfce.org/projects/panel-plugins/xfce4-mpc-plugin"
+groups=('xfce4-goodies')
+depends=('xfce4-panel' 'libmpd>=0.16.1')
+makedepends=('pkgconfig' 'intltool')
+replaces=('xfce4-mpc-plugin')
+provides=('xfce4-mpc-plugin')
+options=(!libtool)
+source=(http://archive.xfce.org/src/panel-plugins/xfce4-mpc-plugin/${pkgver%.*}/xfce4-mpc-plugin-${pkgver}.tar.bz2 update.diff)
+
+build() {
+ cd "${srcdir}"/xfce4-mpc-plugin-${pkgver}
+ patch -Np1 -i ../update.diff
+ ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib \
+ --localstatedir=/var --disable-static
+ make
+}
+
+package() {
+ cd "${srcdir}"/xfce4-mpc-plugin-${pkgver}
+ make DESTDIR="${pkgdir}" install
+}
+
+md5sums=('718e64748e46908a44cd0b96eacbda28'
+ '8019c8201fb32d7659bbb3ea66fdca80')
diff --git a/update.diff b/update.diff
new file mode 100644
index 000000000000..32be16054d58
--- /dev/null
+++ b/update.diff
@@ -0,0 +1,81 @@
+diff -ru xfce4-mpc-plugin-0.4.2.orig/panel-plugin/xfce4-mpc-plugin.c xfce4-mpc-plugin-0.4.2/panel-plugin/xfce4-mpc-plugin.c
+--- xfce4-mpc-plugin-0.4.2.orig/panel-plugin/xfce4-mpc-plugin.c 2012-04-14 21:30:06.000000000 -0700
++++ xfce4-mpc-plugin-0.4.2/panel-plugin/xfce4-mpc-plugin.c 2012-04-14 22:42:20.000000000 -0700
+@@ -31,6 +31,7 @@
+ #define DEFAULT_MPD_HOST "localhost"
+ #define DEFAULT_MPD_PORT 6600
+ #define DIALOG_ENTRY_WIDTH 20
++#define TIMEOUT 1000
+
+ #include "xfce4-mpc-plugin.h"
+
+@@ -581,6 +582,37 @@
+ g_string_free(str, TRUE);
+ }
+
++static gint
++mpc_timer(t_mpc* mpc)
++{
++ GtkWidget *image;
++
++ switch (mpd_player_get_state(mpc->mo)) {
++ case MPD_PLAYER_PLAY:
++ if (!(mpc->button_says_playing)) {
++ image = gtk_container_get_children(GTK_CONTAINER(mpc->toggle))->data;
++ gtk_widget_destroy(image);
++ image = xfce_panel_image_new_from_source("media-playback-pause");
++ gtk_container_add(GTK_CONTAINER(mpc->toggle), image);
++ gtk_widget_show(image);
++ mpc->button_says_playing = TRUE;
++ }
++ break;
++ default:
++ if (mpc->button_says_playing) {
++ image = gtk_container_get_children(GTK_CONTAINER(mpc->toggle))->data;
++ gtk_widget_destroy(image);
++ image = xfce_panel_image_new_from_source("media-playback-start");
++ gtk_container_add(GTK_CONTAINER(mpc->toggle), image);
++ gtk_widget_show(image);
++ mpc->button_says_playing = FALSE;
++ }
++ break;
++ }
++
++ return TRUE;
++}
++
+ static void
+ toggle(GtkWidget *widget, GdkEventButton* event, t_mpc* mpc)
+ {
+@@ -741,7 +773,8 @@
+ mpc->stop = new_button_with_cbk(plugin, mpc->box, "media-playback-stop", G_CALLBACK(stop), mpc);
+ mpc->toggle = new_button_with_cbk(plugin, mpc->box, "media-playback-pause", G_CALLBACK(toggle), mpc);
+ mpc->next = new_button_with_cbk(plugin, mpc->box, "media-skip-forward", G_CALLBACK(next), mpc);
+-
++
++ mpc->button_says_playing = TRUE;
+ mpc->random = gtk_check_menu_item_new_with_label (_("Random"));
+ g_signal_connect (G_OBJECT(mpc->random), "toggled", G_CALLBACK (mpc_random_toggled), mpc);
+ mpc->repeat = gtk_check_menu_item_new_with_label (_("Repeat"));
+@@ -818,7 +851,8 @@
+
+ /* create a connection*/
+ mpc->mo = mpd_new(mpc->mpd_host,mpc->mpd_port,mpc->mpd_password);
+-
++
++ g_timeout_add (TIMEOUT, (GtkFunction) mpc_timer, mpc);
+ gtk_container_add (GTK_CONTAINER (plugin), mpc->frame);
+ gtk_frame_set_shadow_type (GTK_FRAME (mpc->frame), ((mpc->show_frame) ? GTK_SHADOW_IN : GTK_SHADOW_NONE));
+
+diff -ru xfce4-mpc-plugin-0.4.2.orig/panel-plugin/xfce4-mpc-plugin.h xfce4-mpc-plugin-0.4.2/panel-plugin/xfce4-mpc-plugin.h
+--- xfce4-mpc-plugin-0.4.2.orig/panel-plugin/xfce4-mpc-plugin.h 2012-04-14 21:30:06.000000000 -0700
++++ xfce4-mpc-plugin-0.4.2/panel-plugin/xfce4-mpc-plugin.h 2012-04-14 22:37:42.000000000 -0700
+@@ -51,6 +51,7 @@
+ gchar * playlist_format;
+ gboolean mpd_repeat;
+ gboolean mpd_random;
++ gboolean button_says_playing;
+ gint nb_outputs;
+ t_mpd_output ** mpd_outputs;
+ } t_mpc;
+