wmauda: Pixmap folder set as argument

The PIXMAP_DIR is set in the Makefile folder, using the prefix argument.
This commit is contained in:
Rodolfo García Peñas (kix) 2012-03-23 19:20:08 +01:00 committed by Carlos R. Mafra
parent eea379d833
commit eff65410df
3 changed files with 13 additions and 11 deletions

View file

@ -1,20 +1,18 @@
CC ?= gcc
CFLAGS ?= -g -pipe
PREFIX ?= /usr
PREFIX ?= /usr/local
INSTALL_DIR := $(PREFIX)/bin
PIXMAP_DIR := $(PREFIX)/share/pixmaps
MANPAGE_DIR := $(PREFIX)/share/man/man1
CFLAGS += $(shell pkg-config audacious --cflags) $(shell pkg-config dbus-1 --cflags)
LIBS := $(shell pkg-config audacious --libs) $(shell pkg-config audclient --libs) $(shell pkg-config dbus-1 --libs)
CFLAGS += $(shell pkg-config audclient --cflags) $(shell pkg-config dbus-glib-1 --cflags) $(shell pkg-config gtk+-2.0 --cflags) -DPIXMAP_DIR="\"$(PIXMAP_DIR)\""
CFLAGS += $(shell pkg-config gtk+-2.0 --cflags)
LIBS += $(shell pkg-config gtk+-2.0 --libs) -lX11
LIBS := $(shell pkg-config audclient --libs) $(shell pkg-config dbus-glib-1 --libs) $(shell pkg-config gtk+-2.0 --libs) -lX11
OBJS = wmauda.o
HEADERS = config.h dock-master.xpm
HEADERS = dock-master.xpm
wmauda: $(OBJS) $(HEADERS)
$(CC) -o wmauda $(OBJS) $(CFLAGS) $(LIBS)

View file

@ -1,2 +0,0 @@
#define DATA_DIR "/usr/share/pixmaps"
#define VERSION "0.6"

View file

@ -29,12 +29,18 @@
#include <audacious/dbus.h>
#include <audacious/audctrl.h>
#include "config.h"
#include "dock-master.xpm"
#include <getopt.h>
#ifndef VERSION
# define VERSION 0.8
#endif
#ifndef PIXMAP_DIR
# define PIXMAP_DIR "/usr/local/share/pixmaps"
#endif
typedef struct
{
int x, y, width, height, pressed_x, pressed_y, normal_x, normal_y;
@ -731,7 +737,7 @@ void init(void)
gdk_draw_rectangle(launch_mask, mask_gc, TRUE, 0, 0, -1, -1);
if (!icon_name)
icon_name = g_strdup_printf("%s/wmauda.xpm", DATA_DIR);
icon_name = g_strdup_printf("%s/wmauda.xpm", PIXMAP_DIR);
pixmap = gdk_pixmap_create_from_xpm(icon_win->window, &mask,
NULL, icon_name);
if (!pixmap)