Pith - wedge
#include <QApplication>
#include <QSharedMemory>
#include <QSystemSemaphore>
#include "WedgeNote.h"

int main(int argc, char *argv[]) {
	QApplication a(argc, argv);

	QSystemSemaphore semaphore("wedge_03569", 1);
	semaphore.acquire();

#ifndef Q_OS_WIN
	QSharedMemory nix_fix("wedge_key_03569");
	if (nix_fix.attach()) {
		nix_fix.detach();
	}
#endif

	static QSharedMemory sharedMemory("wedge_key_03569");
	bool isRunning = false;
	if (!sharedMemory.create(1)) {
		isRunning = true;
	}

	semaphore.release();

	if (isRunning) {
		return 0; 
	}

	QCoreApplication::setOrganizationName("wedge");
	QCoreApplication::setApplicationName("wedge");
	QApplication::setApplicationDisplayName("wedge");

	a.setQuitOnLastWindowClosed(false);

	NoteWindow w;
	w.show();
	return a.exec();
}