Skip to content

Commit b12990f

Browse files
committed
Initial Config
0 parents  commit b12990f

File tree

19 files changed

+1999
-0
lines changed

19 files changed

+1999
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.o
2+
dmenu

LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
MIT/X Consortium License
2+
3+
© 2006-2019 Anselm R Garbe <[email protected]>
4+
© 2006-2008 Sander van Dijk <[email protected]>
5+
© 2006-2007 Michał Janeczek <[email protected]>
6+
© 2007 Kris Maglione <[email protected]>
7+
© 2009 Gottox <[email protected]>
8+
© 2009 Markus Schnalke <[email protected]>
9+
© 2009 Evan Gates <[email protected]>
10+
© 2010-2012 Connor Lane Smith <[email protected]>
11+
© 2014-2022 Hiltjo Posthuma <[email protected]>
12+
© 2015-2019 Quentin Rameau <[email protected]>
13+
14+
Permission is hereby granted, free of charge, to any person obtaining a
15+
copy of this software and associated documentation files (the "Software"),
16+
to deal in the Software without restriction, including without limitation
17+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
18+
and/or sell copies of the Software, and to permit persons to whom the
19+
Software is furnished to do so, subject to the following conditions:
20+
21+
The above copyright notice and this permission notice shall be included in
22+
all copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30+
DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# dmenu - dynamic menu
2+
# See LICENSE file for copyright and license details.
3+
4+
include config.mk
5+
6+
SRC = drw.c dmenu.c stest.c util.c
7+
OBJ = $(SRC:.c=.o)
8+
9+
all: dmenu stest
10+
11+
.c.o:
12+
$(CC) -c $(CFLAGS) $<
13+
14+
config.h:
15+
cp config.def.h $@
16+
17+
$(OBJ): arg.h config.h config.mk drw.h
18+
19+
dmenu: dmenu.o drw.o util.o
20+
$(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
21+
22+
stest: stest.o
23+
$(CC) -o $@ stest.o $(LDFLAGS)
24+
25+
clean:
26+
rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz
27+
28+
dist: clean
29+
mkdir -p dmenu-$(VERSION)
30+
cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\
31+
drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\
32+
dmenu-$(VERSION)
33+
tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
34+
gzip dmenu-$(VERSION).tar
35+
rm -rf dmenu-$(VERSION)
36+
37+
install: all
38+
mkdir -p $(DESTDIR)$(PREFIX)/bin
39+
cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
40+
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
41+
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
42+
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
43+
chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
44+
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
45+
sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
46+
sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
47+
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
48+
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1
49+
50+
uninstall:
51+
rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
52+
$(DESTDIR)$(PREFIX)/bin/dmenu_path\
53+
$(DESTDIR)$(PREFIX)/bin/dmenu_run\
54+
$(DESTDIR)$(PREFIX)/bin/stest\
55+
$(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
56+
$(DESTDIR)$(MANPREFIX)/man1/stest.1
57+
58+
.PHONY: all clean dist install uninstall

README

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
dmenu - dynamic menu
2+
====================
3+
dmenu is an efficient dynamic menu for X.
4+
5+
6+
Requirements
7+
------------
8+
In order to build dmenu you need the Xlib header files.
9+
10+
11+
Installation
12+
------------
13+
Edit config.mk to match your local setup (dmenu is installed into
14+
the /usr/local namespace by default).
15+
16+
Afterwards enter the following command to build and install dmenu
17+
(if necessary as root):
18+
19+
make clean install
20+
21+
22+
Running dmenu
23+
-------------
24+
See the man page for details.

arg.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copy me if you can.
3+
* by 20h
4+
*/
5+
6+
#ifndef ARG_H__
7+
#define ARG_H__
8+
9+
extern char *argv0;
10+
11+
/* use main(int argc, char *argv[]) */
12+
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
13+
argv[0] && argv[0][0] == '-'\
14+
&& argv[0][1];\
15+
argc--, argv++) {\
16+
char argc_;\
17+
char **argv_;\
18+
int brk_;\
19+
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
20+
argv++;\
21+
argc--;\
22+
break;\
23+
}\
24+
for (brk_ = 0, argv[0]++, argv_ = argv;\
25+
argv[0][0] && !brk_;\
26+
argv[0]++) {\
27+
if (argv_ != argv)\
28+
break;\
29+
argc_ = argv[0][0];\
30+
switch (argc_)
31+
32+
#define ARGEND }\
33+
}
34+
35+
#define ARGC() argc_
36+
37+
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
38+
((x), abort(), (char *)0) :\
39+
(brk_ = 1, (argv[0][1] != '\0')?\
40+
(&argv[0][1]) :\
41+
(argc--, argv++, argv[0])))
42+
43+
#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\
44+
(char *)0 :\
45+
(brk_ = 1, (argv[0][1] != '\0')?\
46+
(&argv[0][1]) :\
47+
(argc--, argv++, argv[0])))
48+
49+
#endif

config.def.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* See LICENSE file for copyright and license details. */
2+
/* Default settings; can be overriden by command line. */
3+
4+
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
5+
/* -fn option overrides fonts[0]; default X11 font or font set */
6+
static const char *fonts[] = {
7+
"monospace:size=10"
8+
};
9+
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
10+
static const char *colors[SchemeLast][2] = {
11+
/* fg bg */
12+
[SchemeNorm] = { "#bbbbbb", "#222222" },
13+
[SchemeSel] = { "#eeeeee", "#005577" },
14+
[SchemeOut] = { "#000000", "#00ffff" },
15+
};
16+
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
17+
static unsigned int lines = 0;
18+
19+
/*
20+
* Characters not considered part of a word while deleting words
21+
* for example: " /?\"&[]"
22+
*/
23+
static const char worddelimiters[] = " ";

config.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* See LICENSE file for copyright and license details. */
2+
/* Default settings; can be overriden by command line. */
3+
4+
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
5+
/* -fn option overrides fonts[0]; default X11 font or font set */
6+
static const char *fonts[] = {
7+
"JetBrains Mono:size=10"
8+
};
9+
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
10+
static const char *colors[SchemeLast][2] = {
11+
/* fg bg */
12+
[SchemeNorm] = { "#bbbbbb", "#222222" },
13+
[SchemeSel] = { "#eeeeee", "#005577" },
14+
[SchemeOut] = { "#000000", "#00ffff" },
15+
};
16+
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
17+
static unsigned int lines = 0;
18+
19+
/*
20+
* Characters not considered part of a word while deleting words
21+
* for example: " /?\"&[]"
22+
*/
23+
static const char worddelimiters[] = " ";

config.mk

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# dmenu version
2+
VERSION = 5.2
3+
4+
# paths
5+
PREFIX = /usr/local
6+
MANPREFIX = $(PREFIX)/share/man
7+
8+
X11INC = /usr/X11R6/include
9+
X11LIB = /usr/X11R6/lib
10+
11+
# Xinerama, comment if you don't want it
12+
XINERAMALIBS = -lXinerama
13+
XINERAMAFLAGS = -DXINERAMA
14+
15+
# freetype
16+
FREETYPELIBS = -lfontconfig -lXft
17+
FREETYPEINC = /usr/include/freetype2
18+
# OpenBSD (uncomment)
19+
#FREETYPEINC = $(X11INC)/freetype2
20+
#MANPREFIX = ${PREFIX}/man
21+
22+
# includes and libs
23+
INCS = -I$(X11INC) -I$(FREETYPEINC)
24+
LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS)
25+
26+
# flags
27+
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS)
28+
CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS)
29+
LDFLAGS = $(LIBS)
30+
31+
# compiler and linker
32+
CC = cc

0 commit comments

Comments
 (0)