summaryrefslogtreecommitdiffstats
path: root/udev-block-notify.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-01-04 16:16:57 +0100
committerGravatar Christian Hesse <mail@eworm.de>2015-01-04 16:16:57 +0100
commitb4b474d84e539109c755fa895cece429bc229cd3 (patch)
treef7205275ae429c61b8eda9460819f25d70673fc4 /udev-block-notify.c
parent3e8d948c5bbd6416b0ab27475d92286b44bad391 (diff)
downloadudev-block-notify-b4b474d84e539109c755fa895cece429bc229cd3.tar.gz
udev-block-notify-b4b474d84e539109c755fa895cece429bc229cd3.tar.zst
introduce udev-block-notify.h and config.h
Diffstat (limited to 'udev-block-notify.c')
-rw-r--r--udev-block-notify.c47
1 files changed, 2 insertions, 45 deletions
diff --git a/udev-block-notify.c b/udev-block-notify.c
index 210b0e8..ef9ba18 100644
--- a/udev-block-notify.c
+++ b/udev-block-notify.c
@@ -5,47 +5,10 @@
* of the GNU General Public License, incorporated herein by reference.
*/
-#define _GNU_SOURCE
-
-#include <getopt.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <libnotify/notify.h>
-#include <libudev.h>
-
+#include "udev-block-notify.h"
+#include "config.h"
#include "version.h"
-#define PROGNAME "udev-block-notify"
-
-#define NOTIFICATION_TIMEOUT 10000
-
-#define ICON_DEVICE_MAPPER "media-playlist-shuffle"
-#define ICON_DRIVE_HARDDISK "drive-harddisk"
-#define ICON_DRIVE_HARDDISK_IEEE1394 "drive-harddisk-ieee1394"
-#define ICON_DRIVE_HARDDISK_USB "drive-harddisk-usb"
-#define ICON_DRIVE_OPTICAL "drive-optical"
-#define ICON_DRIVE_MULTIDISK "drive-multidisk"
-#define ICON_LOOP "media-playlist-repeat"
-#define ICON_MEDIA_FLASH "media-flash"
-#define ICON_MEDIA_FLOPPY "media-floppy"
-#define ICON_MEDIA_REMOVABLE "media-removable"
-#define ICON_MEDIA_ZIP "media-zip"
-#define ICON_MULTIMEDIA_PLAYER "multimedia-player"
-#define ICON_NETWORK_SERVER "network-server"
-#define ICON_UNKNOWN "dialog-question"
-
-#define TEXT_TOPIC "Udev Block Notification"
-#define TEXT_ADD "Device <b>%s</b> (%i:%i) <b>appeared</b>."
-#define TEXT_REMOVE "Device <b>%s</b> (%i:%i) <b>disappeared</b>."
-#define TEXT_MOVE "Device <b>%s</b> (%i:%i) was <b>renamed</b>."
-#define TEXT_CHANGE "Device <b>%s</b> (%i:%i) media <b>changed</b>."
-#define TEXT_DEFAULT "Anything happend to <b>%s</b> (%i:%i)... Don't know."
-#define TEXT_TAG "\n%s: <i>%s</i>"
-
const static char optstring[] = "hv";
const static struct option options_long[] = {
/* name has_arg flag val */
@@ -54,12 +17,6 @@ const static struct option options_long[] = {
{ 0, 0, 0, 0 }
};
-struct notifications {
- dev_t devnum;
- NotifyNotification *notification;
- struct notifications *next;
-};
-
uint8_t verbose = 0;
/*** get_notification ***/