ソースを参照

add -t

master
phillbush 4年前
コミット
28f784a7a4
4個のファイルの変更27行の追加4行の削除
  1. +3
    -0
      config.h
  2. +17
    -3
      xmenu.1
  3. +6
    -1
      xmenu.c
  4. +1
    -0
      xmenu.h

+ 3
- 0
config.h ファイルの表示

@@ -34,6 +34,9 @@ static struct Config config = {

/* area around the icon, the triangle and the separator */
.horzpadding = 8,

/* if nonzero, enable type-to-select feature, can be togglet with -t */
.typetoselect = 0
};

/*


+ 17
- 3
xmenu.1 ファイルの表示

@@ -3,7 +3,7 @@
xmenu \- menu utility for X
.SH SYNOPSIS
.B xmenu
.RB [ \-irw ]
.RB [ \-irtw ]
.RB [ -p
.IR position ]
.RI [ title ]
@@ -58,6 +58,10 @@ must spawn at the position 100x500 of the monitor 0.
If this option is set, the right mouse button is disabled;
so pressing it will not trigger any menu item.
.TP
.B -t
If this option is set, the type-to-select feature is enabled,
so typing a string will select the first item matching it.
.TP
.B -w
Asks the window manager to draw a border around the menus.
This option may be buggy in some window managers,
@@ -108,11 +112,21 @@ Select the first item in the menu.
.BR End
Select the last item in the menu.
.TP
.BR Down ", " Tab
.BR Down
Cycle through the items in the regular direction.
.TP
.BR Tab
Cycle through the items in the regular direction.
If the type-to-select feature is enabled, and there is a typed string in memory,
cycle through matching items instead.
.TP
.BR Up
Cycle through the items in the reverse direction.
.TP
.BR Up ", " Shift-Tab
.BR Shift-Tab
Cycle through the items in the reverse direction.
If the type-to-select feature is enabled, and there is a typed string in memory,
cycle through matching items instead.
.TP
.BR Right ", " Enter
Select the highlighted item.


+ 6
- 1
xmenu.c ファイルの表示

@@ -141,7 +141,7 @@ getoptions(int argc, char *argv[])
{
int ch;

while ((ch = getopt(argc, argv, "ip:rw")) != -1) {
while ((ch = getopt(argc, argv, "ip:rtw")) != -1) {
switch (ch) {
case 'i':
iflag = 1;
@@ -153,6 +153,9 @@ getoptions(int argc, char *argv[])
case 'r':
rflag = 1;
break;
case 't':
config.typetoselect = !config.typetoselect;
break;
case 'w':
wflag = 1;
break;
@@ -1373,6 +1376,8 @@ enteritem:
break;
default:
append:
if (!config.typetoselect)
break;
for (i = 0; i < 2; i++) {
append(text, buf, sizeof text, len);
if ((item = matchitem(currmenu, text, 0)))


+ 1
- 0
xmenu.h ファイルの表示

@@ -50,6 +50,7 @@ struct Config {
int iconpadding;
int horzpadding;
int alignment;
int typetoselect;

/* the values below are set by options */
int monitor;


読み込み中…
キャンセル
保存