display number of selected items as well, run subshell in the background
This commit is contained in:
parent
ea3e7ed458
commit
2a9ae1480c
|
@ -608,7 +608,7 @@ exec_program() {
|
|||
|
||||
# finally run the program
|
||||
if [ -n "$exec" ]; then
|
||||
/bin/sh -c "$exec"
|
||||
${SHELL:-/bin/sh} -c "$exec" &
|
||||
else
|
||||
printf "No executable found. Try clearing cache." >> "$LOGFILE"
|
||||
fi
|
||||
|
|
14
spmenu.c
14
spmenu.c
|
@ -313,7 +313,7 @@ void appenditem(struct item *item, struct item **list, struct item **last) {
|
|||
}
|
||||
|
||||
void recalculatenumbers(void) {
|
||||
unsigned int numer = 0, denom = 0;
|
||||
unsigned int numer = 0, denom = 0, selected = 0;
|
||||
struct item *item;
|
||||
if (matchend) {
|
||||
numer++;
|
||||
|
@ -327,8 +327,20 @@ void recalculatenumbers(void) {
|
|||
for (item = items; item && item->text; item++)
|
||||
denom++;
|
||||
|
||||
for (int i = 0; i < sel_size; i++) {
|
||||
if (sel_index[i] == -1) {
|
||||
break;
|
||||
}
|
||||
|
||||
selected++;
|
||||
}
|
||||
|
||||
if (selected) {
|
||||
snprintf(numbers, NUMBERSBUFSIZE, "%d/%d/%d", numer, denom, selected);
|
||||
} else {
|
||||
snprintf(numbers, NUMBERSBUFSIZE, "%d/%d", numer, denom);
|
||||
}
|
||||
}
|
||||
|
||||
void calcoffsets(void) {
|
||||
int i, n;
|
||||
|
|
Loading…
Reference in a new issue