summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-09-05 07:48:49 +0000
committersabetts <sabetts>2001-09-05 07:48:49 +0000
commit3c255ea736cdb1e3d0bf77f1160b6d495cb090db (patch)
tree1d797050a54eaa6c73ab77e77e0e4f39ce33573c /src/main.c
parentf58ed0a036775c9090df75f3db7afc59058b4cff (diff)
downloadratpoison-3c255ea736cdb1e3d0bf77f1160b6d495cb090db.zip
* src/messages.h (MESSAGE_WELCOME): The help keystroke is not
hardcoded. * src/main.c (show_welcome_message): new function (main): call show_welcome_message to show the welcome message. * src/actions.h (find_keybinding_by_action): new prototype * src/actions.c (key_actions): change to a static variable. (key_actions_last): likewise (key_actions_table_size): likewise (find_keybinding_by_action): new function
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 7e2b7f7..af294d7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -308,6 +308,35 @@ read_startup_files ()
}
}
+static void
+show_welcome_message ()
+{
+ rp_action *help_action;
+ char *prefix, *help;
+
+ prefix = keysym_to_string (prefix_key.sym, prefix_key.state);
+
+ /* Find the help key binding. */
+ help_action = find_keybinding_by_action ("help");
+ if (help_action)
+ help = keysym_to_string (help_action->key, help_action->state);
+ else
+ help = NULL;
+
+
+ if (help)
+ {
+ marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, help);
+ free (help);
+ }
+ else
+ {
+ marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, ":help");
+ }
+
+ free (prefix);
+}
+
int
main (int argc, char *argv[])
{
@@ -429,8 +458,8 @@ main (int argc, char *argv[])
read_startup_files ();
- /* Indicate to the user that ratpoison has booted */
- message (MESSAGE_WELCOME);
+ /* Indicate to the user that ratpoison has booted. */
+ show_welcome_message();
handle_events ();