Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
torsmo issues
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page Previous  1, 2, 3, 4 ... 12, 13, 14  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
dmr
n00b
n00b


Joined: 09 Aug 2004
Posts: 10
Location: Wroclaw, Poland

PostPosted: Sat Aug 21, 2004 7:35 pm    Post subject: Reply with quote

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.
_________________
Szymon
Back to top
View user's profile Send private message
nightm4re
Guru
Guru


Joined: 20 Jun 2004
Posts: 519
Location: Providence, RI, USA

PostPosted: Sat Aug 21, 2004 8:14 pm    Post subject: Reply with quote

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.


great idea, i'd say defintely submit that.
_________________
Nitrogen - GtkMM based background setter/restorer, please test!
Minuslab | d.minuslab.net
Back to top
View user's profile Send private message
Dracnor
Guru
Guru


Joined: 08 Jun 2003
Posts: 397
Location: Pennsylvania

PostPosted: Sun Aug 22, 2004 12:53 am    Post subject: Reply with quote

Hi,
I decided to try to write an ebuild for torsmo cvs after reading through this thread as some of the patches were for the cvs version. I included 3 patches cvs_addused.patch, cvs_mozilla.patch (which had a small error preventing it from compiling), and torsmo-cvs-setlocale.patch. Here is the ebuild I came up with (needs to go in your portage overlay):

Code:
# 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."
}


In the portage overlay directory I made a category app-admin, and then torsmo-cvs, and name the above ebuild torsmo-cvs-20040821.ebuild. Now you have to download the patches (the 3 I mentioned above, look in the previous posts) and put them in the "files" directory. Edit the cvs_mozilla.patch to change if (strchr(buf+21, '0') =! NULL) to if (strchr(buf+21, '0') != NULL) so that it will compile. Now just do ebuild torsmo-cvs-20040821.ebuild digest and then emerge it. Enjoy! Feel free to edit the ebuild to make it better and redistribute or contact me or to add patches, etc.

HTH
_________________
Registered Linux User #335028
Back to top
View user's profile Send private message
affinity
n00b
n00b


Joined: 01 Jul 2004
Posts: 66

PostPosted: Sun Aug 22, 2004 3:29 am    Post subject: Reply with quote

You should probably use torsmo-mozilla.patch instead of cvs_mozilla.patch.
Back to top
View user's profile Send private message
Dracnor
Guru
Guru


Joined: 08 Jun 2003
Posts: 397
Location: Pennsylvania

PostPosted: Sun Aug 22, 2004 4:08 am    Post subject: Reply with quote

Thanks affinity. That applies cleanly. You can just modify the line
Code:
use mozilla && epatch ${FILESDIR}/cvs_mozilla.patch
to
Code:
use mozilla && epatch ${FILESDIR}/torsmo-mozilla.patch
in the src_compile() funtion and re-digest and emerge. It worked on my system no problem.
_________________
Registered Linux User #335028
Back to top
View user's profile Send private message
affinity
n00b
n00b


Joined: 01 Jul 2004
Posts: 66

PostPosted: Sun Aug 22, 2004 1:09 pm    Post subject: Reply with quote

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:
# 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."
}


Last edited by affinity on Thu Nov 11, 2004 2:38 pm; edited 2 times in total
Back to top
View user's profile Send private message
Paranoid
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 290
Location: Portland, ME

PostPosted: Sun Aug 22, 2004 4:09 pm    Post subject: Reply with quote

Great work people, the XFT support is nice! I love this app. One thing I haven't been able to accomplish and not sure it can be done at this stage is applying a formula to the i2c sensors data before it's displayed - IE. my fan speed read by i2c must be divided by 2 to get the correct value. Is there any way to do this?
_________________
A paranoid is someone who knows a little of what's going on.
William S. Burroughs
Back to top
View user's profile Send private message
dmr
n00b
n00b


Joined: 09 Aug 2004
Posts: 10
Location: Wroclaw, Poland

PostPosted: Sun Aug 22, 2004 4:39 pm    Post subject: Reply with quote

What comes to my mind right now is a shell script, eg.
Code:
#!/bin/sh
FAN=`cat /sys/bus/i2c/devices/2-0290/fan1_input`
FAN_REAL=$((FAN/2))
echo $FAN_REAL;

inserted using exec, but eventually I guess it's not very elegant and effective (consumes resources).

Formulas seem interesting IMHO. It could elimate problems with data presentation (percentages). Question is: what's the limit for torsmo's features?
_________________
Szymon
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Tue Aug 24, 2004 7:10 pm    Post subject: Reply with quote

sorry about the bug in my patch. ive updated it, but ive been out of town for a few days.

i woudl suggest, for the fan issues, instead of a script, just patch the main source (correction, sources, theyve finally split it :)....

i would try to do this, but i dont have the sensors to test it.

my suggestion, is open up either torsmo.c or linux.c (get a copy of the cvs version, definately), im not sure which one it is, and find the line where they return the value, and just change the return to:
(what they had)/2

it should be pretty simple, and cleaner and less cpu using than a script.

torsmo.c is broken up into three (i think) main parts for each function. find the last one, it holds the displayed data.... i can try to look into it, but i really dont think ill get anywhere, because i cant test it.

dmr:
the limit is what you make it. in a less general, rediculous answer, dig into the code, and see how your ideas can be implemented, it may be easier than you think. the fact that we changed (ok, it hasnt been all that much) what we've changed, very easily, implies that other changes could be implemented as well.

give us a beta of what your thinking of, and then maybe we can all try to hack something up.

right now, i want double buffering! (the redraws are getting to be annoying)

killfire
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com
Back to top
View user's profile Send private message
Hayl
Guru
Guru


Joined: 28 Jan 2003
Posts: 442
Location: Calgary, Alberta, Canada

PostPosted: Fri Aug 27, 2004 12:12 pm    Post subject: Reply with quote

Is there a cli-based app that will check IMAP mailboxes so I can have it pipe its self back to torsmo?
_________________
"I do not fear computers. I fear lack of them." - Isaac Asimov
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Fri Aug 27, 2004 3:49 pm    Post subject: Reply with quote

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
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com
Back to top
View user's profile Send private message
dmr
n00b
n00b


Joined: 09 Aug 2004
Posts: 10
Location: Wroclaw, Poland

PostPosted: Fri Aug 27, 2004 4:52 pm    Post subject: Reply with quote

Maybe this isn't a point, but I've been struggling with Xft font encoding for some time and I give up. The setlocale patch is half good when a word consists of the i18n letters.
When I type in GIMP these characters are displayed properly, but how do I tell torsmo to use iso8559-2 instead of the default iso88559-1?
_________________
Szymon
Back to top
View user's profile Send private message
Hayl
Guru
Guru


Joined: 28 Jan 2003
Posts: 442
Location: Calgary, Alberta, Canada

PostPosted: Sun Aug 29, 2004 11:05 pm    Post subject: Reply with quote

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


i dont fetch my mail... so that won't work.

it is left on my IMAP server.
_________________
"I do not fear computers. I fear lack of them." - Isaac Asimov
Back to top
View user's profile Send private message
Paranoid
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 290
Location: Portland, ME

PostPosted: Sun Aug 29, 2004 11:52 pm    Post subject: Reply with quote

Thanks for the info Killfire, sounds easy enough. Will check it out tomorrow.
_________________
A paranoid is someone who knows a little of what's going on.
William S. Burroughs
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Mon Aug 30, 2004 12:50 am    Post subject: Reply with quote

Hayl wrote:
\

i dont fetch my mail... so that won't work.

it is left on my IMAP server.



sorry, my mistake.

fetchmail has a -c option, which means just check it, dont fetch, which should work for you, but fetchmail may seem a bit heavy for what your trying to do. let me know if that works out.

killfire
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com
Back to top
View user's profile Send private message
dmr
n00b
n00b


Joined: 09 Aug 2004
Posts: 10
Location: Wroclaw, Poland

PostPosted: Tue Aug 31, 2004 5:04 pm    Post subject: Reply with quote

This one works fine for me (tribute to Windfall):
Code:
#!/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 ))

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 them ;)
_________________
Szymon
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Tue Aug 31, 2004 5:20 pm    Post subject: Reply with quote

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:

**snip**
KEYWORDS="x86 ~ppc ~amd64"
**snip**


if you want to change it to KEYWORDS="x86 ppc ~amd64", i can confirm that it works on ppc.

question:

have you submitted the ebuild upstream?

killfire
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com
Back to top
View user's profile Send private message
affinity
n00b
n00b


Joined: 01 Jul 2004
Posts: 66

PostPosted: Tue Aug 31, 2004 6:26 pm    Post subject: Reply with quote

killfire wrote:
if you want to change it to KEYWORDS="x86 ppc ~amd64", i can confirm that it works on ppc.

Done.
killfire wrote:
have you submitted the ebuild upstream?

No.
Back to top
View user's profile Send private message
Paranoid
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 290
Location: Portland, ME

PostPosted: Wed Sep 01, 2004 1:43 am    Post subject: Reply with quote

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 hurts :wink: so I'm going to take a break until tomorrow. Time to buy a book on C...
_________________
A paranoid is someone who knows a little of what's going on.
William S. Burroughs
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Wed Sep 01, 2004 2:02 am    Post subject: Reply with quote

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 hurts :wink: so I'm going to take a break until tomorrow. Time to buy a book on C...


reversing the patch should be as easy as getting a copy of the patch and:
Code:

patch -R <./patch

in the directory of torsmo-cvs(you are using the cvs version right?)

also look at this if youd like. im not even too sure which variable it is you are calling, but if it is i2c, then this patch will split all the return values. something similar to this should do what you need, but as i do not have sensors to test if the patch will work, im not going to be much help.
Code:

--- 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);


just patch <./i2c.patch in the torsmo-cvs directory (this is a patch against cvs sources, but mine may be a bit stale so sorry if its off by a couple lines, shouldnt matter though). also, on the patch, the first values are not going to be all that acccurate, as its ints/2 (and ints cannot hold decimal values) but it should be close enough.

writing a new variable is not that complicated.

there are three places in torsmo.c that it needs to be mentioned, follow the pattern for the rest and it should be pretty straioghtforward. also, if you are going to be making new functions, putting them in linux.c (i think) would be wise, and make sure to put the prototypes in torsmo.h

--killfire
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com
Back to top
View user's profile Send private message
Hayl
Guru
Guru


Joined: 28 Jan 2003
Posts: 442
Location: Calgary, Alberta, Canada

PostPosted: Wed Sep 01, 2004 2:21 pm    Post subject: Reply with quote

dmr wrote:
This one works fine for me (tribute to Windfall):
Code:
#!/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 ))

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 them ;)


^ This works, thanks.
_________________
"I do not fear computers. I fear lack of them." - Isaac Asimov
Back to top
View user's profile Send private message
Paranoid
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 290
Location: Portland, ME

PostPosted: Wed Sep 01, 2004 5:32 pm    Post subject: Reply with quote

Thanks for the advice killfire, working on it now...
_________________
A paranoid is someone who knows a little of what's going on.
William S. Burroughs
Back to top
View user's profile Send private message
CybeRDukE
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jul 2002
Posts: 92

PostPosted: Wed Sep 01, 2004 6:07 pm    Post subject: Reply with quote

i really agree with you, torsmo is great!

and so i wrote a little patch that reads the temperature-sensors of nvidia-based graphics cards. maybe someone wants to try it and give me some feedback. it's available at torsmos's project page.
Back to top
View user's profile Send private message
syscrash
Guru
Guru


Joined: 14 Apr 2003
Posts: 541

PostPosted: Thu Sep 02, 2004 4:06 pm    Post subject: Reply with quote

Could anybody write up a patch so that torsmo can have a background colour? It would be much appreciated, thanks :P
(I don't know C)
_________________
Play ET? Come by #gentoo.et on freenode!
http://syscrash.ca
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Thu Sep 02, 2004 4:56 pm    Post subject: Reply with quote

syscrash2k wrote:
Could anybody write up a patch so that torsmo can have a background colour? It would be much appreciated, thanks :P
(I don't know C)


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).

heres an ugly hack toget what i think your looking for:
(ill edit and post a screenie if i can):
open up you background with gimp, and draw a solid color block (or it could be partially transparent) in the spot where torsmo resides, and then it will look like it has a background color :)
[EDIT]
heres a shot, its kind of messy, and if you tried harder, you could mess with rounded corners and all that:
http://www.sover.net/~ljohnstn/fake_torsmo_bg.jpg
but if i could come up with that in five minutes, im sure you coud hack something up to your liking. btw, i used a blue box at 30 percent opacity for this shot.
[/EDIT]

just my two cents.

-killfire
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com


Last edited by killfire on Thu Sep 02, 2004 5:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page Previous  1, 2, 3, 4 ... 12, 13, 14  Next
Page 3 of 14

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum