From eadf090413c530e69e8568492ebeb4b4087bd2ad Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Mon, 13 Jun 2011 21:50:31 +0100 Subject: new dmenu_run --- dmenu.1 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'dmenu.1') diff --git a/dmenu.1 b/dmenu.1 index 8295d17..44c953b 100644 --- a/dmenu.1 +++ b/dmenu.1 @@ -23,12 +23,10 @@ dmenu \- dynamic menu .RB [ \-v ] .P .BR dmenu_run " ..." -.P -.B dmenu_path .SH DESCRIPTION .B dmenu is a dynamic menu for X, originally designed for -.BR dwm (1). +.IR dwm (1). It manages huge numbers of user\-defined menu items efficiently. .P dmenu reads a list of newline\-separated items from stdin and creates a menu. @@ -36,11 +34,8 @@ When the user selects an item or enters any text and presses Return, their choice is printed to stdout and dmenu terminates. .P .B dmenu_run -is a dmenu script used by dwm which lists programs in the user's PATH and +is a dmenu script used by dwm which lists programs in the user's $PATH and executes the selected item. -.P -.B dmenu_path -is a script used by dmenu_run to find and cache a list of executables. .SH OPTIONS .TP .B \-b @@ -100,4 +95,4 @@ Exit without selecting an item, returning failure. .B Ctrl\-y Paste the current X selection into the input field. .SH SEE ALSO -.BR dwm (1) +.IR dwm (1) -- cgit v1.2.3-54-g00ecf From 86e9e6f1ecc4711d8fe447f5c0f2c1bd0feb8568 Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Sat, 18 Jun 2011 07:50:46 +0100 Subject: simpler lsx --- dmenu.1 | 3 ++- lsx.1 | 10 +++------- lsx.c | 4 +--- 3 files changed, 6 insertions(+), 11 deletions(-) (limited to 'dmenu.1') diff --git a/dmenu.1 b/dmenu.1 index 44c953b..616a2a5 100644 --- a/dmenu.1 +++ b/dmenu.1 @@ -95,4 +95,5 @@ Exit without selecting an item, returning failure. .B Ctrl\-y Paste the current X selection into the input field. .SH SEE ALSO -.IR dwm (1) +.IR dwm (1), +.IR lsx (1) diff --git a/lsx.1 b/lsx.1 index fbb84ea..1b2a15e 100644 --- a/lsx.1 +++ b/lsx.1 @@ -3,13 +3,9 @@ lsx \- list executables .SH SYNOPSIS .B lsx -.RB [ \-v ] .RI [ directory ...] .SH DESCRIPTION .B lsx -lists the executables in each directory. If no directories are given the current -working directory is used. -.SH OPTIONS -.TP -.B \-v -prints version information to stdout, then exits. +lists the executables in each +.IR directory . +If none are given the current working directory is used. diff --git a/lsx.c b/lsx.c index 325c508..fd28625 100644 --- a/lsx.c +++ b/lsx.c @@ -14,8 +14,6 @@ main(int argc, char *argv[]) { if(argc < 2) lsx("."); - else if(!strcmp(argv[1], "-v")) - puts("lsx-0.2, © 2006-2011 dmenu engineers, see LICENSE for details"); else for(i = 1; i < argc; i++) lsx(argv[i]); return EXIT_SUCCESS; @@ -34,7 +32,7 @@ lsx(const char *dir) { } while((d = readdir(dp))) { snprintf(buf, sizeof buf, "%s/%s", dir, d->d_name); - if(stat(buf, &st) == 0 && S_ISREG(st.st_mode) && access(buf, X_OK) == 0) + if(!stat(buf, &st) && S_ISREG(st.st_mode) && access(buf, X_OK) == 0) puts(d->d_name); } closedir(dp); -- cgit v1.2.3-54-g00ecf