summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2012-02-04 23:56:03 +0100
committerPaul Buetow <paul@buetow.org>2012-02-04 23:56:03 +0100
commitfacb0b6d69095458fd4389cfb83fbbb5dd3d011c (patch)
tree3090c148436e2cfa33e95b915121d485b58971e2
parent4f5840f4a9d10bbd87436635e21d9fb8de850bc2 (diff)
Add docu for config file support and fix auto text bugs
-rw-r--r--CHANGELOG1
-rwxr-xr-xloadbars24
2 files changed, 18 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 7c432de..78743dd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,5 @@
* Add config file support (~/.loadbarsrc)
+* Remove --title option (no need anyway)
* Some bugfixes
Sat Feb 4 10:56:27 CET 2012
diff --git a/loadbars b/loadbars
index b0d814f..c842ecd 100755
--- a/loadbars
+++ b/loadbars
@@ -69,17 +69,17 @@ my %I : shared;
# Setting defaults
%C = (
average => 15,
+ barwidth => 35,
+ extended => 0,
+ factor => 1,
+ height => 230,
+ maxwidth => 1280,
+ samples => 500,
showcores => 0,
showmem => 0,
- factor => 1,
- extended => 0,
showtext => 1,
showtexthost => 0,
- samples => 500,
sshopts => '',
- barwidth => 35,
- maxwidth => 1280,
- height => 230,
);
%I = (
@@ -149,6 +149,8 @@ sub read_config () {
next if /^[\t\s]*#/;
s/[\t\s]*#.*//;
+ next unless length;
+
my ($key, $val) = split /=/, $_;
trim $key; trim $val;
@@ -319,7 +321,7 @@ sub auto_off_text ($) {
my ($barwidth) = @_;
if ($barwidth < $C{barwidth} - 1 && $I{showtextoff} == 0) {
- return if $C{showtext} == 0;
+ return unless $C{showtext};
display_warn 'Disabling text display, text does not fit into window. Use \'t\' to re-enable.';
$I{showtextoff} = 1;
$C{showtext} = 0;
@@ -847,6 +849,14 @@ Memory stuff:
Color: Dark grey
Swp: System swap usage in %
Color: Grey
+Config file support:
+ Loadbars tries to read ~/.loadbarsrc and it's possible to configure any
+ option you find in --help but without leading '--'. For comments just use
+ the '#' sign. Sample config:
+ showcores=1 # Always show cores on startup
+ showtext=0 # Always don't display text on startup
+ extended=1 # Always use extended mode on startup
+ will always show all CPU cores in extended mode but no text display.
Examples:
loadbars --extended 1 --showcores 1 --height 300 --hosts localhost
loadbars --hosts localhost,server1.example.com,server2.example.com