1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
# This file is sourced by the default startup script of ledcontrol.
# It is used to control the LEDs.
# If you wish to add your own functions, you can add them here or add
# a file named <name>.sh in the script directory (usually
# /usr/share/ledcontrol or /usr/local/share/ledcontrol). Don't forget
# to mail me your scripts! :)
# Here are a few examples of the commands that can be given to ledd:
#
# set s0c0 off Set lowest-level Scroll Lock and Caps Lock off
# set s5 blink 300 100 Set level-5 (overriding level-0) Scroll Lock
# blinking 0.3 secs on and 0.1 secs off.
# set n4 on Num Lock level-4 on.
# set n4 normal Num Lock to normal state.
# set s5 dutycycle 1000 0.8 1.9 Arbitrary number indication starts blinking
# at 0.8, is totally on at 1.9 (last option
# omitted - will be added by command)
# set s5 frequency 0.8 1000 1.9 100 Another number indication - starts
# blinking at 0.8 and increases frequency
# until 1.9 (last option omitted as above)
# nop Do nothing.
#
# More info can be found in the file MANUAL.
###
# Give a short (~1sec) animation when starting up. Automatically
# disabled if started within X as that might leave LEDs in wrong
# setting.
STARTUP_ANIM=YES
###
# Place slow tasks (eg. led_ping when host is not responding) onto the
# background. This is automatically disabled if using bash 2.xx.xx, as
# it has a bug causing startup.sh to crash. It's safe to leave this on.
USE_BACKGROUNDING=YES
###
# Minimum delay between checks. Low values give rapid response, but
# also increase the load more. You'll probably get a disk-access every
# MINIMUM_DELAY seconds, see file MANUAL for details.
MINIMUM_DELAY=5
###
# Default settings, set at startup. You probably want to blank the
# near-lowest priority level of all LEDs you'll use (level 0 shouldn't
# be used - some other software might want it).
# The default setup only uses Scroll Lock:
DEFAULT_SETTINGS="set s1 off"
###
# The tests themselves. Each is defined by four variables:
# COMMAND_n Command to execute. Can be internal function (see below)
# or external command.
# SUCCESS_n Command to give ledd on successful return value (0).
# FAILURE_n Command to give ledd on failed return value (non-0).
# DELAY_n Test is run so often. May be a bit more due to
# MINIMUM_DELAY.
# n is a number, starting from 1 up.
# The default is to show the load average on Scroll Lock. If you run
# Seti@Home, rc5des or similar, you want to increase the numbers
# below, as your "unloaded" system load is 1.
COMMAND_1="led_load" # Command to give
SUCCESS_1="set s5 frequency 0.8 1000 1.9 100"
# Starts blinking at 0.8, very frantic at 1.9
FAILURE_1="nop" # Not used, but must be present
DELAY_1=10 # Test every 10 seconds
# Another example: Put Caps Lock on if a ppp-link is present. If ping
# can reach somehost.example, then make it blink slowly. (Assumes
# that if ppp-link not found, host cannot be reached.)
#
#COMMAND_2="led_ppp"
#SUCCESS_2="set c4 on"
#FAILURE_2="set c4c6 off" # Assumes link down -> host not reached
#DELAY_2=5
#
#COMMAND_3="led_ping somehost.example" # Don't forget the quotes!
#SUCCESS_3="set c6 blink 500" # Overrides ppp-check
#FAILURE_3="set c6 normal" # Let level-4 show through
#DELAY_3=20
# The current internal commands are the following (the ones starting
# with NUMBER must have an arbirary number indication in SUCCESS_n):
#
# led_file <FILE(S)> TRUE if every one of <FILE(S)> exists (may
# contain wildcards)
# led_load NUMBER - Current system load (1 min avg)
# led_netload <IF> <TYPE> NUMBER - Current network load on
# interface <IF>. <TYPE> can be IN, OUT or BOTH
# indicating what kind of traffic is monitored.
# Number is given as kB/s. The longer DELAY_n
# is, the more accurate the average is. Returns
# FALSE if no such interface exists.
# led_ping <HOST> TRUE if <HOST> replies to ping.
# led_ppp TRUE if a ppp-link is active.
# led_size <FILE> <MIN> [<MAX>] Returns TRUE if <FILE> exists
# and its size is greater or equal to <MIN> and
# optionally less than <MAX>.
# That's all folks! Send me a note about what you're doing with
# ledcontrol to sampo.niskanen@iki.fi!
|