Rc.tics_scaled = 0;
#endif
break;
+ case kbd_CtrlR:
+ if (Secure_mode)
+ show_msg(N_txt(NOT_onsecure_txt));
+ else {
+ int def = PID_VAL(EU_PID, s_int, w->ppt[w->begtask]),
+ pid = get_int(fmtmk(N_fmt(GET_pid2nice_fmt), def));
+ if (pid > GET_NUM_ESC) {
+ int val, fd;
+ if (pid == GET_NUM_NOT) pid = def;
+ val = get_int(fmtmk(N_fmt(AGNI_valueof_fmt), pid));
+ if (val > GET_NUM_NOT) {
+ if (val < -20 || val > +19)
+ show_msg(N_txt(AGNI_invalid_txt));
+ else if (0 > (fd = open(fmtmk("/proc/%d/autogroup", pid), O_WRONLY)))
+ show_msg(fmtmk(N_fmt(AGNI_notopen_fmt), strerror(errno)));
+ else {
+ char buf[TNYBUFSIZ];
+ snprintf(buf, sizeof(buf), "%d", val);
+ if (0 >= write(fd, buf, strlen(buf)))
+ show_msg(fmtmk(N_fmt(AGNI_nowrite_fmt), strerror(errno)));
+ close(fd);
+ }
+ }
+ }
+ }
+ break;
case kbd_ENTER: // these two have the effect of waking us
case kbd_SPACE: // from 'pselect', refreshing the display
break; // and updating any hot-plugged resources
{ keys_global,
{ '?', 'B', 'd', 'E', 'e', 'f', 'g', 'H', 'h'
, 'I', 'k', 'r', 's', 'X', 'Y', 'Z', '0'
- , kbd_CtrlE, kbd_ENTER, kbd_SPACE, '\0' } },
+ , kbd_CtrlE, kbd_CtrlR, kbd_ENTER, kbd_SPACE, '\0' } },
{ keys_summary,
{ '!', '1', '2', '3', '4', 'C', 'l', 'm', 't', '\0' } },
{ keys_task,
/* the above might seem pretty stingy, until you consider that with every
field displayed the column header would be approximately 250 bytes
-- so SCREENMAX provides for all fields plus a 250+ byte command line */
+#define TNYBUFSIZ 16
#define CAPBUFSIZ 32
#define CLRBUFSIZ 64
#define PFLAGSSIZ 128
#define kbd_BKSP 137
#define kbd_INS 138
#define kbd_DEL 139
-#define kbd_CtrlO '\017'
#define kbd_CtrlE '\005'
+#define kbd_CtrlO '\017'
+#define kbd_CtrlR '\022'
/* Special value in Pseudo_row to force an additional procs refresh
-- used at startup and for task/thread mode transitions */
Norm_nlstab[X_SEMAPHORES_fmt] = _("failed sem_init() at %d: %s");
Norm_nlstab[X_THREADINGS_fmt] = _("failed pthread_create() at %d: %s");
Norm_nlstab[X_RESTRICTED_txt] = _("sorry, restricted namespace with reduced functionality");
+ Norm_nlstab[AGNI_valueof_fmt] = _("set pid %d AGNI value to");
+ Norm_nlstab[AGNI_invalid_txt] = _("valid AGNI range is -20 to +19");
+ Norm_nlstab[AGNI_notopen_fmt] = _("autogroup open failed, %s");
+ Norm_nlstab[AGNI_nowrite_fmt] = _("autogroup write failed, %s");
}
. also imbedded in the translatable text (along with escape seqs)
. should never themselves be translated. */
Uniq_nlstab[KEYS_helpext_fmt] = _(""
- " k,r Manipulate tasks: '~1k~2' kill; '~1r~2' renice\n"
+ " k,r,^R, Tasks: '~1k~2' kill; '~1r~2' renice; ~1Ctrl~2+'~1R~2' renice autogroup\n"
" d or s Set update interval\n");
/* Translation Hint:
* from any text also containiing c-format specifiers.
*/
enum norm_nls {
+ AGNI_invalid_txt, AGNI_notopen_fmt, AGNI_nowrite_fmt, AGNI_valueof_fmt,
AMT_exxabyte_txt, AMT_gigabyte_txt, AMT_kilobyte_txt, AMT_megabyte_txt,
AMT_petabyte_txt, AMT_terabyte_txt, BAD_delayint_fmt, BAD_integers_txt,
BAD_max_task_txt, BAD_memscale_fmt, BAD_mon_pids_fmt, BAD_niterate_fmt,