General TC > Programming & Scripting - Unofficial
Freqmon - a minimalistic approach to monitor CPU frequency
tinypoodle:
--- Quote from: Rich on March 23, 2013, 01:24:44 PM ---The end user will probably want to reposition it where they want it anyway.
--- End quote ---
That is the idea, I only added geometry just before uploading it, thinking about some safe generic default, but that proves to be more complicated than I thought.
My motivation to write this was for "something which does not get in the way", after always having ended up with a default aterm sticky and top layer, just to keep track of cpufreq. I have a preference for "best value per screen estate", and 'watcher' which does an excellent job inspired me, the only thing it lacks for my needs was cpufreq. On my system I have freqmon right bottom, to have that extra newline which I didn't manage to eliminate off screen.
Attached with -geometry 4x2+30+30 as requested.
Paulo:
Hi tinypoodle
--- Quote --- I have a preference for "best value per screen estate", and 'watcher' which does an excellent job....
--- End quote ---
Saving screen real estate is always a good thing however for some reason 'watch' always adds an extra line to it's output.
To save a line one could (theoretically) use this:
--- Code: ---echo -en "\033[1;23f"
--- End code ---
and call aterm with a geometry of 4x1
but that does not work.
If you are really keen on saving one line then why not try this:
--- Code: ---printf '\33]2;%s\007' $MyVariableToDisplay
--- End code ---
This will change the aterm title bar with the value in $MyVariableToDisplay
then use aterm with a geometry of 4x1.
Another advantage of using the title bar to display the required data is that the script can be minimized thus taking
no screen real estate at all and by simply glancing at the task bar will let you see it.
By the way, I also tried using a geometry of 4x0 since only the title bar is needed, but aterm goes bonkers.
One more thing that can be done is to right click on the title bar then select "shade".
This will leave only the title bar and thus saving one more line.
Hope it's of some help.
tinypoodle:
The title output sounds like an interesting approach, though not very portable, I guess. Not sure how exactly it would be done.
I tried piping output of watch to a named pipe and then using cat or dd, but I always get the extra line, yeah well, just gonna hide it off the bottom of screen :D
Paulo:
Hi tinypoodle
Using the title bar will work with terminals such as aterm, xterm and rxvt.
As regards the extra line, I am convinced that it's due to 'watch' because I tried with making the script loop with a timer
instead of using 'watch' and there was no extra line.
Perhaps 'tput' is the way to go as then there are no worries about portability and just maybe it will over-ride the extra line.
--- Quote ---DESCRIPTION
The tput utility uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell
--- End quote ---
Something like:
--- Code: ---tput cup <row> <column>
--- End code ---
tinypoodle:
Yes, it's definitely watch - I ended up to nc the output (using 127.0.0.1 as address) from 1 aterm to another, exactly same result.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version