From 2326ebfd63820b7c16d219819965c78e3836771a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 12:15:50 +0100 Subject: [PATCH] enable shmlog when invoked as i3-with-shmlog, install symlink + .desktop file --- Makefile | 2 +- common.mk | 1 + i3-with-shmlog.xsession.desktop | 5 +++++ src/i3.mk | 1 + src/main.c | 2 +- 5 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 i3-with-shmlog.xsession.desktop diff --git a/Makefile b/Makefile index b0f49e34..ff10dcb5 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ dist: distclean [ ! -d i3-${VERSION} ] || rm -rf i3-${VERSION} [ ! -e i3-${VERSION}.tar.bz2 ] || rm i3-${VERSION}.tar.bz2 mkdir i3-${VERSION} - cp i3-migrate-config-to-v4 generate-command-parser.pl i3-sensible-* i3-dmenu-desktop i3.config.keycodes DEPENDS LICENSE PACKAGE-MAINTAINER RELEASE-NOTES-${VERSION} i3.config i3.xsession.desktop i3.applications.desktop pseudo-doc.doxygen common.mk Makefile i3-${VERSION} + cp i3-migrate-config-to-v4 generate-command-parser.pl i3-sensible-* i3-dmenu-desktop i3.config.keycodes DEPENDS LICENSE PACKAGE-MAINTAINER RELEASE-NOTES-${VERSION} i3.config i3.xsession.desktop i3-with-shmlog.xsession.desktop i3.applications.desktop pseudo-doc.doxygen common.mk Makefile i3-${VERSION} cp -r src libi3 i3-msg i3-nagbar i3-config-wizard i3bar i3-dump-log yajl-fallback include man parser-specs testcases i3-${VERSION} # Only copy toplevel documentation (important stuff) mkdir i3-${VERSION}/docs diff --git a/common.mk b/common.mk index 23ac8e34..b946206d 100644 --- a/common.mk +++ b/common.mk @@ -2,6 +2,7 @@ UNAME=$(shell uname) DEBUG=1 COVERAGE=0 INSTALL=install +LN=ln ifndef PREFIX PREFIX=/usr endif diff --git a/i3-with-shmlog.xsession.desktop b/i3-with-shmlog.xsession.desktop new file mode 100644 index 00000000..8cd9431b --- /dev/null +++ b/i3-with-shmlog.xsession.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Name=i3 (with debug log) +Comment=improved dynamic tiling window manager +Exec=i3-with-shmlog +Type=Application diff --git a/src/i3.mk b/src/i3.mk index 395b4cfa..523959df 100644 --- a/src/i3.mk +++ b/src/i3.mk @@ -74,6 +74,7 @@ install-i3: i3 $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/xsessions $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/applications $(INSTALL) -m 0755 i3 $(DESTDIR)$(PREFIX)/bin/ + $(LN) -s i3 $(DESTDIR)$(PREFIX)/bin/i3-with-shmlog $(INSTALL) -m 0755 i3-migrate-config-to-v4 $(DESTDIR)$(PREFIX)/bin/ $(INSTALL) -m 0755 i3-sensible-editor $(DESTDIR)$(PREFIX)/bin/ $(INSTALL) -m 0755 i3-sensible-pager $(DESTDIR)$(PREFIX)/bin/ diff --git a/src/main.c b/src/main.c index 6028e1dd..9f92207b 100644 --- a/src/main.c +++ b/src/main.c @@ -295,7 +295,7 @@ int main(int argc, char *argv[]) { init_logging(); /* On release builds, disable SHM logging by default. */ - shmlog_size = (is_debug_build() ? default_shmlog_size : 0); + shmlog_size = (is_debug_build() || strstr(argv[0], "i3-with-shmlog") != NULL ? default_shmlog_size : 0); start_argv = argv;