From 664bee7689de892f1ce83ca76702852ee2ee5e71 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 13 Feb 2010 05:43:35 +0000 Subject: [PATCH] (change version) added filter, only 5 or less allowed in irc client, terminal 20 or less supported. --- inxi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index f9ab46d..9233e21 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.4.0 +#### version: 1.4.1 #### Date: February 12 2010 ######################################################################## #### SPECIAL THANKS @@ -1263,8 +1263,8 @@ show_options() print_screen_output "-s Show sensors output (if sensors installed/configured): mobo/cpu/gpu temp; detected fan speeds." print_screen_output " Gpu temp only for Fglrx/Nvidia drivers. Nvidia shows screen number for > 1 screens." print_screen_output "-S Show System information: host name, kernel, distro" - print_screen_output "-t Show processes. Requires extra options: c (cpu) m (memory) cm (cpu+memory). If followed" - print_screen_output " by numbers 1-20, shows that number of top process for each selection (default: $PS_COUNT): -t cm10" + print_screen_output "-t Show processes. Requires extra options: c (cpu) m (memory) cm (cpu+memory). If followed by numbers 1-20," + print_screen_output " shows that number of processes for each type (default: $PS_COUNT; if in irc, max: 5): -t cm10" print_screen_output " Make sure to have no space between letters and numbers (-t cm10 -right, -t cm 10 -wrong)." print_screen_output "-u Show partition UUIDs. Default: short partition -P. For full -p output, use: -pu (or -plu)." print_screen_output "-v Script verbosity levels. Verbosity level number is required." @@ -3203,6 +3203,11 @@ get_ps_data() { eval $LOGFS local array_length='' reorder_temp='' i=0 + + # throttle potential irc abuse + if [[ $B_RUNNING_IN_SHELL != 'true' && $PS_COUNT -gt 5 ]];then + PS_COUNT=5 + fi IFS=$'\n' # note that inxi can use a lot of cpu, and can actually show up here as the script runs A_PS_DATA=( $( ps aux --sort $1 | grep -v 'inxi' | tail -n $PS_COUNT | gawk '