Icon that indicates a drive read or write operation?

For discussions about security.
Message
Author
User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#16 Post by tallboy »

Nice work!

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#17 Post by SFR »

Karl Godt wrote:I have compiled xosview with only enabling the diskmeter .
Thanks Karl :)
Will be invaluable for my Acer AO 722...which has no HDD LED indicator at all!! :evil:

@Jasper: check out http://linux.die.net/man/1/xosview
There are some options you may find useful, e.g.:

Code: Select all

./xosview-1.8.3-diskmeter-dyn -xrm "xosview*diskReadColor: green" -xrm "xosview*diskWriteColor: red" -xrm "xosview*diskIdleColor: gray"
Greetings!
Attachments
Screenshot.png
(4.86 KiB) Downloaded 497 times
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#18 Post by Karl Godt »

Hi Jasper !

Glad you like it !

I know of xosview since Suse6.2 on 133MHz P-I .

The source is horrible to read and understand , but mostly works .
I can understand people preferring the conky monitor .
I like it because I can resize and place the window wherever I want .
I don't use conky at all .

I had started to compile it in late 2010 , mainly focusing on the lmstemp meter with PATH to different files in /sys for the it87 temperature module for my boards from 2000/2001 back then and now for the coretemp temperature module to be able to monitor the CPU temperature if not somewhere in /proc/acpi available and not to exit if not found .

Xosview sources the /root/.Xdefaults file , that could have a part that could look like

Code: Select all

! XOsview settings begin

! General Resources
!xosview*title:
!xosview*geometry:           +5+5
!xosview*display:
xosview*captions:           True
xosview*labels:             True
xosview*transparent:        False
xosview*meterLabelColor:    wheat
xosview*usedlabels:         True
xosview*usedLabelColor:     wheat
xosview*borderwidth:        0
xosview*font:               7x13
xosview*background:         #34A56C
xosview*foreground:         wheat
xosview*enableStipple:      False ! Change to true to try beta stipple support.
xosview*samplesPerSec:      10    ! not yet supported
xosview*graphNumCols:       128   ! number of samples shown in a graph

! Disk Meter Resources
xosview*disk:               True
xosview*diskUsedColor:      seagreen
xosview*diskIdleColor:      #8FFF00
!some kind of lightgreen
xosview*diskWriteColor:     #FF0000
!some kind of read
xosview*diskReadColor:      #F9983C
!some kind of orange
xosview*diskBandwidth:      100000000 ! 100MB/s should be reasonable today for
                                     ! both IDE and SCSI
xosview*diskPriority:       10
xosview*diskDecay:          True
xosview*diskUsedFormat:     autoscale
xosview*diskGraph:          True

! XOsview settings end
Some of the variables seem not to be used eg .: xosview*diskUsedColor

That below are the two sections of the Xdefaults file used while compiling to set default values (not changed any values but False for all other meters) :

Code: Select all

! General Resources
!xosview*title:
!xosview*geometry:           +5+5
!xosview*display:
xosview*captions:           True
xosview*labels:             True
xosview*transparent:        False
xosview*meterLabelColor:    wheat
xosview*usedlabels:         True
xosview*usedLabelColor:     wheat
xosview*borderwidth:        0
xosview*font:               7x13
xosview*background:         navy
xosview*foreground:         wheat
xosview*enableStipple:      False ! Change to true to try beta stipple support.
xosview*samplesPerSec:      10    ! not yet supported
xosview*graphNumCols:       128   ! number of samples shown in a graph

! Disk Meter Resources
xosview*disk:               True
xosview*diskUsedColor:      seagreen
xosview*diskIdleColor:      aquamarine
xosview*diskWriteColor:     SlateBlue1
xosview*diskReadColor:      SkyBlue
xosview*diskBandwidth:      10000000 ! 10MB/s should be reasonable today for
                                     ! both IDE and SCSI
xosview*diskPriority:       10
xosview*diskDecay:          True
xosview*diskUsedFormat:     autoscale
xosview*diskGraph:          True
to have a comparison .

That's it so far for color preferences .

An intensive manpage can be found here : http://linux.die.net/man/1/xosview

:oops: SFR was faster .. :)

With your color scheme as I understand it , mine full-featured looks like this :
Attachments
xosview-full.jpg
(37.38 KiB) Downloaded 471 times
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#19 Post by tallboy »

Depending on which puppy you run, you may also take a look at xosview from Ubuntu and Debian repos. There are several similar packages, like wmcpu, in Debian.
There is also iotop, which present a list, like top.

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

xosview-1.14

#20 Post by Karl Godt »

Code: Select all

!  xosview resources (override into your .Xdefaults file)

! General Resources

xosview*title:              Xosview DiskMeter
xosview*geometry:           220x40
!xosview*display:            220x40
xosview*captions:           True
xosview*labels:             True
xosview*meterLabelColor:    cyan
xosview*usedlabels:         True
xosview*usedLabelColor:     wheat
xosview*borderwidth:        1
xosview*font:               7x13
xosview*background:         seagreen
! navy
xosview*foreground:         yellow
xosview*enableStipple:      False ! Change to true to try beta stipple support.
xosview*samplesPerSec:      5
xosview*graphNumCols:       135   ! number of samples shown in a graph

! Disk Meter Resources

xosview*disk:               True
xosview*diskUsedColor:      yellow
xosview*diskIdleColor:      LightGreen
xosview*diskWriteColor:     DarkRed
xosview*diskReadColor:      orange2
xosview*diskBandwidth:      100000000 ! 100MB/s
xosview*diskPriority:       10
xosview*diskDecay:          True
xosview*diskUsedFormat:     autoscale
xosview*diskGraph:          True

Code: Select all

//  MeterMaker.cc
//  Copyright (c) 1994, 1995, 2002, 2006 by Mike Romberg ( mike.romberg@noaa.gov )
//
//  This file may be distributed under terms of the GPL
//

#include "MeterMaker.h"
#include "xosview.h"

#include <fstream>
#include "diskmeter.h"

#include <stdlib.h>

#include <sstream>
#include <iomanip>

using namespace std;

MeterMaker::MeterMaker(XOSView *xos){
  _xos = xos;
}

void MeterMaker::makeMeters(void){

  if (_xos->isResourceTrue("disk"))
      push(new DiskMeter(_xos, atof(_xos->getResource("diskBandwidth"))));

}

Code: Select all

#Makefile
-include .config

AWK ?= awk
INSTALL ?= install
PLATFORM ?= linux

# Installation paths

PREFIX ?= /usr/local

BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man

# Optional build arguments; user may wish to override

OPTFLAGS ?= -Wall -Os

# Required build arguments

CPPFLAGS += $(OPTFLAGS) -I. -MMD
LDLIBS += -lX11
LDFLAGS += -s

OBJS = Host.o \
	Xrm.o \
	bitfieldmeter.o \
	bitmeter.o \
	defaultstring.o \
	fieldmeter.o \
	fieldmeterdecay.o \
	fieldmetergraph.o \
	llist.o \
	main.o \
	meter.o \
	xosview.o \
	xwin.o

# Optional platform type

ifeq ($(PLATFORM), linux)
OBJS += linux/MeterMaker.o \
	linux/diskmeter.o
CPPFLAGS += -Ilinux/
endif

DEPS := $(OBJS:.o=.d)

xosview:	$(OBJS)
		$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)

defaultstring.cc:	Xdefaults defresources.awk
		$(AWK) -f defresources.awk Xdefaults > defaultstring.cc

Xrm.o:		CXXFLAGS += -Wno-write-strings

.PHONY:		dist install clean

dist:
		./mkdist $(VERSION)

install:	xosview
		$(INSTALL) -d $(DESTDIR)$(BINDIR)
		$(INSTALL) -d $(DESTDIR)$(MANDIR)/man1
		$(INSTALL) -m 755 xosview $(DESTDIR)$(BINDIR)/xosview
		$(INSTALL) -m 644 xosview.1 $(DESTDIR)$(MANDIR)/man1/xosview.1

clean:
		rm -f xosview $(OBJS) $(DEPS) defaultstring.cc

-include $(DEPS)
xosview-1.14 diskmeter only
Precise-5.5 with Precise-5.7.1 devx

# ldd ./xosview
  • linux-gate.so.1 => (0xffffe000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0xb7693000)
    libstdc++.so.6 => /lib/libstdc++.so.6 (0xb75ae000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb758f000)
    libc.so.6 => /lib/libc.so.6 (0xb73e5000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb73c4000)
    libdl.so.2 => /lib/libdl.so.2 (0xb73bf000)
    libm.so.6 => /lib/libm.so.6 (0xb7393000)
    /lib/ld-linux.so.2 (0xb77c9000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0xb738e000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7387000)
# ls -s ./xosview
76 ./xosview , stripped
-static gave libX11.a errors - Ubuntu seems to cook only with water , too .

# /lib/libc.so.6
GNU C Library (Ubuntu EGLIBC 2.15-0ubuntu10.3) stable release version 2.15, by Roland McGrath et al.
Attachments
xosview-1.14_diskmeteronly.bz2
(30.92 KiB) Downloaded 297 times

Jasper

#21 Post by Jasper »

Hi Karl.

Thank you very much for your update; but (because of my defencies) I do not understand if you regard it as essential, as opposed to desirable.

Your new download shows numeric usage, but nothing shows in my graph (using Precise 5.6) whereas it does with your previous download which seemed perfect.

My regards and thanks

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#22 Post by Karl Godt »

Hi Jasper ! It's because of the Puppy Philosophy to try to strip down as much as possible !

Likely

the first had a 10MB graph
xosview*diskBandwidth: 10000000 ! 10MB/s should be reasonable today for
and this one a 100MB graph
xosview*diskBandwidth: 100000000 ! 100MB/s

so tiny transfers of 4MB/s to slow SD cards would not show as graph .

Should show for huge transfers from HDD to HDD then .

Regards .

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#23 Post by Karl Godt »

HACK - Bletchley Park I'm comming !

Code: Select all

void MeterMaker::makeMeters(void){
  if (_xos->isResourceTrue("disk100"))
      push(new DiskMeter(_xos, "100M/s", atof(_xos->getResource("diskBandwidth100"))));
  if (_xos->isResourceTrue("disk10"))
      push(new DiskMeter(_xos, " 10M/s", atof(_xos->getResource("diskBandwidth10"))));
  if (_xos->isResourceTrue("disk2"))
      push(new DiskMeter(_xos, "  2M/s", atof(_xos->getResource("diskBandwidth2"))));
}

Code: Select all

   public:
        DiskMeter( XOSView *parent, const char *label, float max );
        ~DiskMeter( void );

Code: Select all

DiskMeter::DiskMeter( XOSView *parent, const char *label, float max ) : FieldMeterGraph(
  parent, 3, label, "READ/WRITE/IDLE"), _vmstat(false),
  _statFileName("/proc/stat")

Code: Select all

#endif
#if !defined(__hpux__) && !defined(__hpux)
//  Disk Meter Options
{ "-disk2", "*disk2", XrmoptionNoArg, "False" },
{ "+disk2", "*disk2", XrmoptionNoArg, "True" },
{ "-disk10", "*disk10", XrmoptionNoArg, "False" },
{ "+disk10", "*disk10", XrmoptionNoArg, "True" },
{ "-disk100", "*disk100", XrmoptionNoArg, "False" },
{ "+disk100", "*disk100", XrmoptionNoArg, "True" },
#endif
#ifdef ALLEVERYTHING

Code: Select all

void XOSView::figureSize ( void ) {
  if ( legend_ ){
    if ( !usedlabels_ )
      xoff_ = textWidth( "XXXXXXX" );
    else
      xoff_ = textWidth( "XXXXXXXXXXX" );

Code: Select all

    int offset;
    if ( dousedlegends_ )
      offset = parent_->textWidth( "XXXXXXXXXXX" );
    else
      offset = parent_->textWidth( "XXXXXXX" );
compiled on Puppy 4.3 glibc-2.6.1 as the first one .
To disable one of the meters : xosview -disk100 | -disk10 | -disk2
Attachments
xosview3diskmeters.jpg
(10.79 KiB) Downloaded 313 times
xosview-1.14_diskmeter2_10_100.bz2
(30.18 KiB) Downloaded 294 times

Jasper

#24 Post by Jasper »

Hi again Karl,

Bletchley Park is near to my home and yet so far away - I'm glad you were able to disclose your secret code - personally, I would never have been able to decode a single word of your message - so now I really appreciate both your code and your explanation.

My regards and special thanks

Also - greetings and thanks to SFR, another ace coder, for his contribution here.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#25 Post by Karl Godt »

Hi Jasper !

In 2010 when I started to fiddle around with xosview , I was not able to get more than four letters to work in the label part . Now I figured out that the part
that I altered that time in xosview.cc occurs several times in different files :
bitfieldmeter.cc
bitmeter.cc
fieldmeter.cc

Code: Select all

int offset;
    if ( dousedlegends_ )
      offset = parent_->textWidth( "XXXXXXXXXXX" );
    else
      offset = parent_->textWidth( "XXXXXXX" );
where the "XXXXX*" strings apparently indicate each X for a letter minus one X for linefeed or whatever (\0) .
I have left the four letters for the
void BitFieldMeter::drawused( int manditory ){
-function in bitfieldmeter.cc and fieldmeter.cc :
static const int onechar = parent_->textWidth( "X" );
static int xoffset = parent_->textWidth( "XXXXX" );

as is .
Here is some crytic explanation further down the file in the autoscale part :
/* For now, we can only print 3 characters, plus the optional
* suffix, without overprinting the legends. Thus, we can
* print 965, or we can print 34, but we can't print 34.7 (the
* decimal point takes up one character). bgrayson */


( That gbrew in my brain : proud : )

Added the const char *label, to linux/diskmeter.cc and linux/diskmeter.h , which I looked up in lmstemp.cc , since I knew it is possible tho change the label for it in Xdefaults .

:oops: Forgot to present Xdefaults :

Code: Select all

 ! Disk Meter Resources
xosview*diskUsedColor:      yellow
xosview*diskIdleColor:      LightGreen
xosview*diskWriteColor:     DarkRed
xosview*diskReadColor:      orange2
xosview*diskPriority:       10
xosview*diskDecay:          True
xosview*diskUsedFormat:     autoscale
xosview*diskGraph:          True

xosview*disk100:            True
xosview*diskBandwidth100:   100000000 ! 100MB/s
xosview*disk10:             True
xosview*diskBandwidth10:    10000000 ! 10MB/s
xosview*disk2:              True
xosview*diskBandwidth2:     2000000 ! 2MB/s
I have chosen 2M for the USB1.1 specification .
In version 1.8.3 xosview*diskBandwidth was set to 10MB/s by default, now they increased it to 100MB/s , which I did not check before . But since you wanted it for USB mainly :oops:
But it is difficult to http://en.wikipedia.org/wiki/Trust,_but_verify which we know it as Faith is good, control is better ( http://de.wikipedia.org/wiki/Vertrauen_ ... ist_besser![/url] -the ! seems to choke the BBcode [url] tag )

And in the Xrmcommandline.h there I disabled the possibility to fiddle with other meters now by wrapping them into the unset
#ifdef ALLEVERYTHING variable .

Todo would be to implement an option for +disk like
+disk DISKBANDWITH
, so that no hardcoded diskbandwithes in the configuration files needed .
-network maxbandwidth seems to have that already .

Hope that explains it a little .

Post Reply