great idea, i'd say defintely submit that.dmr wrote:While I was reading through this discussion I thought of one thing that could be added.
This patch is not as revolutionary as the xft support (this one really made my day), it's tiny and consists of two lines, but gives me disproportionate satisfaction as it's my first one.
torsmo-cvs-setlocale.patch
It applies to the CVS version.
Torsmo speaks my language now. I see "sobota" instead of "Saturday". I hope you will find it practical. Maybe it could even be worth sending to the sourceforge project page.
Code: Select all
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $
ECVS_SERVER="cvs.sourceforge.net:/cvsroot/torsmo"
ECVS_MODULE="torsmo"
ECVS_TOP_DIR="${DISTDIR}/cvs-src/${PN}"
inherit debug flag-o-matic eutils cvs
DESCRIPTION="System monitor that sits in the corner of your desktop"
HOMEPAGE="http://torsmo.sourceforge.net/"
KEYWORDS="x86 ~ppc ~amd64"
SLOT="0"
LICENSE="BSD"
IUSE="mozilla"
RDEPEND="virtual/libc
virtual/x11"
DEPEND="${RDEPEND}
>=sys-devel/automake-1.4
sys-devel/autoconf
sys-apps/grep
sys-apps/sed
sys-devel/gcc"
S=${WORKDIR}/${ECVS_MODULE}
src_compile(){
cd ${S}
epatch ${FILESDIR}/cvs_addused.patch
use mozilla && epatch ${FILESDIR}/cvs_mozilla.patch
epatch ${FILESDIR}/torsmo-cvs-setlocale.patch
./autogen.sh
./configure --host=${CHOST} --prefix=/usr --enable-xft || die "./configure failed"
emake || die
}
src_install(){
make DESTDIR=${D} \
install || die "./install failed"
dodoc ChangeLog AUTHORS README torsmorc.sample
}
pkg_postinst() {
einfo 'default configuration file is "~/.torsmorc"'
einfo "you can find a sample configuration file in"
einfo "/usr/share/doc/${PF}/torsmorc.sample.gz"
einfo
einfo "Comment out temperature info lines if you have no kernel"
einfo "support for it."
einfo
ewarn "Torsmo doesn't work with window managers that"
ewarn "take control over root window such as Gnome's nautilus."
ewarn "May not work on KDE until you exit (and then only breifly)"
ewarn "for the above reason."
}
Code: Select all
use mozilla && epatch ${FILESDIR}/cvs_mozilla.patch Code: Select all
use mozilla && epatch ${FILESDIR}/torsmo-mozilla.patchCode: Select all
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils cvs
ECVS_SERVER="cvs.sourceforge.net:/cvsroot/torsmo"
ECVS_MODULE="torsmo"
ECVS_TOP_DIR="${DISTDIR}/cvs-src/${PN}"
DESCRIPTION="System monitor that sits in the corner of your desktop"
HOMEPAGE="http://torsmo.sourceforge.net/"
KEYWORDS="x86 ppc ~amd64"
SLOT="0"
LICENSE="BSD"
IUSE="mozilla xft seti"
RDEPEND="virtual/libc
virtual/x11"
DEPEND="${RDEPEND}
>=sys-devel/automake-1.4
sys-devel/autoconf
sys-apps/grep
sys-apps/sed
sys-devel/gcc"
S=${WORKDIR}/${ECVS_MODULE}
src_unpack() {
cvs_src_unpack
cd ${S}
epatch ${FILESDIR}/cvs_addused.patch
use mozilla && epatch ${FILESDIR}/torsmo-mozilla.patch
epatch ${FILESDIR}/torsmo-cvs-setlocale.patch
sed -e 's/CONF(xftfont)/CONF("xftfont")/' -i torsmo.c
}
src_compile() {
./autogen.sh
econf `use_enable seti` \
`use_enable xft` || die "./configure failed"
emake || die
}
src_install() {
make DESTDIR=${D} install || die "make install failed"
mv ${D}/usr/bin/torsmo ${D}/usr/bin/torsmo-cvs
mv ${D}/usr/share/man/man1/torsmo.1 ${D}/usr/share/man/man1/torsmo-cvs.1
dodoc ChangeLog AUTHORS README torsmorc.sample
}
pkg_postinst() {
einfo 'default configuration file is "~/.torsmorc"'
einfo "you can find a sample configuration file in"
einfo "/usr/share/doc/${PF}/torsmorc.sample.gz"
einfo
einfo "Comment out temperature info lines if you have no kernel"
einfo "support for it."
einfo
ewarn "Torsmo doesn't work with window managers that"
ewarn "take control over root window such as Gnome's nautilus."
ewarn "May not work on KDE until you exit (and then only briefly)"
ewarn "for the above reason."
}Code: Select all
#!/bin/sh
FAN=`cat /sys/bus/i2c/devices/2-0290/fan1_input`
FAN_REAL=$((FAN/2))
echo $FAN_REAL;
i dont fetch my mail... so that won't work.killfire wrote:i would suggest that you get an app like fetchmail to run on a cron script, and then point torsmo to the mailbox.
or if you use a mail client (like thunderbird, or really anything that fetchs its own mail) then you can have itt running in another desktop and automatically check your mail, and then point torsmo to your mailbox file.
i think that would be cleaner than having torsmo do it with an execi, especially because then you only have to hit the server once, instead of twice (otherwise you would check it, and then once you got an email you would have to fetch it)....
killfire
Hayl wrote:\
i dont fetch my mail... so that won't work.
it is left on my IMAP server.
Code: Select all
#!/bin/sh
status=`fetchmail -c`
total=$( echo "$status" | grep -o "^[0-9]*" - )
seen=$( echo "$status" | sed "s/^[0-9]*[^0-9]*\([0-9]*\).*/\1/" )
new=$(( $total - $seen ))if you want to change it to KEYWORDS="x86 ppc ~amd64", i can confirm that it works on ppc.affinity wrote:I edited the ebuild to make it install as /usr/bin/torsmo-cvs instead of /usr/bin/torsmo.
I also added 2 new use flags and made some other minor changes.
Code: Select all
**snip** KEYWORDS="x86 ~ppc ~amd64" **snip**
reversing the patch should be as easy as getting a copy of the patch and:Paranoid wrote:killfire (re. proper fan speed),
After browsing the source & checking out some of the patches that have been added to the source code this is going to be a bigger problem than I thought. A patch that has been added to the source-I2C divisor is majorly flawed. I'm not going to go into too much detail but if you look at the patch on the project page and check out/have knowledge of lm_sensors fan divisors this is so wrong. So basically that patch needs to be reversed. My plan is to add a variable in the .torsmorc file to compute proper fan speed. Not sure how I'm going to do this yet as I'm no programmer but any ideas would be appreciated. Right now my head hurtsso I'm going to take a break until tomorrow. Time to buy a book on C...
Code: Select all
patch -R <./patch
Code: Select all
--- torsmo.c 2004-08-30 20:07:15.000000000 -0400
+++ torsmo_new.c 2004-08-31 21:53:43.476471640 -0400
@@ -1005,9 +1005,9 @@
r = get_i2c_info(obj->data.i2c.fd, obj->data.i2c.arg);
if (r >= 100.0 || r == 0)
- snprintf(p, n, "%d", (int) r);
+ snprintf(p, n, "%d", ((int) r)/2);
else
- snprintf(p, n, "%.1f", r);
+ snprintf(p, n, "%.1f", r/2);
}
OBJ(kernel) {
snprintf(p, n, "%s", cur->uname_s.release);
^ This works, thanks.dmr wrote:This one works fine for me (tribute to Windfall):You can echo the $new variable and put it with execi to the torsmo's output. Don't forget to add 'options keep' to the .fetchmailrc. At least I want to keep themCode: Select all
#!/bin/sh status=`fetchmail -c` total=$( echo "$status" | grep -o "^[0-9]*" - ) seen=$( echo "$status" | sed "s/^[0-9]*[^0-9]*\([0-9]*\).*/\1/" ) new=$(( $total - $seen ))
I have a feeling that would take a lot of doing, as torsmo as it is now, is meant to draw text on the root, it doesnt do anything to do with backgrounding (AFAIK).syscrash2k wrote:Could anybody write up a patch so that torsmo can have a background colour? It would be much appreciated, thanks![]()
(I don't know C)