A tiling window manager

ratpoison -> sdorfehs

Keep rp_* prefixes as an homage to ratpoison.

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

+214 -268
+1 -1
.gitignore
··· 1 *.o 2 - ratpoison
··· 1 *.o 2 + sdorfehs
+7 -13
Makefile
··· 34 linkedlist.o \ 35 manage.o \ 36 number.o \ 37 - ratpoison.o \ 38 sbuf.o \ 39 screen.o \ 40 split.o \ 41 utf8.o \ 42 util.o \ ··· 63 manage.h \ 64 messages.h \ 65 number.h \ 66 - ratpoison.h \ 67 sbuf.h \ 68 screen.h \ 69 split.h \ 70 utf8.h \ 71 util.h \ ··· 73 window.h \ 74 xrandr.h 75 76 - BIN= ratpoison 77 78 - MAN= ratpoison.1 79 80 %.o: %.c $(DEPS) 81 $(CC) $(CFLAGS) -c -o $@ $< 82 83 - ratpoison: $(OBJ) 84 $(CC) $(LDFLAGS) -o $@ $^ 85 86 - all: ratpoison 87 88 install: all 89 - $(eval TMPDIR := $(shell mktemp -d)) 90 mkdir -p $(BINDIR) $(MANDIR) 91 install -s $(BIN) $(BINDIR) 92 - for i in $(MAN); do \ 93 - sed 's,%%sysconfdir%%,${SYSCONFDIR},g' $$i > $(TMPDIR)/$$i; \ 94 - install -m 644 $(TMPDIR)/$$i $(MANDIR); \ 95 - rm $(TMPDIR)/$$i; \ 96 - done 97 - rmdir $(TMPDIR) 98 99 clean: 100 rm -f $(BIN) $(OBJ)
··· 34 linkedlist.o \ 35 manage.o \ 36 number.o \ 37 sbuf.o \ 38 screen.o \ 39 + sdorfehs.o \ 40 split.o \ 41 utf8.o \ 42 util.o \ ··· 63 manage.h \ 64 messages.h \ 65 number.h \ 66 sbuf.h \ 67 screen.h \ 68 + sdorfehs.h \ 69 split.h \ 70 utf8.h \ 71 util.h \ ··· 73 window.h \ 74 xrandr.h 75 76 + BIN= sdorfehs 77 78 + MAN= sdorfehs.1 79 80 %.o: %.c $(DEPS) 81 $(CC) $(CFLAGS) -c -o $@ $< 82 83 + sdorfehs: $(OBJ) 84 $(CC) $(LDFLAGS) -o $@ $^ 85 86 + all: sdorfehs 87 88 install: all 89 mkdir -p $(BINDIR) $(MANDIR) 90 install -s $(BIN) $(BINDIR) 91 + install -m 644 $(MAN) $(MANDIR) 92 93 clean: 94 rm -f $(BIN) $(OBJ)
+2 -2
actions.c
··· 29 #include <X11/extensions/XTest.h> 30 #include <sys/ioctl.h> 31 32 - #include "ratpoison.h" 33 34 /* arg_REST and arg_SHELLCMD eat the rest of the input. */ 35 enum argtype { ··· 3194 show_frame_message(defaults.resize_fmt); 3195 read_key(&c, &mod, buffer, sizeof(buffer)); 3196 3197 - /* Convert the mask to be compatible with ratpoison. */ 3198 mod = x11_mask_to_rp_mask(mod); 3199 3200 for (binding = resize_bindings; binding->action; binding++) {
··· 29 #include <X11/extensions/XTest.h> 30 #include <sys/ioctl.h> 31 32 + #include "sdorfehs.h" 33 34 /* arg_REST and arg_SHELLCMD eat the rest of the input. */ 35 enum argtype { ··· 3194 show_frame_message(defaults.resize_fmt); 3195 read_key(&c, &mod, buffer, sizeof(buffer)); 3196 3197 + /* Convert the mask to be compatible with us. */ 3198 mod = x11_mask_to_rp_mask(mod); 3199 3200 for (binding = resize_bindings; binding->action; binding++) {
+4 -4
actions.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_ACTIONS_H 21 - #define _RATPOISON_ACTIONS_H 1 22 23 - #include "ratpoison.h" 24 25 /* The structure returned by a command. */ 26 typedef struct cmdret { ··· 44 rp_action *find_keybinding(KeySym keysym, unsigned int state, rp_keymap *map); 45 rp_action *find_keybinding_by_action(char *action, rp_keymap *map); 46 47 - #endif /* ! _RATPOISON_ACTIONS_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_ACTIONS_H 21 + #define _SDORFEHS_ACTIONS_H 1 22 23 + #include "sdorfehs.h" 24 25 /* The structure returned by a command. */ 26 typedef struct cmdret { ··· 44 rp_action *find_keybinding(KeySym keysym, unsigned int state, rp_keymap *map); 45 rp_action *find_keybinding_by_action(char *action, rp_keymap *map); 46 47 + #endif /* ! _SDORFEHS_ACTIONS_H */
+3 -3
bar.c
··· 28 #include <unistd.h> 29 #include <errno.h> 30 31 - #include "ratpoison.h" 32 33 /* Possible values for bar_is_raised status. */ 34 #define BAR_IS_HIDDEN 0 ··· 745 PRINT_ERROR(("failed opening newly-created bar FIFO at %s: %s\n", 746 rp_glob_screen.bar_fifo_path, strerror(errno))); 747 rp_glob_screen.bar_fifo_fd = -1; 748 - return 0; 749 } 750 751 - return 1; 752 } 753 754 void
··· 28 #include <unistd.h> 29 #include <errno.h> 30 31 + #include "sdorfehs.h" 32 33 /* Possible values for bar_is_raised status. */ 34 #define BAR_IS_HIDDEN 0 ··· 745 PRINT_ERROR(("failed opening newly-created bar FIFO at %s: %s\n", 746 rp_glob_screen.bar_fifo_path, strerror(errno))); 747 rp_glob_screen.bar_fifo_fd = -1; 748 + return -1; 749 } 750 751 + return 0; 752 } 753 754 void
+3 -3
bar.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_BAR_H 21 - #define _RATPOISON_BAR_H 1 22 23 void redraw_sticky_bar_text(rp_screen *s); 24 void update_window_names(rp_screen *s, char *fmt); ··· 41 int bar_open_fifo(void); 42 void bar_read_fifo(void); 43 44 - #endif /* ! _RATPOISON_BAR_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_BAR_H 21 + #define _SDORFEHS_BAR_H 1 22 23 void redraw_sticky_bar_text(rp_screen *s); 24 void update_window_names(rp_screen *s, char *fmt); ··· 41 int bar_open_fifo(void); 42 void bar_read_fifo(void); 43 44 + #endif /* ! _SDORFEHS_BAR_H */
+3 -3
communications.c
··· 1 /* 2 - * communications.c -- Send commands to a running copy of ratpoison. 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 25 26 #include <string.h> 27 28 - #include "ratpoison.h" 29 30 - /* Sending commands to ratpoison */ 31 static int 32 receive_command_result(Window w) 33 {
··· 1 /* 2 + * communications.c -- Send commands to a running copy of sdorfehs. 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 25 26 #include <string.h> 27 28 + #include "sdorfehs.h" 29 30 + /* Sending commands to us from another process */ 31 static int 32 receive_command_result(Window w) 33 {
+4 -4
communications.h
··· 1 /* 2 - * communications.h -- Send commands to a running copy of ratpoison. 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_COMMUNICATIONS_H 21 - #define _RATPOISON_COMMUNICATIONS_H 1 22 23 int send_command(unsigned char interactive, unsigned char *cmd); 24 25 - #endif /* ! _RATPOISON_COMMUNICATIONS_H */
··· 1 /* 2 + * communications.h -- Send commands to a running copy of sdorfehs. 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_COMMUNICATIONS_H 21 + #define _SDORFEHS_COMMUNICATIONS_H 1 22 23 int send_command(unsigned char interactive, unsigned char *cmd); 24 25 + #endif /* ! _SDORFEHS_COMMUNICATIONS_H */
+1 -2
completions.c
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 - #define _GNU_SOURCE 20 #include <string.h> 21 22 - #include "ratpoison.h" 23 #include "completions.h" 24 25 rp_completions *
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 #include <string.h> 20 21 + #include "sdorfehs.h" 22 #include "completions.h" 23 24 rp_completions *
+3 -3
completions.h
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 - #ifndef _RATPOISON_COMPLETIONS_H 20 - #define _RATPOISON_COMPLETIONS_H 1 21 22 char *completions_complete(rp_completions * c, char *partial, int direction); 23 rp_completions *completions_new(completion_fn list_fn, 24 enum completion_styles style); 25 void completions_free(rp_completions * c); 26 27 - #endif /* ! _RATPOISON_COMPLETIONS_H */
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 + #ifndef _SDORFEHS_COMPLETIONS_H 20 + #define _SDORFEHS_COMPLETIONS_H 1 21 22 char *completions_complete(rp_completions * c, char *partial, int direction); 23 rp_completions *completions_new(completion_fn list_fn, 24 enum completion_styles style); 25 void completions_free(rp_completions * c); 26 27 + #endif /* ! _SDORFEHS_COMPLETIONS_H */
+9 -9
config.h
··· 1 /* 2 - * Config file for ratpoison. Edit these values and recompile. 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_CONF_H 21 - #define _RATPOISON_CONF_H 1 22 23 #include "data.h" 24 #include "actions.h" 25 26 - #define PROGNAME "ratpoison" 27 - #define VERSION "20190816" 28 29 /* Enter command mode with Control+T by default. */ 30 #define KEY_PREFIX XK_t ··· 94 #define MAX_LINK_DEPTH 16 95 96 /* 97 - * Bad window messages can be safely ignored now that ratpoison has become 98 - * stable enough. Comment this line if you wish to be notified about bad window 99 * messages. 100 */ 101 #define IGNORE_BADWINDOW 1 ··· 107 #define MAX_HISTORY_SIZE 100 108 109 /* The default filename in which to store the history */ 110 - #define HISTORY_FILE ".ratpoison_history" 111 112 /* The name of the root keymap */ 113 #define ROOT_KEYMAP "root" ··· 118 /* The default font */ 119 #define DEFAULT_XFT_FONT "monospace:size=12" 120 121 - #endif /* !_ _RATPOISON_CONF_H */
··· 1 /* 2 + * Config file. Edit these values and recompile. 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_CONF_H 21 + #define _SDORFEHS_CONF_H 1 22 23 #include "data.h" 24 #include "actions.h" 25 26 + #define PROGNAME "sdorfehs" 27 + #define VERSION "20190822" 28 29 /* Enter command mode with Control+T by default. */ 30 #define KEY_PREFIX XK_t ··· 94 #define MAX_LINK_DEPTH 16 95 96 /* 97 + * Bad window messages can be safely ignored now that we have become stable 98 + * enough. Comment this line if you wish to be notified about bad window 99 * messages. 100 */ 101 #define IGNORE_BADWINDOW 1 ··· 107 #define MAX_HISTORY_SIZE 100 108 109 /* The default filename in which to store the history */ 110 + #define HISTORY_FILE "history" 111 112 /* The name of the root keymap */ 113 #define ROOT_KEYMAP "root" ··· 118 /* The default font */ 119 #define DEFAULT_XFT_FONT "monospace:size=12" 120 121 + #endif /* !_ _SDORFEHS_CONF_H */
+3 -3
data.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_DATA_H 21 - #define _RATPOISON_DATA_H 22 23 #include "linkedlist.h" 24 #include "number.h" ··· 476 int len; 477 }; 478 479 - #endif /* _RATPOISON_DATA_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_DATA_H 21 + #define _SDORFEHS_DATA_H 22 23 #include "linkedlist.h" 24 #include "number.h" ··· 476 int len; 477 }; 478 479 + #endif /* _SDORFEHS_DATA_H */
+1 -1
editor.c
··· 26 #include <X11/Xutil.h> 27 #include <X11/Xatom.h> 28 29 - #include "ratpoison.h" 30 31 /* bind functions */ 32 static edit_status editor_forward_char(rp_input_line *line);
··· 26 #include <X11/Xutil.h> 27 #include <X11/Xatom.h> 28 29 + #include "sdorfehs.h" 30 31 /* bind functions */ 32 static edit_status editor_forward_char(rp_input_line *line);
+3 -3
editor.h
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 - #ifndef _RATPOISON_EDITOR_H 20 - #define _RATPOISON_EDITOR_H 1 21 22 #include "utf8.h" 23 ··· 39 edit_status execute_edit_action(rp_input_line *line, KeySym ch, 40 unsigned int modifier, char *keysym_buf); 41 42 - #endif /* ! _RATPOISON_EDITOR_H */
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 + #ifndef _SDORFEHS_EDITOR_H 20 + #define _SDORFEHS_EDITOR_H 1 21 22 #include "utf8.h" 23 ··· 39 edit_status execute_edit_action(rp_input_line *line, KeySym ch, 40 unsigned int modifier, char *keysym_buf); 41 42 + #endif /* ! _SDORFEHS_EDITOR_H */
+2 -2
events.c
··· 1 /* 2 - * Ratpoison X events 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 35 #include <sys/time.h> 36 #include <sys/wait.h> 37 38 - #include "ratpoison.h" 39 40 /* 41 * The event currently being processed. Mostly used in functions from action.c
··· 1 /* 2 + * X events 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 35 #include <sys/time.h> 36 #include <sys/wait.h> 37 38 + #include "sdorfehs.h" 39 40 /* 41 * The event currently being processed. Mostly used in functions from action.c
+3 -3
events.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_EVENTS_H 21 - #define _RATPOISON_EVENTS_H 1 22 23 void listen_for_events(void); 24 void show_rudeness_msg(rp_window *win, int raised); 25 26 - #endif /* _RATPOISON_EVENTS_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_EVENTS_H 21 + #define _SDORFEHS_EVENTS_H 1 22 23 void listen_for_events(void); 24 void show_rudeness_msg(rp_window *win, int raised); 25 26 + #endif /* _SDORFEHS_EVENTS_H */
+1 -1
format.c
··· 20 #include <stdio.h> 21 #include <stdlib.h> 22 #include <string.h> 23 - #include "ratpoison.h" 24 25 /* Function prototypes for format char expanders. */ 26 #define RP_FMT(fn) static void fmt_ ## fn (rp_window_elem *elem, struct sbuf *buf)
··· 20 #include <stdio.h> 21 #include <stdlib.h> 22 #include <string.h> 23 + #include "sdorfehs.h" 24 25 /* Function prototypes for format char expanders. */ 26 #define RP_FMT(fn) static void fmt_ ## fn (rp_window_elem *elem, struct sbuf *buf)
+3 -3
format.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_FORMAT_H 21 - #define _RATPOISON_FORMAT_H 1 22 23 void format_string(char *fmt, rp_window_elem *win_elem, struct sbuf *buffer); 24 25 - #endif /* _RATPOISON_FORMAT_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_FORMAT_H 21 + #define _SDORFEHS_FORMAT_H 1 22 23 void format_string(char *fmt, rp_window_elem *win_elem, struct sbuf *buffer); 24 25 + #endif /* _SDORFEHS_FORMAT_H */
+1 -1
frame.c
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #include "ratpoison.h" 21 22 #include <string.h> 23
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #include "sdorfehs.h" 21 22 #include <string.h> 23
+53 -1
globals.c
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 - #include "ratpoison.h" 20 21 #include <sys/types.h> 22 #include <sys/wait.h> ··· 26 #include <pwd.h> 27 #include <signal.h> 28 #include <unistd.h> 29 30 /* 31 * Several systems seem not to have WAIT_ANY defined, so define it if it isn't. ··· 463 } 464 465 return homedir; 466 } 467 468 void
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 + #include "sdorfehs.h" 20 21 #include <sys/types.h> 22 #include <sys/wait.h> ··· 26 #include <pwd.h> 27 #include <signal.h> 28 #include <unistd.h> 29 + #include <dirent.h> 30 31 /* 32 * Several systems seem not to have WAIT_ANY defined, so define it if it isn't. ··· 464 } 465 466 return homedir; 467 + } 468 + 469 + char * 470 + get_config_dir(void) 471 + { 472 + DIR *d; 473 + const char *homedir; 474 + char *xdg_config, *home_config; 475 + 476 + homedir = get_homedir(); 477 + if (!homedir) { 478 + PRINT_ERROR(("no home directory\n")); 479 + exit(EXIT_FAILURE); 480 + } 481 + 482 + xdg_config = getenv("XDG_CONFIG_HOME"); 483 + if (xdg_config == NULL || !strlen(xdg_config)) 484 + xdg_config = xsprintf("%s/.config", homedir); 485 + 486 + if (!(d = opendir(xdg_config))) { 487 + if (mkdir(xdg_config, 0755) == -1) { 488 + PRINT_ERROR(("failed creating %s: %s\n", xdg_config, 489 + strerror(errno))); 490 + exit(EXIT_FAILURE); 491 + } 492 + if (!(d = opendir(xdg_config))) { 493 + PRINT_ERROR(("failed opening %s: %s\n", xdg_config, 494 + strerror(errno))); 495 + exit(EXIT_FAILURE); 496 + } 497 + } 498 + closedir(d); 499 + 500 + home_config = xsprintf("%s/sdorfehs", xdg_config); 501 + if (!(d = opendir(home_config))) { 502 + if (mkdir(home_config, 0755) == -1) { 503 + PRINT_ERROR(("failed creating %s: %s\n", home_config, 504 + strerror(errno))); 505 + exit(EXIT_FAILURE); 506 + } 507 + if (!(d = opendir(home_config))) { 508 + PRINT_ERROR(("failed opening %s: %s\n", home_config, 509 + strerror(errno))); 510 + exit(EXIT_FAILURE); 511 + } 512 + } 513 + closedir(d); 514 + 515 + free(xdg_config); 516 + 517 + return home_config; 518 } 519 520 void
+3 -2
globals.h
··· 159 */ 160 extern int ignore_badwindow; 161 162 - /* Arguments passed to ratpoison. */ 163 extern char **myargv; 164 165 /* Keeps track of which mod mask each modifier is under. */ 166 extern struct modifier_info rp_modifier_info; 167 168 /* 169 - * nonzero if an alarm signal was raised. This means ratpoison should hide its 170 * popup windows. 171 */ 172 extern int alarm_signalled; ··· 222 void set_close_on_exec(int fd); 223 void read_rc_file(FILE *file); 224 const char *get_homedir(void); 225 void clean_up(void); 226 227 void register_atom(Atom *a, char *name);
··· 159 */ 160 extern int ignore_badwindow; 161 162 + /* Arguments passed at startup. */ 163 extern char **myargv; 164 165 /* Keeps track of which mod mask each modifier is under. */ 166 extern struct modifier_info rp_modifier_info; 167 168 /* 169 + * nonzero if an alarm signal was raised. This means we should hide our 170 * popup windows. 171 */ 172 extern int alarm_signalled; ··· 222 void set_close_on_exec(int fd); 223 void read_rc_file(FILE *file); 224 const char *get_homedir(void); 225 + char *get_config_dir(void); 226 void clean_up(void); 227 228 void register_atom(Atom *a, char *name);
+1 -1
group.c
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 - #include "ratpoison.h" 20 21 #include <string.h> 22
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 + #include "sdorfehs.h" 20 21 #include <string.h> 22
+4 -4
history.c
··· 22 #include <limits.h> 23 #include <sys/stat.h> 24 25 - #include "ratpoison.h" 26 27 static char * 28 get_history_filename(void) ··· 36 struct sbuf *buf; 37 38 buf = sbuf_new(0); 39 - sbuf_printf(buf, "%s/%s", homedir, HISTORY_FILE); 40 filename = sbuf_free_struct(buf); 41 } else { 42 filename = xstrdup(HISTORY_FILE); ··· 48 static const char * 49 extract_shell_part(const char *p) 50 { 51 - if (strncmp(p, "exec", 4) && 52 - strncmp(p, "verbexec", 8)) 53 return NULL; 54 while (*p && !isspace((unsigned char) *p)) 55 p++;
··· 22 #include <limits.h> 23 #include <sys/stat.h> 24 25 + #include "sdorfehs.h" 26 27 static char * 28 get_history_filename(void) ··· 36 struct sbuf *buf; 37 38 buf = sbuf_new(0); 39 + sbuf_printf(buf, "%s/.config/sdorfehs/%s", homedir, 40 + HISTORY_FILE); 41 filename = sbuf_free_struct(buf); 42 } else { 43 filename = xstrdup(HISTORY_FILE); ··· 49 static const char * 50 extract_shell_part(const char *p) 51 { 52 + if (strncmp(p, "exec", 4) && strncmp(p, "verbexec", 8)) 53 return NULL; 54 while (*p && !isspace((unsigned char) *p)) 55 p++;
+3 -3
history.h
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 - #ifndef _RATPOISON_HISTORY_H 20 - #define _RATPOISON_HISTORY_H 1 21 22 enum { 23 hist_NONE = 0, hist_COMMAND, hist_SHELLCMD, ··· 37 const char *history_previous(int); 38 int history_expand_line(int, char *string, char **output); 39 40 - #endif /* ! _RATPOISON_HISTORY_H */
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 + #ifndef _SDORFEHS_HISTORY_H 20 + #define _SDORFEHS_HISTORY_H 1 21 22 enum { 23 hist_NONE = 0, hist_COMMAND, hist_SHELLCMD, ··· 37 const char *history_previous(int); 38 int history_expand_line(int, char *string, char **output); 39 40 + #endif /* ! _SDORFEHS_HISTORY_H */
+1 -1
hook.c
··· 20 * A hook is simply a list of strings that get passed to command() in sequence. 21 */ 22 23 - #include "ratpoison.h" 24 25 #include <string.h> 26
··· 20 * A hook is simply a list of strings that get passed to command() in sequence. 21 */ 22 23 + #include "sdorfehs.h" 24 25 #include <string.h> 26
+1 -1
input.c
··· 26 #include <X11/Xutil.h> 27 #include <X11/XKBlib.h> 28 29 - #include "ratpoison.h" 30 31 /* 32 * Convert an X11 modifier mask to the rp modifier mask equivalent, as best it
··· 26 #include <X11/Xutil.h> 27 #include <X11/XKBlib.h> 28 29 + #include "sdorfehs.h" 30 31 /* 32 * Convert an X11 modifier mask to the rp modifier mask equivalent, as best it
+3 -3
input.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_INPUT_H 21 - #define _RATPOISON_INPUT_H 1 22 23 char *keysym_to_string(KeySym keysym, unsigned int modifier); 24 int cook_keycode(XKeyEvent *ev, KeySym *keysym, unsigned int *mod, ··· 37 38 void init_xkb(void); 39 40 - #endif /* ! _RATPOISON_INPUT_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_INPUT_H 21 + #define _SDORFEHS_INPUT_H 1 22 23 char *keysym_to_string(KeySym keysym, unsigned int modifier); 24 int cook_keycode(XKeyEvent *ev, KeySym *keysym, unsigned int *mod, ··· 37 38 void init_xkb(void); 39 40 + #endif /* ! _SDORFEHS_INPUT_H */
+2 -2
linkedlist.h
··· 20 * Place, Suite 330, Boston, MA 02111-1307 USA. 21 */ 22 23 - #ifndef _RATPOISON_LINKLIST_H 24 - #define _RATPOISON_LINKLIST_H 25 26 #include <string.h> 27
··· 20 * Place, Suite 330, Boston, MA 02111-1307 USA. 21 */ 22 23 + #ifndef _SDORFEHS_LINKLIST_H 24 + #define _SDORFEHS_LINKLIST_H 25 26 #include <string.h> 27
+1 -1
manage.c
··· 29 #include <stdlib.h> 30 #include <string.h> 31 32 - #include "ratpoison.h" 33 34 static char **unmanaged_window_list = NULL; 35 static int num_unmanaged_windows = 0;
··· 29 #include <stdlib.h> 30 #include <string.h> 31 32 + #include "sdorfehs.h" 33 34 static char **unmanaged_window_list = NULL; 35 static int num_unmanaged_windows = 0;
+3 -3
manage.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_MANAGE_H 21 - #define _RATPOISON_MANAGE_H 1 22 23 #include "data.h" 24 ··· 55 void hide_others(rp_window *win); 56 void hide_vscreen_windows(rp_vscreen *v); 57 58 - #endif /* ! _RATPOISION_MANAGE_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_MANAGE_H 21 + #define _SDORFEHS_MANAGE_H 1 22 23 #include "data.h" 24 ··· 55 void hide_others(rp_window *win); 56 void hide_vscreen_windows(rp_vscreen *v); 57 58 + #endif /* ! _SDORFEHS_MANAGE_H */
+6 -6
messages.h
··· 1 /* 2 - * Ratpoison messages. 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_MESSAGES_H 21 - #define _RATPOISON_MESSAGES_H 1 22 23 #define MESSAGE_NO_OTHER_WINDOW "No other window" 24 #define MESSAGE_NO_OTHER_FRAME "No other frame" 25 #define MESSAGE_NO_MANAGED_WINDOWS "No managed windows" 26 - #define MESSAGE_UNKNOWN_COMMAND "unknown command '%s'" 27 #define MESSAGE_WINDOW_INFORMATION "This is window %d (%s)" 28 29 #define MESSAGE_RAISE_TRANSIENT "Raise request from transient window %d (%s)" ··· 48 #define MESSAGE_PROMPT_SELECT_VAR "Variable: " 49 #define MESSAGE_PROMPT_VAR_VALUE "Value: " 50 51 - #define MESSAGE_WELCOME PROGNAME " " VERSION " - press \"%s %s\" for help" 52 53 #define EMPTY_FRAME_MESSAGE "Current Frame" 54 55 - #endif /* ! _RATPOISON_MESSAGES_H */
··· 1 /* 2 + * Messages. 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_MESSAGES_H 21 + #define _SDORFEHS_MESSAGES_H 1 22 23 #define MESSAGE_NO_OTHER_WINDOW "No other window" 24 #define MESSAGE_NO_OTHER_FRAME "No other frame" 25 #define MESSAGE_NO_MANAGED_WINDOWS "No managed windows" 26 + #define MESSAGE_UNKNOWN_COMMAND "Unknown command '%s'" 27 #define MESSAGE_WINDOW_INFORMATION "This is window %d (%s)" 28 29 #define MESSAGE_RAISE_TRANSIENT "Raise request from transient window %d (%s)" ··· 48 #define MESSAGE_PROMPT_SELECT_VAR "Variable: " 49 #define MESSAGE_PROMPT_VAR_VALUE "Value: " 50 51 + #define MESSAGE_WELCOME "Welcome to " PROGNAME " - press \"%s %s\" for help" 52 53 #define EMPTY_FRAME_MESSAGE "Current Frame" 54 55 + #endif /* ! _SDORFEHS_MESSAGES_H */
+1 -1
number.c
··· 20 #include <stdlib.h> 21 #include <stdio.h> 22 23 - #include "ratpoison.h" 24 25 /* Keep track of a set of numbers. For frames and windows. */ 26 struct numset {
··· 20 #include <stdlib.h> 21 #include <stdio.h> 22 23 + #include "sdorfehs.h" 24 25 /* Keep track of a set of numbers. For frames and windows. */ 26 struct numset {
+3 -3
number.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_NUMBER_H 21 - #define _RATPOISON_NUMBER_H 1 22 23 struct numset; 24 ··· 28 int numset_request(struct numset *ns); 29 int numset_add_num(struct numset *ns, int n); 30 31 - #endif /* ! _RATPOISON_NUMBER_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_NUMBER_H 21 + #define _SDORFEHS_NUMBER_H 1 22 23 struct numset; 24 ··· 28 int numset_request(struct numset *ns); 29 int numset_add_num(struct numset *ns, int n); 30 31 + #endif /* ! _SDORFEHS_NUMBER_H */
+27 -30
ratpoison.1 sdorfehs.1
··· 21 .\" [2] http://mdocml.bsd.lv/ 22 .\" [3] http://mdocml.bsd.lv/mdoc.7.html 23 .\" 24 - .Dd Aug 22, 2017 25 - .Dt RATPOISON 1 26 .Os 27 .Sh NAME 28 - .Nm ratpoison 29 .Nd window manager without mouse dependency 30 .Sh SYNOPSIS 31 .Nm 32 - .Op Fl hv 33 .Nm 34 .Op Fl d Ar dpy 35 .Op Fl s Ar num ··· 41 .Fl c Ar command Op Fl c Ar command ... 42 .Sh DESCRIPTION 43 .Nm 44 - is a Window Manager without fat library dependencies, fancy graphics or 45 - rat dependence. 46 .Pp 47 The screen can be split into non-overlapping frames. 48 All windows are kept maximized inside their frames. 49 .Pp 50 - All interaction with the window manager is done through 51 - keystrokes. 52 .Nm 53 has a prefix map to minimize key clobbering. 54 .Pp 55 The options are as follows: 56 .Bl -tag -width Bs 57 .It Fl c , Fl \-command 58 - Send ratpoison a command. 59 - There must be a ratpoison instance running as window manager for the 60 - given display/screen for this to work. 61 Do not forget to quote the command if it contains spaces. 62 For example: 63 .Dl Nm Fl c Qq Ar "echo hello world" ··· 68 If this is not given, 69 .Nm 70 will try 71 - .Pa $HOME/.ratpoisonrc 72 - and if that does not exist 73 - .Pa /etc/ratpoisonrc 74 and execute each command when starting up. 75 .It Fl h , Fl \-help 76 Show summary of options. ··· 85 like prompting for missing arguments and things like that. 86 .It Fl s , Fl \-screen Ar number 87 Only use the specified screen. 88 - .It Fl v , Fl \-version 89 - Show version of program. 90 .El 91 .Sh KEY BINDINGS 92 - To avoid conflicts with other programs, all default ratpoison key 93 - bindings start with an escape key which, by default, is 94 .Ic C\-t 95 (Control\-t). 96 Some important default key bindings: ··· 116 .It Ic C\-t Q 117 Make the current frame the only one 118 .It Ic C\-t \&: 119 - Execute a ratpoison command 120 .El 121 .Pp 122 Further default key bindings can be found in parentheses after the ··· 180 If there isn't a window in the current frame, it banishes the rat cursor 181 to the lower right corner of the frame. 182 .It Ic chdir Op Ar directory 183 - If the optional argument is given, change the current directory 184 - of 185 .Nm 186 to 187 .Ar directory . ··· 203 current one. 204 (That means the previous window belonging to another type of application 205 than the current one.) 206 - .It Ic colon Ar ratpoison\-command Pq Ic C\-t \&: 207 Execute 208 - .Ar ratpoison\-command 209 interactively. 210 (i.e. ask for possible missing arguments.) 211 .It Ic cother ··· 1188 .Li title . 1189 .El 1190 .Sh FILES 1191 - .Bl -tag -width "%%sysconfdir%%/ratpoisonrc" -compact 1192 - .It Pa ~/.ratpoisonrc 1193 Configuration file read at startup time, if present. 1194 - .It Pa %%sysconfdir%%/ratpoisonrc 1195 - Fallback configuration file, if 1196 - .Pa ~/.ratpoisonrc 1197 - is not found. 1198 .El 1199 .Sh EXIT STATUS 1200 .Ex -std 1201 .Sh AUTHORS 1202 .An -nosplit 1203 .Nm 1204 - was originally written by 1205 .An Shawn Betts Aq Mt sabetts@gmail.com .
··· 21 .\" [2] http://mdocml.bsd.lv/ 22 .\" [3] http://mdocml.bsd.lv/mdoc.7.html 23 .\" 24 + .Dd Aug 22, 2019 25 + .Dt SDORFEHS 1 26 .Os 27 .Sh NAME 28 + .Nm sdorfehs 29 .Nd window manager without mouse dependency 30 .Sh SYNOPSIS 31 .Nm 32 + .Op Fl h 33 .Nm 34 .Op Fl d Ar dpy 35 .Op Fl s Ar num ··· 41 .Fl c Ar command Op Fl c Ar command ... 42 .Sh DESCRIPTION 43 .Nm 44 + is a window manager without fat library dependencies, fancy graphics or 45 + dependence on a mouse. 46 .Pp 47 The screen can be split into non-overlapping frames. 48 All windows are kept maximized inside their frames. 49 .Pp 50 + All interaction with the window manager is done through keystrokes. 51 .Nm 52 has a prefix map to minimize key clobbering. 53 .Pp 54 The options are as follows: 55 .Bl -tag -width Bs 56 .It Fl c , Fl \-command 57 + Send 58 + .Nm 59 + a command. 60 + There must be a 61 + .Nm 62 + instance running as window manager for the given display/screen for this to 63 + work. 64 Do not forget to quote the command if it contains spaces. 65 For example: 66 .Dl Nm Fl c Qq Ar "echo hello world" ··· 71 If this is not given, 72 .Nm 73 will try 74 + .Pa $HOME/.config/sdorfehs/config 75 and execute each command when starting up. 76 .It Fl h , Fl \-help 77 Show summary of options. ··· 86 like prompting for missing arguments and things like that. 87 .It Fl s , Fl \-screen Ar number 88 Only use the specified screen. 89 .El 90 .Sh KEY BINDINGS 91 + To avoid conflicts with other programs, all default 92 + .Nm 93 + key bindings start with an escape key which, by default, is 94 .Ic C\-t 95 (Control\-t). 96 Some important default key bindings: ··· 116 .It Ic C\-t Q 117 Make the current frame the only one 118 .It Ic C\-t \&: 119 + Execute a 120 + .Nm 121 + command 122 .El 123 .Pp 124 Further default key bindings can be found in parentheses after the ··· 182 If there isn't a window in the current frame, it banishes the rat cursor 183 to the lower right corner of the frame. 184 .It Ic chdir Op Ar directory 185 + If the optional argument is given, change the current directory of 186 .Nm 187 to 188 .Ar directory . ··· 204 current one. 205 (That means the previous window belonging to another type of application 206 than the current one.) 207 + .It Ic colon Ar sdorfehs\-command Pq Ic C\-t \&: 208 Execute 209 + .Ar sdorfehs\-command 210 interactively. 211 (i.e. ask for possible missing arguments.) 212 .It Ic cother ··· 1189 .Li title . 1190 .El 1191 .Sh FILES 1192 + .Bl -tag -compact 1193 + .It Pa ~/.config/sdorfehs/config 1194 Configuration file read at startup time, if present. 1195 .El 1196 .Sh EXIT STATUS 1197 .Ex -std 1198 .Sh AUTHORS 1199 .An -nosplit 1200 .Nm 1201 + is derived from ratpoison originally written by 1202 .An Shawn Betts Aq Mt sabetts@gmail.com .
+26 -65
ratpoison.c sdorfehs.c
··· 34 #include <sys/wait.h> 35 #include <ctype.h> 36 37 - #include "ratpoison.h" 38 39 /* Command line options */ 40 - static struct option ratpoison_longopts[] = 41 {{"help", no_argument, 0, 'h'}, 42 {"interactive", no_argument, 0, 'i'}, 43 {"version", no_argument, 0, 'v'}, ··· 47 {0, 0, 0, 0}, 48 }; 49 50 - static char ratpoison_opts[] = "hvic:d:s:f:"; 51 52 static void 53 sighandler(int signum UNUSED) ··· 97 } 98 99 static void 100 - print_version(void) 101 - { 102 - printf("%s %s\n", PROGNAME, VERSION); 103 - printf("Copyright (C) 2000-2008 Shawn Betts\n\n"); 104 - 105 - exit(EXIT_SUCCESS); 106 - } 107 - 108 - static void 109 print_help(void) 110 { 111 printf("Help for %s %s\n\n", PROGNAME, VERSION); 112 printf("-h, --help Display this help screen\n"); 113 - printf("-v, --version Display the version\n"); 114 printf("-d, --display <dpy> Set the X display to use\n"); 115 printf("-c, --command <cmd> Send " PROGNAME " a colon-command\n"); 116 printf("-i, --interactive Execute commands in interactive mode\n"); ··· 123 read_startup_files(const char *alt_rcfile) 124 { 125 FILE *fileptr = NULL; 126 127 - if (alt_rcfile) { 128 - if ((fileptr = fopen(alt_rcfile, "r")) == NULL) { 129 - PRINT_ERROR((PROGNAME ": could not open %s (%s)\n", 130 - alt_rcfile, strerror(errno))); 131 - return -1; 132 - } 133 - } else { 134 - const char *homedir; 135 - char *filename; 136 137 - /* first check $HOME/.ratpoisonrc */ 138 - homedir = get_homedir(); 139 - if (!homedir) 140 - PRINT_ERROR((PROGNAME ": no home directory!?\n")); 141 - else { 142 - filename = xsprintf("%s/.ratpoisonrc", homedir); 143 - fileptr = fopen(filename, "r"); 144 - if (fileptr == NULL && errno != ENOENT) 145 - PRINT_ERROR((PROGNAME ": could not open %s (%s)\n", 146 - filename, strerror(errno))); 147 - free(filename); 148 - } 149 - 150 - if (fileptr == NULL) { 151 - /* couldn't open $HOME/.ratpoisonrc, fall back on 152 - * system config */ 153 - filename = xsprintf("%s/ratpoisonrc", SYSCONFDIR); 154 - 155 - fileptr = fopen(filename, "r"); 156 - if (fileptr == NULL && errno != ENOENT) 157 - PRINT_ERROR((PROGNAME ": could not open %s (%s)\n", 158 - filename, strerror(errno))); 159 - free(filename); 160 - } 161 - } 162 163 if (fileptr != NULL) { 164 set_close_on_exec(fileno(fileptr)); ··· 171 static int 172 bar_mkfifo(void) 173 { 174 - const char *homedir; 175 176 - homedir = get_homedir(); 177 - if (!homedir) { 178 - PRINT_ERROR((PROGNAME ": no home directory!?\n")); 179 - return 0; 180 - } 181 182 - rp_glob_screen.bar_fifo_path = xsprintf("%s/.ratpoison_bar", homedir); 183 unlink(rp_glob_screen.bar_fifo_path); 184 185 if (mkfifo(rp_glob_screen.bar_fifo_path, S_IRUSR|S_IWUSR) == -1) { ··· 318 /* Parse the arguments */ 319 myargv = argv; 320 while (1) { 321 - c = getopt_long(argc, argv, ratpoison_opts, ratpoison_longopts, 322 NULL); 323 if (c == -1) 324 break; ··· 326 switch (c) { 327 case 'h': 328 print_help(); 329 - break; 330 - case 'v': 331 - print_version(); 332 break; 333 case 'c': 334 cmd = xrealloc(cmd, sizeof(char *) * (cmd_count + 1)); ··· 363 } 364 set_close_on_exec(ConnectionNumber(dpy)); 365 366 - /* Set ratpoison specific Atoms. */ 367 rp_command = XInternAtom(dpy, "RP_COMMAND", False); 368 rp_command_request = XInternAtom(dpy, "RP_COMMAND_REQUEST", False); 369 rp_command_result = XInternAtom(dpy, "RP_COMMAND_RESULT", False); ··· 423 set_sig_handler(SIGHUP, hup_handler); 424 set_sig_handler(SIGCHLD, chld_handler); 425 426 - /* Add RATPOISON to the environment */ 427 - putenv(xsprintf("RATPOISON=%s", argv[0])); 428 - 429 - if (!bar_mkfifo()) 430 return EXIT_FAILURE; 431 432 - /* Setup ratpoison's internal structures */ 433 init_defaults(); 434 init_window_stuff(); 435 init_xrandr(); ··· 449 if (read_startup_files(alt_rcfile) == -1) 450 return EXIT_FAILURE; 451 452 - /* Indicate to the user that ratpoison has booted. */ 453 if (defaults.startup_message) 454 show_welcome_message(); 455
··· 34 #include <sys/wait.h> 35 #include <ctype.h> 36 37 + #include "sdorfehs.h" 38 39 /* Command line options */ 40 + static struct option sdorfehs_longopts[] = 41 {{"help", no_argument, 0, 'h'}, 42 {"interactive", no_argument, 0, 'i'}, 43 {"version", no_argument, 0, 'v'}, ··· 47 {0, 0, 0, 0}, 48 }; 49 50 + static char sdorfehs_opts[] = "hvic:d:s:f:"; 51 52 static void 53 sighandler(int signum UNUSED) ··· 97 } 98 99 static void 100 print_help(void) 101 { 102 printf("Help for %s %s\n\n", PROGNAME, VERSION); 103 printf("-h, --help Display this help screen\n"); 104 printf("-d, --display <dpy> Set the X display to use\n"); 105 printf("-c, --command <cmd> Send " PROGNAME " a colon-command\n"); 106 printf("-i, --interactive Execute commands in interactive mode\n"); ··· 113 read_startup_files(const char *alt_rcfile) 114 { 115 FILE *fileptr = NULL; 116 + char *config_dir, *filename; 117 118 + if (alt_rcfile && ((fileptr = fopen(alt_rcfile, "r")) == NULL)) { 119 + PRINT_ERROR(("could not open %s (%s)\n", 120 + alt_rcfile, strerror(errno))); 121 + return -1; 122 + } 123 124 + config_dir = get_config_dir(); 125 + filename = xsprintf("%s/config", config_dir); 126 + fileptr = fopen(filename, "r"); 127 + if (fileptr == NULL && errno != ENOENT) 128 + PRINT_ERROR(("could not open %s (%s)\n", filename, 129 + strerror(errno))); 130 + free(config_dir); 131 + free(filename); 132 133 if (fileptr != NULL) { 134 set_close_on_exec(fileno(fileptr)); ··· 141 static int 142 bar_mkfifo(void) 143 { 144 + char *config_dir; 145 146 + config_dir = get_config_dir(); 147 + rp_glob_screen.bar_fifo_path = xsprintf("%s/bar", config_dir); 148 + free(config_dir); 149 150 unlink(rp_glob_screen.bar_fifo_path); 151 152 if (mkfifo(rp_glob_screen.bar_fifo_path, S_IRUSR|S_IWUSR) == -1) { ··· 285 /* Parse the arguments */ 286 myargv = argv; 287 while (1) { 288 + c = getopt_long(argc, argv, sdorfehs_opts, sdorfehs_longopts, 289 NULL); 290 if (c == -1) 291 break; ··· 293 switch (c) { 294 case 'h': 295 print_help(); 296 break; 297 case 'c': 298 cmd = xrealloc(cmd, sizeof(char *) * (cmd_count + 1)); ··· 327 } 328 set_close_on_exec(ConnectionNumber(dpy)); 329 330 + /* Set our own specific Atoms. */ 331 rp_command = XInternAtom(dpy, "RP_COMMAND", False); 332 rp_command_request = XInternAtom(dpy, "RP_COMMAND_REQUEST", False); 333 rp_command_result = XInternAtom(dpy, "RP_COMMAND_RESULT", False); ··· 387 set_sig_handler(SIGHUP, hup_handler); 388 set_sig_handler(SIGCHLD, chld_handler); 389 390 + if (bar_mkfifo() == -1) 391 return EXIT_FAILURE; 392 393 + /* Setup our internal structures */ 394 init_defaults(); 395 init_window_stuff(); 396 init_xrandr(); ··· 410 if (read_startup_files(alt_rcfile) == -1) 411 return EXIT_FAILURE; 412 413 + /* Indicate to the user that we have booted. */ 414 if (defaults.startup_message) 415 show_welcome_message(); 416
+4 -4
ratpoison.h sdorfehs.h
··· 1 /* 2 - * Standard header for ratpoison. 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_H 21 - #define _RATPOISON_H 1 22 23 #include <stdlib.h> 24 #include <stdio.h> ··· 102 #include "utf8.h" 103 #include "util.h" 104 105 - #endif /* ! _RATPOISON_H */
··· 1 /* 2 + * Standard header 3 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Shawn Betts <sabetts@vcn.bc.ca> 4 * 5 * This program is free software; you can redistribute it and/or modify it ··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_H 21 + #define _SDORFEHS_H 1 22 23 #include <stdlib.h> 24 #include <stdio.h> ··· 102 #include "utf8.h" 103 #include "util.h" 104 105 + #endif /* ! _SDORFEHS_H */
-58
ratpoisonrc
··· 1 - # This is a sample .ratpoisonrc file 2 - # Copyright (C) 2003, 2004 Shawn Betts 3 - # 4 - # Copying and distribution of this file, with or without modification, 5 - # are permitted in any medium without royalty provided the copyright 6 - 7 - # Set the prefix key to that of screen's default 8 - escape C-a 9 - 10 - # Gets rid of that ugly crosshairs default cursor 11 - # and set the background to black 12 - exec xsetroot -solid black -cursor_name left_ptr 13 - 14 - # Emulate screen by starting with a new xterm 15 - exec xterm 16 - 17 - # Bind e to our favorite editor 18 - bind e exec emacs 19 - 20 - # bind s to interactively run a surfraw query on freshmeat 21 - bind s colon exec xterm -e freshmeat 22 - 23 - # bind b (`b' for browse) to interactively ask for an URL to open 24 - bind b colon exec mozilla http://www. 25 - 26 - # Use the name of the program rather than the title in the window list 27 - defwinname name 28 - 29 - # bind M-! to store the current frame layout in slot #1 30 - bind M-exclam exec ratpoison -c "setenv fs1 `ratpoison -c 'fdump'`" 31 - 32 - #bind M-1 to restore the frame layout in slot #1 33 - bind M-1 exec ratpoison -c "frestore `ratpoison -c 'getenv fs1'`" 34 - 35 - # Do the same for slot #2 and bind it to M-@ and M-2, respectively. 36 - bind M-at exec ratpoison -c "setenv fs2 `ratpoison -c 'fdump'`" 37 - bind M-2 exec ratpoison -c "frestore `ratpoison -c 'getenv fs2'`" 38 - 39 - # Give ourselves another slot on M-# and M-3, respectively. 40 - bind M-numbersign exec ratpoison -c "setenv fs3 `ratpoison -c 'fdump'`" 41 - bind M-3 exec ratpoison -c "frestore `ratpoison -c 'getenv fs3'`" 42 - 43 - # Here's a hack from John Meacham: 44 - 45 - 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)\>/\"`" 46 - 47 - # it produces output like the following in the message window, very handy: 48 - # +-----------------------+ 49 - # |05:05:24 PM - Tuesday | 50 - # | 09/09/03 - September| 51 - # | | 52 - # |Su Mo Tu We Th Fr Sa | 53 - # | 1 2 3 4 5 6 | 54 - # | 7 8< 9>10 11 12 13 | 55 - # |14 15 16 17 18 19 20 | 56 - # |21 22 23 24 25 26 27 | 57 - # |28 29 30 | 58 - # +-----------------------+
···
+1 -1
sbuf.c
··· 19 20 #include <string.h> 21 22 - #include "ratpoison.h" 23 #include "sbuf.h" 24 25 struct sbuf *
··· 19 20 #include <string.h> 21 22 + #include "sdorfehs.h" 23 #include "sbuf.h" 24 25 struct sbuf *
+3 -3
sbuf.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_SBUF_H 21 - #define _RATPOISON_SBUF_H 1 22 23 #include <stdlib.h> 24 ··· 44 char *sbuf_printf_concat(struct sbuf *b, char *fmt,...); 45 void sbuf_chop(struct sbuf *b); 46 47 - #endif /* ! _RATPOISON_SBUF_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_SBUF_H 21 + #define _SDORFEHS_SBUF_H 1 22 23 #include <stdlib.h> 24 ··· 44 char *sbuf_printf_concat(struct sbuf *b, char *fmt,...); 45 void sbuf_chop(struct sbuf *b); 46 47 + #endif /* ! _SDORFEHS_SBUF_H */
+2 -2
screen.c
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #include "ratpoison.h" 21 #include <string.h> 22 #include <X11/cursorfont.h> 23 ··· 293 /* 294 * Select on some events on the root window, if this fails, then there 295 * is already a WM running and the X Error handler will catch it, 296 - * terminating ratpoison. 297 */ 298 XSelectInput(dpy, RootWindow(dpy, screen_num), 299 PropertyChangeMask | ColormapChangeMask
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #include "sdorfehs.h" 21 #include <string.h> 22 #include <X11/cursorfont.h> 23 ··· 293 /* 294 * Select on some events on the root window, if this fails, then there 295 * is already a WM running and the X Error handler will catch it, 296 + * terminating us. 297 */ 298 XSelectInput(dpy, RootWindow(dpy, screen_num), 299 PropertyChangeMask | ColormapChangeMask
+1 -1
split.c
··· 20 #include <unistd.h> 21 #include <string.h> 22 23 - #include "ratpoison.h" 24 25 #define VERTICALLY 0 26 #define HORIZONTALLY 1
··· 20 #include <unistd.h> 21 #include <string.h> 22 23 + #include "sdorfehs.h" 24 25 #define VERTICALLY 0 26 #define HORIZONTALLY 1
+1 -1
utf8.c
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #include "ratpoison.h" 21 22 #include <langinfo.h> 23
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #include "sdorfehs.h" 21 22 #include <langinfo.h> 23
+1 -1
util.c
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 - #include "ratpoison.h" 20 21 #include <ctype.h> 22
··· 16 * Place, Suite 330, Boston, MA 02111-1307 USA. 17 */ 18 19 + #include "sdorfehs.h" 20 21 #include <ctype.h> 22
+1 -1
window.c
··· 21 #include <stdlib.h> 22 #include <string.h> 23 24 - #include "ratpoison.h" 25 26 LIST_HEAD(rp_unmapped_window); 27 LIST_HEAD(rp_mapped_window);
··· 21 #include <stdlib.h> 22 #include <string.h> 23 24 + #include "sdorfehs.h" 25 26 LIST_HEAD(rp_unmapped_window); 27 LIST_HEAD(rp_mapped_window);
+3 -3
window.h
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 - #ifndef _RATPOISON_LIST_H 21 - #define _RATPOISON_LIST_H 1 22 23 #include "sbuf.h" 24 ··· 56 57 void window_full_screen(rp_window *win); 58 59 - #endif /* ! _RATPOISON_LIST_H */
··· 17 * Place, Suite 330, Boston, MA 02111-1307 USA. 18 */ 19 20 + #ifndef _SDORFEHS_LIST_H 21 + #define _SDORFEHS_LIST_H 1 22 23 #include "sbuf.h" 24 ··· 56 57 void window_full_screen(rp_window *win); 58 59 + #endif /* ! _SDORFEHS_LIST_H */
+1 -1
xrandr.c
··· 19 20 #include <X11/extensions/Xrandr.h> 21 22 - #include "ratpoison.h" 23 24 static int xrandr_evbase; 25
··· 19 20 #include <X11/extensions/Xrandr.h> 21 22 + #include "sdorfehs.h" 23 24 static int xrandr_evbase; 25
+1 -1
xrandr.h
··· 19 #ifndef XRANDR_H 20 #define XRANDR_H 21 22 - #include "ratpoison.h" 23 24 void init_xrandr(void); 25 int xrandr_query_screen(int **outputs);
··· 19 #ifndef XRANDR_H 20 #define XRANDR_H 21 22 + #include "sdorfehs.h" 23 24 void init_xrandr(void); 25 int xrandr_query_screen(int **outputs);