Take this opportunity to move the default config file path from ~/.ratpoisonrc to $XDG_CONFIG_HOME/sdorfehs/config and the bar fifo path to $XDG_CONFIG_HOME/sdorfehs/bar
···2929#include <X11/extensions/XTest.h>
3030#include <sys/ioctl.h>
31313232-#include "ratpoison.h"
3232+#include "sdorfehs.h"
33333434/* arg_REST and arg_SHELLCMD eat the rest of the input. */
3535enum argtype {
···31943194 show_frame_message(defaults.resize_fmt);
31953195 read_key(&c, &mod, buffer, sizeof(buffer));
3196319631973197- /* Convert the mask to be compatible with ratpoison. */
31973197+ /* Convert the mask to be compatible with us. */
31983198 mod = x11_mask_to_rp_mask(mod);
3199319932003200 for (binding = resize_bindings; binding->action; binding++) {
+4-4
actions.h
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#ifndef _RATPOISON_ACTIONS_H
2121-#define _RATPOISON_ACTIONS_H 1
2020+#ifndef _SDORFEHS_ACTIONS_H
2121+#define _SDORFEHS_ACTIONS_H 1
22222323-#include "ratpoison.h"
2323+#include "sdorfehs.h"
24242525/* The structure returned by a command. */
2626typedef struct cmdret {
···4444rp_action *find_keybinding(KeySym keysym, unsigned int state, rp_keymap *map);
4545rp_action *find_keybinding_by_action(char *action, rp_keymap *map);
46464747-#endif /* ! _RATPOISON_ACTIONS_H */
4747+#endif /* ! _SDORFEHS_ACTIONS_H */
···11/*
22- * communications.c -- Send commands to a running copy of ratpoison.
22+ * communications.c -- Send commands to a running copy of sdorfehs.
33 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca>
44 *
55 * This program is free software; you can redistribute it and/or modify it
···25252626#include <string.h>
27272828-#include "ratpoison.h"
2828+#include "sdorfehs.h"
29293030-/* Sending commands to ratpoison */
3030+/* Sending commands to us from another process */
3131static int
3232receive_command_result(Window w)
3333{
+4-4
communications.h
···11/*
22- * communications.h -- Send commands to a running copy of ratpoison.
22+ * communications.h -- Send commands to a running copy of sdorfehs.
33 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca>
44 *
55 * This program is free software; you can redistribute it and/or modify it
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#ifndef _RATPOISON_COMMUNICATIONS_H
2121-#define _RATPOISON_COMMUNICATIONS_H 1
2020+#ifndef _SDORFEHS_COMMUNICATIONS_H
2121+#define _SDORFEHS_COMMUNICATIONS_H 1
22222323int send_command(unsigned char interactive, unsigned char *cmd);
24242525-#endif /* ! _RATPOISON_COMMUNICATIONS_H */
2525+#endif /* ! _SDORFEHS_COMMUNICATIONS_H */
+1-2
completions.c
···1616 * Place, Suite 330, Boston, MA 02111-1307 USA.
1717 */
18181919-#define _GNU_SOURCE
2019#include <string.h>
21202222-#include "ratpoison.h"
2121+#include "sdorfehs.h"
2322#include "completions.h"
24232524rp_completions *
···11/*
22- * Config file for ratpoison. Edit these values and recompile.
22+ * Config file. Edit these values and recompile.
33 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca>
44 *
55 * This program is free software; you can redistribute it and/or modify it
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#ifndef _RATPOISON_CONF_H
2121-#define _RATPOISON_CONF_H 1
2020+#ifndef _SDORFEHS_CONF_H
2121+#define _SDORFEHS_CONF_H 1
22222323#include "data.h"
2424#include "actions.h"
25252626-#define PROGNAME "ratpoison"
2727-#define VERSION "20190816"
2626+#define PROGNAME "sdorfehs"
2727+#define VERSION "20190822"
28282929/* Enter command mode with Control+T by default. */
3030#define KEY_PREFIX XK_t
···9494#define MAX_LINK_DEPTH 16
95959696/*
9797- * Bad window messages can be safely ignored now that ratpoison has become
9898- * stable enough. Comment this line if you wish to be notified about bad window
9797+ * Bad window messages can be safely ignored now that we have become stable
9898+ * enough. Comment this line if you wish to be notified about bad window
9999 * messages.
100100 */
101101#define IGNORE_BADWINDOW 1
···107107#define MAX_HISTORY_SIZE 100
108108109109/* The default filename in which to store the history */
110110-#define HISTORY_FILE ".ratpoison_history"
110110+#define HISTORY_FILE "history"
111111112112/* The name of the root keymap */
113113#define ROOT_KEYMAP "root"
···118118/* The default font */
119119#define DEFAULT_XFT_FONT "monospace:size=12"
120120121121-#endif /* !_ _RATPOISON_CONF_H */
121121+#endif /* !_ _SDORFEHS_CONF_H */
+3-3
data.h
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#ifndef _RATPOISON_DATA_H
2121-#define _RATPOISON_DATA_H
2020+#ifndef _SDORFEHS_DATA_H
2121+#define _SDORFEHS_DATA_H
22222323#include "linkedlist.h"
2424#include "number.h"
···476476 int len;
477477};
478478479479-#endif /* _RATPOISON_DATA_H */
479479+#endif /* _SDORFEHS_DATA_H */
···11/*
22- * Ratpoison X events
22+ * X events
33 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca>
44 *
55 * This program is free software; you can redistribute it and/or modify it
···3535#include <sys/time.h>
3636#include <sys/wait.h>
37373838-#include "ratpoison.h"
3838+#include "sdorfehs.h"
39394040/*
4141 * The event currently being processed. Mostly used in functions from action.c
+3-3
events.h
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#ifndef _RATPOISON_EVENTS_H
2121-#define _RATPOISON_EVENTS_H 1
2020+#ifndef _SDORFEHS_EVENTS_H
2121+#define _SDORFEHS_EVENTS_H 1
22222323void listen_for_events(void);
2424void show_rudeness_msg(rp_window *win, int raised);
25252626-#endif /* _RATPOISON_EVENTS_H */
2626+#endif /* _SDORFEHS_EVENTS_H */
+1-1
format.c
···2020#include <stdio.h>
2121#include <stdlib.h>
2222#include <string.h>
2323-#include "ratpoison.h"
2323+#include "sdorfehs.h"
24242525/* Function prototypes for format char expanders. */
2626#define RP_FMT(fn) static void fmt_ ## fn (rp_window_elem *elem, struct sbuf *buf)
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#include "ratpoison.h"
2020+#include "sdorfehs.h"
21212222#include <string.h>
2323
+53-1
globals.c
···1616 * Place, Suite 330, Boston, MA 02111-1307 USA.
1717 */
18181919-#include "ratpoison.h"
1919+#include "sdorfehs.h"
20202121#include <sys/types.h>
2222#include <sys/wait.h>
···2626#include <pwd.h>
2727#include <signal.h>
2828#include <unistd.h>
2929+#include <dirent.h>
29303031/*
3132 * Several systems seem not to have WAIT_ANY defined, so define it if it isn't.
···463464 }
464465465466 return homedir;
467467+}
468468+469469+char *
470470+get_config_dir(void)
471471+{
472472+ DIR *d;
473473+ const char *homedir;
474474+ char *xdg_config, *home_config;
475475+476476+ homedir = get_homedir();
477477+ if (!homedir) {
478478+ PRINT_ERROR(("no home directory\n"));
479479+ exit(EXIT_FAILURE);
480480+ }
481481+482482+ xdg_config = getenv("XDG_CONFIG_HOME");
483483+ if (xdg_config == NULL || !strlen(xdg_config))
484484+ xdg_config = xsprintf("%s/.config", homedir);
485485+486486+ if (!(d = opendir(xdg_config))) {
487487+ if (mkdir(xdg_config, 0755) == -1) {
488488+ PRINT_ERROR(("failed creating %s: %s\n", xdg_config,
489489+ strerror(errno)));
490490+ exit(EXIT_FAILURE);
491491+ }
492492+ if (!(d = opendir(xdg_config))) {
493493+ PRINT_ERROR(("failed opening %s: %s\n", xdg_config,
494494+ strerror(errno)));
495495+ exit(EXIT_FAILURE);
496496+ }
497497+ }
498498+ closedir(d);
499499+500500+ home_config = xsprintf("%s/sdorfehs", xdg_config);
501501+ if (!(d = opendir(home_config))) {
502502+ if (mkdir(home_config, 0755) == -1) {
503503+ PRINT_ERROR(("failed creating %s: %s\n", home_config,
504504+ strerror(errno)));
505505+ exit(EXIT_FAILURE);
506506+ }
507507+ if (!(d = opendir(home_config))) {
508508+ PRINT_ERROR(("failed opening %s: %s\n", home_config,
509509+ strerror(errno)));
510510+ exit(EXIT_FAILURE);
511511+ }
512512+ }
513513+ closedir(d);
514514+515515+ free(xdg_config);
516516+517517+ return home_config;
466518}
467519468520void
+3-2
globals.h
···159159 */
160160extern int ignore_badwindow;
161161162162-/* Arguments passed to ratpoison. */
162162+/* Arguments passed at startup. */
163163extern char **myargv;
164164165165/* Keeps track of which mod mask each modifier is under. */
166166extern struct modifier_info rp_modifier_info;
167167168168/*
169169- * nonzero if an alarm signal was raised. This means ratpoison should hide its
169169+ * nonzero if an alarm signal was raised. This means we should hide our
170170 * popup windows.
171171 */
172172extern int alarm_signalled;
···222222void set_close_on_exec(int fd);
223223void read_rc_file(FILE *file);
224224const char *get_homedir(void);
225225+char *get_config_dir(void);
225226void clean_up(void);
226227227228void register_atom(Atom *a, char *name);
+1-1
group.c
···1616 * Place, Suite 330, Boston, MA 02111-1307 USA.
1717 */
18181919-#include "ratpoison.h"
1919+#include "sdorfehs.h"
20202121#include <string.h>
2222
···2020 * A hook is simply a list of strings that get passed to command() in sequence.
2121 */
22222323-#include "ratpoison.h"
2323+#include "sdorfehs.h"
24242525#include <string.h>
2626
+1-1
input.c
···2626#include <X11/Xutil.h>
2727#include <X11/XKBlib.h>
28282929-#include "ratpoison.h"
2929+#include "sdorfehs.h"
30303131/*
3232 * Convert an X11 modifier mask to the rp modifier mask equivalent, as best it
+3-3
input.h
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#ifndef _RATPOISON_INPUT_H
2121-#define _RATPOISON_INPUT_H 1
2020+#ifndef _SDORFEHS_INPUT_H
2121+#define _SDORFEHS_INPUT_H 1
22222323char *keysym_to_string(KeySym keysym, unsigned int modifier);
2424int cook_keycode(XKeyEvent *ev, KeySym *keysym, unsigned int *mod,
···37373838void init_xkb(void);
39394040-#endif /* ! _RATPOISON_INPUT_H */
4040+#endif /* ! _SDORFEHS_INPUT_H */
+2-2
linkedlist.h
···2020 * Place, Suite 330, Boston, MA 02111-1307 USA.
2121 */
22222323-#ifndef _RATPOISON_LINKLIST_H
2424-#define _RATPOISON_LINKLIST_H
2323+#ifndef _SDORFEHS_LINKLIST_H
2424+#define _SDORFEHS_LINKLIST_H
25252626#include <string.h>
2727
···11/*
22- * Ratpoison messages.
22+ * Messages.
33 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca>
44 *
55 * This program is free software; you can redistribute it and/or modify it
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#ifndef _RATPOISON_MESSAGES_H
2121-#define _RATPOISON_MESSAGES_H 1
2020+#ifndef _SDORFEHS_MESSAGES_H
2121+#define _SDORFEHS_MESSAGES_H 1
22222323#define MESSAGE_NO_OTHER_WINDOW "No other window"
2424#define MESSAGE_NO_OTHER_FRAME "No other frame"
2525#define MESSAGE_NO_MANAGED_WINDOWS "No managed windows"
2626-#define MESSAGE_UNKNOWN_COMMAND "unknown command '%s'"
2626+#define MESSAGE_UNKNOWN_COMMAND "Unknown command '%s'"
2727#define MESSAGE_WINDOW_INFORMATION "This is window %d (%s)"
28282929#define MESSAGE_RAISE_TRANSIENT "Raise request from transient window %d (%s)"
···4848#define MESSAGE_PROMPT_SELECT_VAR "Variable: "
4949#define MESSAGE_PROMPT_VAR_VALUE "Value: "
50505151-#define MESSAGE_WELCOME PROGNAME " " VERSION " - press \"%s %s\" for help"
5151+#define MESSAGE_WELCOME "Welcome to " PROGNAME " - press \"%s %s\" for help"
52525353#define EMPTY_FRAME_MESSAGE "Current Frame"
54545555-#endif /* ! _RATPOISON_MESSAGES_H */
5555+#endif /* ! _SDORFEHS_MESSAGES_H */
+1-1
number.c
···2020#include <stdlib.h>
2121#include <stdio.h>
22222323-#include "ratpoison.h"
2323+#include "sdorfehs.h"
24242525/* Keep track of a set of numbers. For frames and windows. */
2626struct numset {
···2121.\" [2] http://mdocml.bsd.lv/
2222.\" [3] http://mdocml.bsd.lv/mdoc.7.html
2323.\"
2424-.Dd Aug 22, 2017
2525-.Dt RATPOISON 1
2424+.Dd Aug 22, 2019
2525+.Dt SDORFEHS 1
2626.Os
2727.Sh NAME
2828-.Nm ratpoison
2828+.Nm sdorfehs
2929.Nd window manager without mouse dependency
3030.Sh SYNOPSIS
3131.Nm
3232-.Op Fl hv
3232+.Op Fl h
3333.Nm
3434.Op Fl d Ar dpy
3535.Op Fl s Ar num
···4141.Fl c Ar command Op Fl c Ar command ...
4242.Sh DESCRIPTION
4343.Nm
4444-is a Window Manager without fat library dependencies, fancy graphics or
4545-rat dependence.
4444+is a window manager without fat library dependencies, fancy graphics or
4545+dependence on a mouse.
4646.Pp
4747The screen can be split into non-overlapping frames.
4848All windows are kept maximized inside their frames.
4949.Pp
5050-All interaction with the window manager is done through
5151-keystrokes.
5050+All interaction with the window manager is done through keystrokes.
5251.Nm
5352has a prefix map to minimize key clobbering.
5453.Pp
5554The options are as follows:
5655.Bl -tag -width Bs
5756.It Fl c , Fl \-command
5858-Send ratpoison a command.
5959-There must be a ratpoison instance running as window manager for the
6060-given display/screen for this to work.
5757+Send
5858+.Nm
5959+a command.
6060+There must be a
6161+.Nm
6262+instance running as window manager for the given display/screen for this to
6363+work.
6164Do not forget to quote the command if it contains spaces.
6265For example:
6366.Dl Nm Fl c Qq Ar "echo hello world"
···6871If this is not given,
6972.Nm
7073will try
7171-.Pa $HOME/.ratpoisonrc
7272-and if that does not exist
7373-.Pa /etc/ratpoisonrc
7474+.Pa $HOME/.config/sdorfehs/config
7475and execute each command when starting up.
7576.It Fl h , Fl \-help
7677Show summary of options.
···8586like prompting for missing arguments and things like that.
8687.It Fl s , Fl \-screen Ar number
8788Only use the specified screen.
8888-.It Fl v , Fl \-version
8989-Show version of program.
9089.El
9190.Sh KEY BINDINGS
9292-To avoid conflicts with other programs, all default ratpoison key
9393-bindings start with an escape key which, by default, is
9191+To avoid conflicts with other programs, all default
9292+.Nm
9393+key bindings start with an escape key which, by default, is
9494.Ic C\-t
9595(Control\-t).
9696Some important default key bindings:
···116116.It Ic C\-t Q
117117Make the current frame the only one
118118.It Ic C\-t \&:
119119-Execute a ratpoison command
119119+Execute a
120120+.Nm
121121+command
120122.El
121123.Pp
122124Further default key bindings can be found in parentheses after the
···180182If there isn't a window in the current frame, it banishes the rat cursor
181183to the lower right corner of the frame.
182184.It Ic chdir Op Ar directory
183183-If the optional argument is given, change the current directory
184184-of
185185+If the optional argument is given, change the current directory of
185186.Nm
186187to
187188.Ar directory .
···203204current one.
204205(That means the previous window belonging to another type of application
205206than the current one.)
206206-.It Ic colon Ar ratpoison\-command Pq Ic C\-t \&:
207207+.It Ic colon Ar sdorfehs\-command Pq Ic C\-t \&:
207208Execute
208208-.Ar ratpoison\-command
209209+.Ar sdorfehs\-command
209210interactively.
210211(i.e. ask for possible missing arguments.)
211212.It Ic cother
···11881189.Li title .
11891190.El
11901191.Sh FILES
11911191-.Bl -tag -width "%%sysconfdir%%/ratpoisonrc" -compact
11921192-.It Pa ~/.ratpoisonrc
11921192+.Bl -tag -compact
11931193+.It Pa ~/.config/sdorfehs/config
11931194Configuration file read at startup time, if present.
11941194-.It Pa %%sysconfdir%%/ratpoisonrc
11951195-Fallback configuration file, if
11961196-.Pa ~/.ratpoisonrc
11971197-is not found.
11981195.El
11991196.Sh EXIT STATUS
12001197.Ex -std
12011198.Sh AUTHORS
12021199.An -nosplit
12031200.Nm
12041204-was originally written by
12011201+is derived from ratpoison originally written by
12051202.An Shawn Betts Aq Mt sabetts@gmail.com .
+26-65
ratpoison.c
sdorfehs.c
···3434#include <sys/wait.h>
3535#include <ctype.h>
36363737-#include "ratpoison.h"
3737+#include "sdorfehs.h"
38383939/* Command line options */
4040-static struct option ratpoison_longopts[] =
4040+static struct option sdorfehs_longopts[] =
4141 {{"help", no_argument, 0, 'h'},
4242 {"interactive", no_argument, 0, 'i'},
4343 {"version", no_argument, 0, 'v'},
···4747 {0, 0, 0, 0},
4848};
49495050-static char ratpoison_opts[] = "hvic:d:s:f:";
5050+static char sdorfehs_opts[] = "hvic:d:s:f:";
51515252static void
5353sighandler(int signum UNUSED)
···9797}
98989999static void
100100-print_version(void)
101101-{
102102- printf("%s %s\n", PROGNAME, VERSION);
103103- printf("Copyright (C) 2000-2008 Shawn Betts\n\n");
104104-105105- exit(EXIT_SUCCESS);
106106-}
107107-108108-static void
109100print_help(void)
110101{
111102 printf("Help for %s %s\n\n", PROGNAME, VERSION);
112103 printf("-h, --help Display this help screen\n");
113113- printf("-v, --version Display the version\n");
114104 printf("-d, --display <dpy> Set the X display to use\n");
115105 printf("-c, --command <cmd> Send " PROGNAME " a colon-command\n");
116106 printf("-i, --interactive Execute commands in interactive mode\n");
···123113read_startup_files(const char *alt_rcfile)
124114{
125115 FILE *fileptr = NULL;
116116+ char *config_dir, *filename;
126117127127- if (alt_rcfile) {
128128- if ((fileptr = fopen(alt_rcfile, "r")) == NULL) {
129129- PRINT_ERROR((PROGNAME ": could not open %s (%s)\n",
130130- alt_rcfile, strerror(errno)));
131131- return -1;
132132- }
133133- } else {
134134- const char *homedir;
135135- char *filename;
118118+ if (alt_rcfile && ((fileptr = fopen(alt_rcfile, "r")) == NULL)) {
119119+ PRINT_ERROR(("could not open %s (%s)\n",
120120+ alt_rcfile, strerror(errno)));
121121+ return -1;
122122+ }
136123137137- /* first check $HOME/.ratpoisonrc */
138138- homedir = get_homedir();
139139- if (!homedir)
140140- PRINT_ERROR((PROGNAME ": no home directory!?\n"));
141141- else {
142142- filename = xsprintf("%s/.ratpoisonrc", homedir);
143143- fileptr = fopen(filename, "r");
144144- if (fileptr == NULL && errno != ENOENT)
145145- PRINT_ERROR((PROGNAME ": could not open %s (%s)\n",
146146- filename, strerror(errno)));
147147- free(filename);
148148- }
149149-150150- if (fileptr == NULL) {
151151- /* couldn't open $HOME/.ratpoisonrc, fall back on
152152- * system config */
153153- filename = xsprintf("%s/ratpoisonrc", SYSCONFDIR);
154154-155155- fileptr = fopen(filename, "r");
156156- if (fileptr == NULL && errno != ENOENT)
157157- PRINT_ERROR((PROGNAME ": could not open %s (%s)\n",
158158- filename, strerror(errno)));
159159- free(filename);
160160- }
161161- }
124124+ config_dir = get_config_dir();
125125+ filename = xsprintf("%s/config", config_dir);
126126+ fileptr = fopen(filename, "r");
127127+ if (fileptr == NULL && errno != ENOENT)
128128+ PRINT_ERROR(("could not open %s (%s)\n", filename,
129129+ strerror(errno)));
130130+ free(config_dir);
131131+ free(filename);
162132163133 if (fileptr != NULL) {
164134 set_close_on_exec(fileno(fileptr));
···171141static int
172142bar_mkfifo(void)
173143{
174174- const char *homedir;
144144+ char *config_dir;
175145176176- homedir = get_homedir();
177177- if (!homedir) {
178178- PRINT_ERROR((PROGNAME ": no home directory!?\n"));
179179- return 0;
180180- }
146146+ config_dir = get_config_dir();
147147+ rp_glob_screen.bar_fifo_path = xsprintf("%s/bar", config_dir);
148148+ free(config_dir);
181149182182- rp_glob_screen.bar_fifo_path = xsprintf("%s/.ratpoison_bar", homedir);
183150 unlink(rp_glob_screen.bar_fifo_path);
184151185152 if (mkfifo(rp_glob_screen.bar_fifo_path, S_IRUSR|S_IWUSR) == -1) {
···318285 /* Parse the arguments */
319286 myargv = argv;
320287 while (1) {
321321- c = getopt_long(argc, argv, ratpoison_opts, ratpoison_longopts,
288288+ c = getopt_long(argc, argv, sdorfehs_opts, sdorfehs_longopts,
322289 NULL);
323290 if (c == -1)
324291 break;
···326293 switch (c) {
327294 case 'h':
328295 print_help();
329329- break;
330330- case 'v':
331331- print_version();
332296 break;
333297 case 'c':
334298 cmd = xrealloc(cmd, sizeof(char *) * (cmd_count + 1));
···363327 }
364328 set_close_on_exec(ConnectionNumber(dpy));
365329366366- /* Set ratpoison specific Atoms. */
330330+ /* Set our own specific Atoms. */
367331 rp_command = XInternAtom(dpy, "RP_COMMAND", False);
368332 rp_command_request = XInternAtom(dpy, "RP_COMMAND_REQUEST", False);
369333 rp_command_result = XInternAtom(dpy, "RP_COMMAND_RESULT", False);
···423387 set_sig_handler(SIGHUP, hup_handler);
424388 set_sig_handler(SIGCHLD, chld_handler);
425389426426- /* Add RATPOISON to the environment */
427427- putenv(xsprintf("RATPOISON=%s", argv[0]));
428428-429429- if (!bar_mkfifo())
390390+ if (bar_mkfifo() == -1)
430391 return EXIT_FAILURE;
431392432432- /* Setup ratpoison's internal structures */
393393+ /* Setup our internal structures */
433394 init_defaults();
434395 init_window_stuff();
435396 init_xrandr();
···449410 if (read_startup_files(alt_rcfile) == -1)
450411 return EXIT_FAILURE;
451412452452- /* Indicate to the user that ratpoison has booted. */
413413+ /* Indicate to the user that we have booted. */
453414 if (defaults.startup_message)
454415 show_welcome_message();
455416
+4-4
ratpoison.h
sdorfehs.h
···11/*
22- * Standard header for ratpoison.
22+ * Standard header
33 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca>
44 *
55 * This program is free software; you can redistribute it and/or modify it
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#ifndef _RATPOISON_H
2121-#define _RATPOISON_H 1
2020+#ifndef _SDORFEHS_H
2121+#define _SDORFEHS_H 1
22222323#include <stdlib.h>
2424#include <stdio.h>
···102102#include "utf8.h"
103103#include "util.h"
104104105105-#endif /* ! _RATPOISON_H */
105105+#endif /* ! _SDORFEHS_H */
-58
ratpoisonrc
···11-# This is a sample .ratpoisonrc file
22-# Copyright (C) 2003, 2004 Shawn Betts
33-#
44-# Copying and distribution of this file, with or without modification,
55-# are permitted in any medium without royalty provided the copyright
66-77-# Set the prefix key to that of screen's default
88-escape C-a
99-1010-# Gets rid of that ugly crosshairs default cursor
1111-# and set the background to black
1212-exec xsetroot -solid black -cursor_name left_ptr
1313-1414-# Emulate screen by starting with a new xterm
1515-exec xterm
1616-1717-# Bind e to our favorite editor
1818-bind e exec emacs
1919-2020-# bind s to interactively run a surfraw query on freshmeat
2121-bind s colon exec xterm -e freshmeat
2222-2323-# bind b (`b' for browse) to interactively ask for an URL to open
2424-bind b colon exec mozilla http://www.
2525-2626-# Use the name of the program rather than the title in the window list
2727-defwinname name
2828-2929-# bind M-! to store the current frame layout in slot #1
3030-bind M-exclam exec ratpoison -c "setenv fs1 `ratpoison -c 'fdump'`"
3131-3232-#bind M-1 to restore the frame layout in slot #1
3333-bind M-1 exec ratpoison -c "frestore `ratpoison -c 'getenv fs1'`"
3434-3535-# Do the same for slot #2 and bind it to M-@ and M-2, respectively.
3636-bind M-at exec ratpoison -c "setenv fs2 `ratpoison -c 'fdump'`"
3737-bind M-2 exec ratpoison -c "frestore `ratpoison -c 'getenv fs2'`"
3838-3939-# Give ourselves another slot on M-# and M-3, respectively.
4040-bind M-numbersign exec ratpoison -c "setenv fs3 `ratpoison -c 'fdump'`"
4141-bind M-3 exec ratpoison -c "frestore `ratpoison -c 'getenv fs3'`"
4242-4343-# Here's a hack from John Meacham:
4444-4545-bind a exec ratpoison -d :0.0 -c "echo `date +'%r - %A %n %D - %B'` `cal | tail -n +2 | sed -e 's/^Su/\n\n Su/' -e 's/.*/ & /' -e \"s/\ $(date +%e)\ /\<$(date +%e)\>/\"`"
4646-4747-# it produces output like the following in the message window, very handy:
4848-# +-----------------------+
4949-# |05:05:24 PM - Tuesday |
5050-# | 09/09/03 - September|
5151-# | |
5252-# |Su Mo Tu We Th Fr Sa |
5353-# | 1 2 3 4 5 6 |
5454-# | 7 8< 9>10 11 12 13 |
5555-# |14 15 16 17 18 19 20 |
5656-# |21 22 23 24 25 26 27 |
5757-# |28 29 30 |
5858-# +-----------------------+
···1717 * Place, Suite 330, Boston, MA 02111-1307 USA.
1818 */
19192020-#include "ratpoison.h"
2020+#include "sdorfehs.h"
2121#include <string.h>
2222#include <X11/cursorfont.h>
2323···293293 /*
294294 * Select on some events on the root window, if this fails, then there
295295 * is already a WM running and the X Error handler will catch it,
296296- * terminating ratpoison.
296296+ * terminating us.
297297 */
298298 XSelectInput(dpy, RootWindow(dpy, screen_num),
299299 PropertyChangeMask | ColormapChangeMask