Rename "dwm" to "PolytreeWM"

This commit is contained in:
Alex Kotov 2021-11-14 23:17:50 +05:00
parent 77616c75b2
commit df6d5c8598
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
10 changed files with 114 additions and 112 deletions

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
*.o *.o
/dwm /polytreewm
/dwm-*.tar.gz /polytreewm-*.tar.gz

View File

@ -1,4 +1,4 @@
# dwm - dynamic window manager # PolytreeWM - tiling window manager
# See LICENSE file for copyright and license details. # See LICENSE file for copyright and license details.
include config.mk include config.mk
@ -6,10 +6,10 @@ include config.mk
SRC = atoms.c drw.c dwm.c settings.c tags.c util.c SRC = atoms.c drw.c dwm.c settings.c tags.c util.c
OBJ = ${SRC:.c=.o} OBJ = ${SRC:.c=.o}
all: options dwm all: options polytreewm
options: options:
@echo dwm build options: @echo PolytreeWM build options:
@echo "CFLAGS = ${CFLAGS}" @echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}" @echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}" @echo "CC = ${CC}"
@ -19,43 +19,43 @@ options:
${OBJ}: atoms.h drw.h config.def.h config.mk settings.h tags.h util.h ${OBJ}: atoms.h drw.h config.def.h config.mk settings.h tags.h util.h
dwm: ${OBJ} polytreewm: ${OBJ}
${CC} -o $@ ${OBJ} ${LDFLAGS} ${CC} -o $@ ${OBJ} ${LDFLAGS}
clean: clean:
rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz rm -f polytreewm ${OBJ} polytreewm-${VERSION}.tar.gz
dist: clean dist: clean
mkdir -p dwm-${VERSION} mkdir -p polytreewm-${VERSION}
cp -R LICENSE Makefile README config.def.h config.mk \ cp -R LICENSE Makefile README.md config.def.h config.mk \
dwm.1 drw.h util.h ${SRC} dwm.png dwm-${VERSION} polytreewm.1 drw.h util.h ${SRC} polytreewm.png polytreewm-${VERSION}
tar -cf dwm-${VERSION}.tar dwm-${VERSION} tar -cf polytreewm-${VERSION}.tar polytreewm-${VERSION}
gzip dwm-${VERSION}.tar gzip polytreewm-${VERSION}.tar
rm -rf dwm-${VERSION} rm -rf polytreewm-${VERSION}
install: all install: all
mkdir -p ${DESTDIR}${PREFIX}/bin mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f dwm ${DESTDIR}${PREFIX}/bin cp -f polytreewm ${DESTDIR}${PREFIX}/bin
chmod 755 ${DESTDIR}${PREFIX}/bin/dwm chmod 755 ${DESTDIR}${PREFIX}/bin/polytreewm
mkdir -p ${DESTDIR}${MANPREFIX}/man1 mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 sed "s/VERSION/${VERSION}/g" < polytreewm.1 > ${DESTDIR}${MANPREFIX}/man1/polytreewm.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 chmod 644 ${DESTDIR}${MANPREFIX}/man1/polytreewm.1
xinstall: install xinstall: install
mkdir -p ${DESTDIR}${ICONSPREFIX} mkdir -p ${DESTDIR}${ICONSPREFIX}
cp -f dwm.png ${DESTDIR}${ICONSPREFIX} cp -f polytreewm.png ${DESTDIR}${ICONSPREFIX}
chmod 644 ${DESTDIR}${ICONSPREFIX}/dwm.png chmod 644 ${DESTDIR}${ICONSPREFIX}/polytreewm.png
mkdir -p ${DESTDIR}${XSESSIONSPREFIX} mkdir -p ${DESTDIR}${XSESSIONSPREFIX}
cp -f dwm.desktop ${DESTDIR}${XSESSIONSPREFIX} cp -f polytreewm.desktop ${DESTDIR}${XSESSIONSPREFIX}
chmod 644 ${DESTDIR}${XSESSIONSPREFIX}/dwm.desktop chmod 644 ${DESTDIR}${XSESSIONSPREFIX}/polytreewm.desktop
uninstall: uninstall:
rm -f \ rm -f \
${DESTDIR}${PREFIX}/bin/dwm \ ${DESTDIR}${PREFIX}/bin/polytreewm \
${DESTDIR}${MANPREFIX}/man1/dwm.1 \ ${DESTDIR}${MANPREFIX}/man1/polytreewm.1 \
${DESTDIR}${ICONSPREFIX}/dwm.png \ ${DESTDIR}${ICONSPREFIX}/polytreewm.png \
${DESTDIR}${XSESSIONSPREFIX}/dwm.desktop ${DESTDIR}${XSESSIONSPREFIX}/polytreewm.desktop
.PHONY: all options clean dist install uninstall .PHONY: all options clean dist install uninstall

48
README
View File

@ -1,48 +0,0 @@
dwm - dynamic window manager
============================
dwm is an extremely fast, small, and dynamic window manager for X.
Requirements
------------
In order to build dwm you need the Xlib header files.
Installation
------------
Edit config.mk to match your local setup (dwm is installed into
the /usr/local namespace by default).
Afterwards enter the following command to build and install dwm (if
necessary as root):
make clean install
Running dwm
-----------
Add the following line to your .xinitrc to start dwm using startx:
exec dwm
In order to connect dwm to a specific display, make sure that
the DISPLAY environment variable is set correctly, e.g.:
DISPLAY=foo.bar:1 exec dwm
(This will start dwm on display :1 of the host foo.bar.)
In order to display status info in the bar, you can do something
like this in your .xinitrc:
while xsetroot -name "`date` `uptime | sed 's/.*,//'`"
do
sleep 1
done &
exec dwm
Configuration
-------------
The configuration of dwm is done by creating a custom config.h
and (re)compiling the source code.

View File

@ -1,3 +1,53 @@
PolytreeWM - tiling window manager
==================================
PolytreeWM is an extremely fast, small, and dynamic window manager for X.
Requirements
------------
In order to build PolytreeWM you need the Xlib header files.
Installation
------------
Edit config.mk to match your local setup (PolytreeWM is installed into the
/usr/local namespace by default).
Afterwards enter the following command to build and install PolytreeWM (if
necessary as root):
make clean install
Running
-------
Add the following line to your .xinitrc to start PolytreeWM using startx:
exec polytreewm
In order to connect PolytreeWM to a specific display, make sure that the DISPLAY
environment variable is set correctly, e.g.:
DISPLAY=foo.bar:1 exec polytreewm
(This will start PolytreeWM on display :1 of the host foo.bar.)
In order to display status info in the bar, you can do something
like this in your .xinitrc:
while xsetroot -name "`date` `uptime | sed 's/.*,//'`"
do
sleep 1
done &
exec polytreewm
Configuration
-------------
The configuration of PolytreeWM is done by creating a custom config.h and
(re)compiling the source code.
Applied patches Applied patches
--------------- ---------------

View File

@ -1,4 +1,4 @@
# dwm version # PolytreeWM version
VERSION = 6.2 VERSION = 6.2
# Customize below to fit your system # Customize below to fit your system

40
dwm.c
View File

@ -1,12 +1,12 @@
/* See LICENSE file for copyright and license details. /* See LICENSE file for copyright and license details.
* *
* dynamic window manager is designed like any other X client as well. It is * Polytree tiling window manager is designed like any other X client as well.
* driven through handling X events. In contrast to other X clients, a window * It is driven through handling X events. In contrast to other X clients, a
* manager selects for SubstructureRedirectMask on the root window, to receive * window manager selects for SubstructureRedirectMask on the root window, to
* events about window (dis-)appearance. Only one X connection at a time is * receive events about window (dis-)appearance. Only one X connection at a time
* allowed to select for this event mask. * is allowed to select for this event mask.
* *
* The event handlers of dwm are organized in an array which is accessed * The event handlers of PolytreeWM are organized in an array which is accessed
* whenever a new event has been fetched. This allows event dispatching * whenever a new event has been fetched. This allows event dispatching
* in O(1) time. * in O(1) time.
* *
@ -1481,13 +1481,13 @@ nametag(const Arg *arg) {
errno = 0; // popen(3p) says on failure it "may" set errno errno = 0; // popen(3p) says on failure it "may" set errno
if(!(f = popen("dmenu < /dev/null", "r"))) { if(!(f = popen("dmenu < /dev/null", "r"))) {
fprintf(stderr, "dwm: popen 'dmenu < /dev/null' failed%s%s\n", errno ? ": " : "", errno ? strerror(errno) : ""); fprintf(stderr, "polytreewm: popen 'dmenu < /dev/null' failed%s%s\n", errno ? ": " : "", errno ? strerror(errno) : "");
return; return;
} }
if (!(p = fgets(name, TAGS_CUSTOM_NAME_SIZE, f)) && (i = errno) && ferror(f)) if (!(p = fgets(name, TAGS_CUSTOM_NAME_SIZE, f)) && (i = errno) && ferror(f))
fprintf(stderr, "dwm: fgets failed: %s\n", strerror(i)); fprintf(stderr, "polytreewm: fgets failed: %s\n", strerror(i));
if (pclose(f) < 0) if (pclose(f) < 0)
fprintf(stderr, "dwm: pclose failed: %s\n", strerror(errno)); fprintf(stderr, "polytreewm: pclose failed: %s\n", strerror(errno));
if(!p) if(!p)
return; return;
if((p = strchr(name, '\n'))) if((p = strchr(name, '\n')))
@ -1994,7 +1994,7 @@ setup(void)
updategeom(); updategeom();
/* init atoms */ /* init atoms */
atoms = atoms_create(dpy); atoms = atoms_create(dpy);
if (atoms == NULL) die("dwm: fatal: cannot allocate atoms"); if (atoms == NULL) die("polytreewm: fatal: cannot allocate atoms");
/* init cursors */ /* init cursors */
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
cursor[CurResize] = drw_cur_create(drw, XC_sizing); cursor[CurResize] = drw_cur_create(drw, XC_sizing);
@ -2013,7 +2013,7 @@ setup(void)
XChangeProperty(dpy, wmcheckwin, atoms->netatom[NetWMCheck], XA_WINDOW, 32, XChangeProperty(dpy, wmcheckwin, atoms->netatom[NetWMCheck], XA_WINDOW, 32,
PropModeReplace, (unsigned char *) &wmcheckwin, 1); PropModeReplace, (unsigned char *) &wmcheckwin, 1);
XChangeProperty(dpy, wmcheckwin, atoms->netatom[NetWMName], atoms->utf8string, 8, XChangeProperty(dpy, wmcheckwin, atoms->netatom[NetWMName], atoms->utf8string, 8,
PropModeReplace, (unsigned char *) "dwm", 3); PropModeReplace, (unsigned char *) "polytreewm", 3);
XChangeProperty(dpy, root, atoms->netatom[NetWMCheck], XA_WINDOW, 32, XChangeProperty(dpy, root, atoms->netatom[NetWMCheck], XA_WINDOW, 32,
PropModeReplace, (unsigned char *) &wmcheckwin, 1); PropModeReplace, (unsigned char *) &wmcheckwin, 1);
/* EWMH support per view */ /* EWMH support per view */
@ -2081,7 +2081,7 @@ spawn(const Arg *arg)
close(ConnectionNumber(dpy)); close(ConnectionNumber(dpy));
setsid(); setsid();
execvp(((char **)arg->v)[0], (char **)arg->v); execvp(((char **)arg->v)[0], (char **)arg->v);
fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]); fprintf(stderr, "polytreewm: execvp %s", ((char **)arg->v)[0]);
perror(" failed"); perror(" failed");
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
@ -2298,7 +2298,7 @@ updatebars(void)
.background_pixmap = ParentRelative, .background_pixmap = ParentRelative,
.event_mask = ButtonPressMask|ExposureMask .event_mask = ButtonPressMask|ExposureMask
}; };
XClassHint ch = {"dwm", "dwm"}; XClassHint ch = {"polytreewm", "polytreewm"};
for (m = mons; m; m = m->next) { for (m = mons; m; m = m->next) {
if (m->barwin) if (m->barwin)
continue; continue;
@ -2484,7 +2484,7 @@ void
updatestatus(void) updatestatus(void)
{ {
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) { if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) {
strcpy(stext, "dwm-"VERSION); strcpy(stext, "polytreewm-"VERSION);
} }
for (Monitor *m = mons; m; m = m->next) { for (Monitor *m = mons; m; m = m->next) {
@ -2579,7 +2579,7 @@ updatesystray(void)
XSync(dpy, False); XSync(dpy, False);
} }
else { else {
fprintf(stderr, "dwm: unable to obtain system tray.\n"); fprintf(stderr, "polytreewm: unable to obtain system tray.\n");
free(systray); free(systray);
systray = NULL; systray = NULL;
return; return;
@ -2791,7 +2791,7 @@ xerror(Display *dpy, XErrorEvent *ee)
|| (ee->request_code == X_GrabKey && ee->error_code == BadAccess) || (ee->request_code == X_GrabKey && ee->error_code == BadAccess)
|| (ee->request_code == X_CopyArea && ee->error_code == BadDrawable)) || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable))
return 0; return 0;
fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", fprintf(stderr, "polytreewm: fatal error: request code=%d, error code=%d\n",
ee->request_code, ee->error_code); ee->request_code, ee->error_code);
return xerrorxlib(dpy, ee); /* may call exit */ return xerrorxlib(dpy, ee); /* may call exit */
} }
@ -2807,7 +2807,7 @@ xerrordummy(Display *dpy, XErrorEvent *ee)
int int
xerrorstart(Display *dpy, XErrorEvent *ee) xerrorstart(Display *dpy, XErrorEvent *ee)
{ {
die("dwm: another window manager is already running"); die("polytreewm: another window manager is already running");
return -1; return -1;
} }
@ -2845,11 +2845,11 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
if (argc == 2 && !strcmp("-v", argv[1])) { if (argc == 2 && !strcmp("-v", argv[1])) {
die("dwm-"VERSION); die("polytreewm-"VERSION);
} }
if (argc != 1) { if (argc != 1) {
die("usage: dwm [-v]"); die("usage: polytreewm [-v]");
} }
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) { if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) {
@ -2857,7 +2857,7 @@ main(int argc, char *argv[])
} }
if (!(dpy = XOpenDisplay(NULL))) { if (!(dpy = XOpenDisplay(NULL))) {
die("dwm: cannot open display"); die("polytreewm: cannot open display");
} }
checkotherwm(); checkotherwm();

View File

@ -1,7 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Name=dwm
Comment=Dynamic Window Manager
Exec=dwm
Icon=dwm
Type=XSession

View File

@ -1,13 +1,13 @@
.TH DWM 1 dwm\-VERSION .TH POLYTREEWM 1 polytreewm\-VERSION
.SH NAME .SH NAME
dwm \- dynamic window manager PolytreeWM \- Polytree tiling window manager
.SH SYNOPSIS .SH SYNOPSIS
.B dwm .B polytreewm
.RB [ \-v ] .RB [ \-v ]
.SH DESCRIPTION .SH DESCRIPTION
dwm is a dynamic window manager for X. It manages windows in tiled, monocle PolytreeWM is a tiling window manager for X. It manages windows in monocle,
and floating layouts. Either layout can be applied dynamically, optimising the floating and tiled layouts. Either layout can be applied dynamically, optimising
environment for the application in use and the task performed. the environment for the application in use and the task performed.
.P .P
In tiled layouts windows are managed in a master and stacking area. The master In tiled layouts windows are managed in a master and stacking area. The master
area on the left contains one window by default, and the stacking area on the area on the left contains one window by default, and the stacking area on the
@ -29,7 +29,7 @@ color. The tags of the focused window are indicated with a filled square in the
top left corner. The tags which are applied to one or more windows are top left corner. The tags which are applied to one or more windows are
indicated with an empty square in the top left corner. indicated with an empty square in the top left corner.
.P .P
dwm draws a small border around windows to indicate the focus state. PolytreeWM draws a small border around windows to indicate the focus state.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-v .B \-v
@ -141,7 +141,7 @@ View all windows with any tag.
Add/remove all windows with nth tag to/from the view. Add/remove all windows with nth tag to/from the view.
.TP .TP
.B Mod1\-Shift\-q .B Mod1\-Shift\-q
Quit dwm. Quit PolytreeWM.
.SS Mouse commands .SS Mouse commands
.TP .TP
.B Mod1\-Button1 .B Mod1\-Button1
@ -153,8 +153,8 @@ Toggles focused window between floating and tiled state.
.B Mod1\-Button3 .B Mod1\-Button3
Resize focused window while dragging. Tiled windows will be toggled to the floating state. Resize focused window while dragging. Tiled windows will be toggled to the floating state.
.SH CUSTOMIZATION .SH CUSTOMIZATION
dwm is customized by creating a custom config.h and (re)compiling the source PolytreeWM is customized by creating a custom config.h and (re)compiling the
code. This keeps it fast, secure and simple. source code. This keeps it fast, secure and simple.
.SH SEE ALSO .SH SEE ALSO
.BR dmenu (1), .BR dmenu (1),
.BR st (1) .BR st (1)
@ -173,4 +173,4 @@ or
XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable
.BR _JAVA_AWT_WM_NONREPARENTING=1 . .BR _JAVA_AWT_WM_NONREPARENTING=1 .
.SH BUGS .SH BUGS
Send all bug reports with a patch to hackers@suckless.org. Send all bug reports with a patch to kotovalexarian@gmail.com.

7
polytreewm.desktop Normal file
View File

@ -0,0 +1,7 @@
[Desktop Entry]
Encoding=UTF-8
Name=PolytreeWM
Comment=Polytree window manager
Exec=polytreewm
Icon=polytreewm
Type=XSession

View File

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 373 B