Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

torsmo Tips & Tricks

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
223 posts
  • Page 5 of 9
    • Jump to page:
  • Previous
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • …
  • 9
  • Next
Author
Message
plbe
l33t
l33t
Posts: 661
Joined: Sat May 01, 2004 4:57 am

  • Quote

Post by plbe » Thu Apr 07, 2005 11:23 pm

Anyone ever get this gmail thing solved I get the same error as some of the other posters....

Wrong password, please check your settings.
Operation failed, connection to server is not established.
at ./gmail.pl line 15
Top
pvll
n00b
n00b
Posts: 15
Joined: Sat Jan 15, 2005 8:26 am
Location: Tallinn, Estonia

  • Quote

Post by pvll » Sat Apr 09, 2005 4:25 pm

Yes , I got ;)

Code: Select all

[ ~/torsmo_scripts ] pavel $ ./checker.pl 
totalmessages=88
usedspace=9658248
 [ ~/torsmo_scripts ] pavel $ cat gmail.txt 
totalmessages=86
newmessages=18
status=Using 9 MB (1%) of 1000 MB
Thank you for registering with Imageshack.us
[Bug 76691] New: Russian characters input in nano-1.3.5 is broken
et cetera ;) 

Here is my perl-5.8.6 site directory with modules from CPAN
http://www.hot.ee/natella/gmail_perl.txt
Top
Nuteater
Apprentice
Apprentice
User avatar
Posts: 193
Joined: Thu Sep 25, 2003 2:31 pm
Location: Jyväskylä, Finland
Contact:
Contact Nuteater
Website

Torsmo Infocon status

  • Quote

Post by Nuteater » Mon Apr 11, 2005 2:11 pm

I recently hacked together a little piece of python that fetches the current Infocon status from the Internet Storm Center to be displayed (color coded, I might add! :wink:) in torsmo.

To my knowledge, torsmo doesn't yet support if-constructs, so my script does the following: Reads the Infocon status from ISC, and outputs it to a file in the user's home directory. If the status is 'green', the script modifies ~/.infocon_green to contain 'green', and ~/.infocon_yellow and others to be empty. Now if torsmo just cats all these files in their respective colors, we get a green 'green' on the screen. If the status is 'red' we get a red 'red'... you get the idea. :)

Anyway, here's the script 'update_infocon.py'. Put it in your crontab for regular updating.

Code: Select all

#!/usr/bin/python
import os,sys,urllib2
dir = os.environ['HOME'] + os.sep
try:
    greenfile = file(dir + ".infocon_green", 'w')
    yellowfile = file(dir + ".infocon_yellow", 'w')
    orangefile = file(dir + ".infocon_orange", 'w')
    redfile = file(dir + ".infocon_red", 'w')
except:
    print "Error opening files!"
    sys.exit(1)
filedict = {"green" : greenfile, "yellow" : yellowfile, "orange" : orangefile, "red" : redfile}
status = urllib2.urlopen('http://isc.sans.org/infocon.txt').read(6)
status = status.strip() #Get rid of possible newlines etc.
statusfile = filedict[status]
try:
    statusfile.write(status)
except:
    print "Error writing file!"
for file in [greenfile, yellowfile, orangefile, redfile]:
    file.close()
Here's the .torsmorc bit to print the output:

Code: Select all

Infocon: ${color green}${execi 20 cat ~/.infocon_green}${color yellow}${execi 20 cat ~/.infocon_yellow}${color
 orange}${execi 20 cat ~/.infocon_orange}${color red}${execi 20 cat ~/.infocon_red}
I probably should point out the obvious: There is absolutely no warranty. This is my first ever python script to do anything remotely intelligent. It might not work right. It might ignite your hard drive or cause instant death. It is an ugly hack by an unexperienced programmer. If you use it you do so at your own risk. As far as licensing goes, this little python snippet is public domain for all that I care.

That said, I hope someone finds this useful! :wink:
I am Nuteater, hear me roar.
Top
laue
n00b
n00b
User avatar
Posts: 46
Joined: Mon Nov 08, 2004 11:06 pm
Location: Wortel - Belgium - Europe

  • Quote

Post by laue » Fri Apr 15, 2005 10:20 am

how do i enable xft fonts? is it a use flag by any chance? am very puzzled.

when i run torsmo with "use_xft yes", i get the message: "XFT not enabled"
Top
beissemj
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 100
Joined: Mon Jan 10, 2005 8:09 pm
Location: Orlando, FL

  • Quote

Post by beissemj » Wed Apr 20, 2005 10:44 pm

plbe wrote:Wrong password, please check your settings.
Operation failed, connection to server is not established.
at ./gmail.pl line 15
If you are getting the above error you need to enable "pop" in you gmail account.
Settings --> Forwarding and Pop. That will solve that problem... :D :D :D (only took me 2 hours to figure out...)
Top
ssn
n00b
n00b
Posts: 41
Joined: Sat Apr 23, 2005 8:06 am

  • Quote

Post by ssn » Sat Apr 23, 2005 9:05 am

this xmms.pl dont work for me. torsmo displays Title and Time perfectly but Status, Playlist, Artist and Bitrate are saying: Usage error xmms.pl [keyname]

my .torsmorc:

Code: Select all

TEXT
         ${color}Sims
  ${kernel}

 ${color}${time %A %d.%m.%y}

${color white}CPU
  ${color}Load   ${color} $cpu%
  ${color}UpTime  ${color}$uptime
  ${color}Process ${color}${processes}
  ${color}Running ${color}${running_processes}

${color white}MEMORY
  ${color}RAM   ${color} $mem/$memmax
  ${color}Swap  ${color} $swap/$swapmax

${color white}FILE SYSTEM
  ${color}Root  ${color}${fs_used /}/${fs_size /}
  ${color}Store ${color}${fs_used /home}/${fs_size 
/home}

${color white}NETWORK

  ${color}Up     ${color} ${upspeed eth0} k/s
  ${color}Down   ${color} ${downspeed eth0} k/s 

XMMS:
 ${color grey}Status    : $color${execi 10 perl ~/.torsmo/xmms.pl
Status}
 ${color grey}Playlist  : $color${execi 10 perl ~/.torsmo/xmms.pl
Playlist}

 ${color grey}Title     : $color${execi 10 perl ~/.torsmo/xmms.pl Title}
 ${color grey}Artist    : $color${execi 10 perl ~/.torsmo/xmms.pl
Artist}

 ${color grey}Bitrate   : $color${execi 10 perl ~/.torsmo/xmms.pl
Bitrate}
 ${color grey}Time      : $color${execi 10 perl ~/.torsmo/xmms.pl Time}
my xmms.pl:

Code: Select all

#!/usr/bin/perl
# Perl script to display XMMS song info on Torsmo
# Requires XMMS::InfoPipe module and xmms-infopipe plugin

use XMMS::InfoPipe;

my $numArgs = $#ARGV+1;

if($numArgs != 1) {
   print "Usage error: xmms.pl [keyname]\n";
   exit;
}

else {
   my $key = $ARGV[0];
   my $xmms = XMMS::InfoPipe->new();
   my $playing = $xmms->is_playing();
   my $paused = $xmms->is_paused();

   # display info since XMMS is playing/paused
   if($playing == 1 || $paused == 1) {

      # extract song artist
      if($key eq "Artist") {
         my $title = $xmms->{info}->{Title};
         @song = split(/ - /, $title);
         my $artist = $song[0];

         #truncate long artist names
         if(length($artist) >= 30) {
            my $temp = substr($artist, 0, 30);
            $artist = $temp . "...";
         }
         print $artist , "\n";
      }

      # extract song title
      elsif($key eq "Title") {
         my $title = $xmms->{info}->{Title};
         @song = split(/ - /, $title);
         print $song[1] , "\n";      
      }

      # join position and length times, ie 2:04 / 4:50
      elsif($key eq "Time") {
         my $length = $xmms->{info}->{Time};
         my $position = $xmms->{info}->{Position};
         print $position , " / " , $length , "\n";
      }

      # format bitrate, ie 192 kbps
      elsif($key eq "Bitrate") {
         my $bitrate = $xmms->{info}->{"Current bitrate"};
         print $bitrate/1000 , " kbps\n";
      }

      # number of tunes in playlist
      elsif($key eq "Playlist") {
         my $tunes = $xmms->{info}->{"Tunes in playlist"};
         print $tunes , " tunes\n";
      }

      # print out info for other keys (case sensitive,'cat /tmp/xmms-info')
      else {
         print $xmms->{info}->{$key} , "\n";
      }
   }

   # display status only since XMMS is not playing/paused
   else {
      if($key eq "Status") {
         print $xmms->{info}->{Status} , "\n";
      }
   }
} 

torsmo message:

Code: Select all

sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
Top
Shiner_Man
Apprentice
Apprentice
User avatar
Posts: 180
Joined: Tue Mar 09, 2004 10:57 pm
Contact:
Contact Shiner_Man
Website

  • Quote

Post by Shiner_Man » Sat Apr 23, 2005 8:31 pm

Here is a hacked up python script to display the latest packages added to portage:

Code: Select all

#!/usr/bin/env python

import urllib

data = urllib.urlopen('http://packages.gentoo.org/archs/x86/stable/gentoo_simple.rss').read()
datalist = data.splitlines()

final = []
for x in datalist:
    #REMOVE WHITESPACES IN THE BEGINNING OF EACH LINE
    line = x.strip()
    if line.startswith('<title>'):
        final.append(line[7:-8])

for x  in final[1:]:
        print x
Change the url to whatever feed you want. You can find all the feeds from here:

http://packages.gentoo.org/feeds/

Then add it to your .torsmorc file like this:

Code: Select all

${color orange}New Gentoo Packages:
${color white}${execi 1800 /path/to/gentoo_packages.py}
My Site
Top
pinguvin
n00b
n00b
Posts: 4
Joined: Sun Apr 24, 2005 4:21 am

  • Quote

Post by pinguvin » Sun Apr 24, 2005 4:26 am

could anybody please tell me how to center my torsmo.. i want it to appear bottom center, but right now its bottom left..:?
Top
Tyir
Apprentice
Apprentice
User avatar
Posts: 172
Joined: Mon Mar 08, 2004 5:45 am
Location: Montreal

  • Quote

Post by Tyir » Sun Apr 24, 2005 4:38 am

pinguvin wrote:could anybody please tell me how to center my torsmo.. i want it to appear bottom center, but right now its bottom left..:?
Sorry, you can only put it in the four corners, AFAIK

And sorry to steal your thunder Shiner_Man, but I stole/modified my own, it has the descriptions for the packages.

You need the RSS.py library, and put in your path
http://www.mnot.net/python/RSS.py
and put it in /usr/lib/python2.x

Code: Select all

#!/usr/bin/env python
#
from RSS import ns, CollectionChannel, TrackingChannel
#Create a tracking channel, which is a data structure that
#Indexes RSS data by item URL
tc = TrackingChannel()

#Returns the RSSParser instance used, which can usually be ignored
tc.parse("http://packages.gentoo.org/archs/x86/stable/gentoo_simple.rss")

RSS10_TITLE = (ns.rss10, 'title')
RSS10_DESC = (ns.rss10, 'description')

#You can also use tc.keys()
items = tc.listItems()
for item in items[:4]:
    #Each item is a (url, order_index) tuple
    #Get all the data for the item as a Python dictionary
    item_data = tc.getItem(item)
    print item_data.get(RSS10_TITLE, "(none)")

    words = item_data.get(RSS10_DESC, "(none)").split()
    desc = words[0]
    for word in words[1:]:
        if len(desc) + len(word) + 1 > 40:
            print '   ' + desc
            desc = word
        else:
            desc = desc + ' ' + word
        
    print '   ' + desc
There are two things I have learnt in life:
1. Don't reveal everything you know.
Top
Indech
n00b
n00b
Posts: 22
Joined: Mon Jan 10, 2005 4:58 pm

  • Quote

Post by Indech » Sun Apr 24, 2005 7:00 am

I'm looking at replacing gkrellm with torsmo but there is one function I've yet to figure out.

How can you get torsmo to report on the transfer rate of your hardrives, both as a composite and individually?
Top
hpestilence
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 82
Joined: Thu Dec 16, 2004 9:26 pm

  • Quote

Post by hpestilence » Sun Apr 24, 2005 9:15 pm

pinguvin wrote:could anybody please tell me how to center my torsmo.. i want it to appear bottom center, but right now its bottom left..:?
You have to mess with the gap_x

For me its gap_x 510 for around the center on 1280x1024
When the plague descends from Heaven above only Darkness will be your one true ally.
Top
Shiner_Man
Apprentice
Apprentice
User avatar
Posts: 180
Joined: Tue Mar 09, 2004 10:57 pm
Contact:
Contact Shiner_Man
Website

  • Quote

Post by Shiner_Man » Mon Apr 25, 2005 1:51 pm

Tyir wrote:
pinguvin wrote:could anybody please tell me how to center my torsmo.. i want it to appear bottom center, but right now its bottom left..:?
Sorry, you can only put it in the four corners, AFAIK

And sorry to steal your thunder Shiner_Man, but I stole/modified my own, it has the descriptions for the packages.

You need the RSS.py library, and put in your path
http://www.mnot.net/python/RSS.py
and put it in /usr/lib/python2.x

Code: Select all

#!/usr/bin/env python
#
from RSS import ns, CollectionChannel, TrackingChannel
#Create a tracking channel, which is a data structure that
#Indexes RSS data by item URL
tc = TrackingChannel()

#Returns the RSSParser instance used, which can usually be ignored
tc.parse("http://packages.gentoo.org/archs/x86/stable/gentoo_simple.rss")

RSS10_TITLE = (ns.rss10, 'title')
RSS10_DESC = (ns.rss10, 'description')

#You can also use tc.keys()
items = tc.listItems()
for item in items[:4]:
    #Each item is a (url, order_index) tuple
    #Get all the data for the item as a Python dictionary
    item_data = tc.getItem(item)
    print item_data.get(RSS10_TITLE, "(none)")

    words = item_data.get(RSS10_DESC, "(none)").split()
    desc = words[0]
    for word in words[1:]:
        if len(desc) + len(word) + 1 > 40:
            print '   ' + desc
            desc = word
        else:
            desc = desc + ' ' + word
        
    print '   ' + desc
SWEET! I didn't know their was an RSS library.
My Site
Top
laue
n00b
n00b
User avatar
Posts: 46
Joined: Mon Nov 08, 2004 11:06 pm
Location: Wortel - Belgium - Europe

  • Quote

Post by laue » Tue Apr 26, 2005 11:25 am

ssn wrote:this xmms.pl dont work for me. torsmo displays Title and Time perfectly but Status, Playlist, Artist and Bitrate are saying: Usage error xmms.pl [keyname]

my .torsmorc:

Code: Select all

TEXT
         ${color}Sims
  ${kernel}

 ${color}${time %A %d.%m.%y}

${color white}CPU
  ${color}Load   ${color} $cpu%
  ${color}UpTime  ${color}$uptime
  ${color}Process ${color}${processes}
  ${color}Running ${color}${running_processes}

${color white}MEMORY
  ${color}RAM   ${color} $mem/$memmax
  ${color}Swap  ${color} $swap/$swapmax

${color white}FILE SYSTEM
  ${color}Root  ${color}${fs_used /}/${fs_size /}
  ${color}Store ${color}${fs_used /home}/${fs_size 
/home}

${color white}NETWORK

  ${color}Up     ${color} ${upspeed eth0} k/s
  ${color}Down   ${color} ${downspeed eth0} k/s 

XMMS:
 ${color grey}Status    : $color${execi 10 perl ~/.torsmo/xmms.pl
Status}
 ${color grey}Playlist  : $color${execi 10 perl ~/.torsmo/xmms.pl
Playlist}

 ${color grey}Title     : $color${execi 10 perl ~/.torsmo/xmms.pl Title}
 ${color grey}Artist    : $color${execi 10 perl ~/.torsmo/xmms.pl
Artist}

 ${color grey}Bitrate   : $color${execi 10 perl ~/.torsmo/xmms.pl
Bitrate}
 ${color grey}Time      : $color${execi 10 perl ~/.torsmo/xmms.pl Time}
my xmms.pl:

Code: Select all

#!/usr/bin/perl
# Perl script to display XMMS song info on Torsmo
# Requires XMMS::InfoPipe module and xmms-infopipe plugin

use XMMS::InfoPipe;

my $numArgs = $#ARGV+1;

if($numArgs != 1) {
   print "Usage error: xmms.pl [keyname]\n";
   exit;
}

else {
   my $key = $ARGV[0];
   my $xmms = XMMS::InfoPipe->new();
   my $playing = $xmms->is_playing();
   my $paused = $xmms->is_paused();

   # display info since XMMS is playing/paused
   if($playing == 1 || $paused == 1) {

      # extract song artist
      if($key eq "Artist") {
         my $title = $xmms->{info}->{Title};
         @song = split(/ - /, $title);
         my $artist = $song[0];

         #truncate long artist names
         if(length($artist) >= 30) {
            my $temp = substr($artist, 0, 30);
            $artist = $temp . "...";
         }
         print $artist , "\n";
      }

      # extract song title
      elsif($key eq "Title") {
         my $title = $xmms->{info}->{Title};
         @song = split(/ - /, $title);
         print $song[1] , "\n";      
      }

      # join position and length times, ie 2:04 / 4:50
      elsif($key eq "Time") {
         my $length = $xmms->{info}->{Time};
         my $position = $xmms->{info}->{Position};
         print $position , " / " , $length , "\n";
      }

      # format bitrate, ie 192 kbps
      elsif($key eq "Bitrate") {
         my $bitrate = $xmms->{info}->{"Current bitrate"};
         print $bitrate/1000 , " kbps\n";
      }

      # number of tunes in playlist
      elsif($key eq "Playlist") {
         my $tunes = $xmms->{info}->{"Tunes in playlist"};
         print $tunes , " tunes\n";
      }

      # print out info for other keys (case sensitive,'cat /tmp/xmms-info')
      else {
         print $xmms->{info}->{$key} , "\n";
      }
   }

   # display status only since XMMS is not playing/paused
   else {
      if($key eq "Status") {
         print $xmms->{info}->{Status} , "\n";
      }
   }
} 

torsmo message:

Code: Select all

sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
sh: line 2: Status: command not found
sh: line 2: Playlist: command not found
sh: line 2: Artist: command not found
sh: line 2: Bitrate: command not found
My guess is: you only put the title and time on one line. Try putting the other xmms.pl uses on one line as well
example:

${color grey}Status : $color${execi 10 perl ~/.torsmo/xmms.pl
Status}

should be:

${color grey}Status : $color${execi 10 perl ~/.torsmo/xmms.pl Status}
Top
ssn
n00b
n00b
Posts: 41
Joined: Sat Apr 23, 2005 8:06 am

  • Quote

Post by ssn » Tue Apr 26, 2005 12:42 pm

yeah, thanks! that worked.
now my next problem is that no matter what font I select torsmos displaying the same one :(
Top
laue
n00b
n00b
User avatar
Posts: 46
Joined: Mon Nov 08, 2004 11:06 pm
Location: Wortel - Belgium - Europe

  • Quote

Post by laue » Tue Apr 26, 2005 3:12 pm

ssn wrote:yeah, thanks! that worked.
now my next problem is that no matter what font I select torsmos displaying the same one :(
please post your torsmorc
Top
ssn
n00b
n00b
Posts: 41
Joined: Sat Apr 23, 2005 8:06 am

  • Quote

Post by ssn » Wed Apr 27, 2005 1:34 pm

Code: Select all

# torsmo configuration
# torsmo configuration

# set to yes if you want tormo to be forked in the background
background yes

# X font used, you can pick one with program xfontsel
#font 5x7
font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-fixed-medium-*-*-*-*-*-*-*-*-*-*-*

# mail spool
mail_spool $MAIL

# Update interval in seconds
update_interval 5.0

# Create own window instead of using desktop (required in nautilus)
own_window no

# Minimum size of text area
minimum_size 280 5

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 8

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color black

# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 12
gap_y 12

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no


TEXT
         ${color}Sims
  ${kernel}

 ${color}${time %A %d.%m.%y}

${color white}CPU
  ${color}Load   ${color} $cpu%
  ${color}UpTime  ${color}$uptime
  ${color}Process ${color}${processes}
  ${color}Running ${color}${running_processes}

${color white}MEMORY
  ${color}RAM   ${color} $mem/$memmax
  ${color}Swap  ${color} $swap/$swapmax

${color white}FILE SYSTEM
  ${color}Root  ${color}${fs_used /}/${fs_size /}
  ${color}Store ${color}${fs_used /home}/${fs_size 
/home}

${color white}NETWORK

  ${color}Up     ${color} ${upspeed eth0} k/s
  ${color}Down   ${color} ${downspeed eth0} k/s 


XMMS:
 ${color grey}Status    : $color${execi 10 perl ~/.torsmo/xmms.pl Status}
 ${color grey}Playlist  : $color${execi 10 perl ~/.torsmo/xmms.pl Playlist}

 ${color grey}Title     : $color${execi 10 perl ~/.torsmo/xmms.pl Title}
 ${color grey}Artist    : $color${execi 10 perl ~/.torsmo/xmms.pl Artist}

 ${color grey}Bitrate   : $color${execi 10 perl ~/.torsmo/xmms.pl Bitrate}
 ${color grey}Time      : $color${execi 10 perl ~/.torsmo/xmms.pl Time}


Top
ndrake
n00b
n00b
User avatar
Posts: 7
Joined: Mon Jun 14, 2004 11:43 am

  • Quote

Post by ndrake » Thu Apr 28, 2005 2:21 am

For the people having trouble getting the Gmail perl modules, try this.

o Become root
o Do 'perl -MCPAN -e shell'
o Answer all the configuration questions it asks you. I should be able to just use the defaults for most of the questions
o One it is configured, at the cpan> prompt type:
o install Mail::Webmail::Gmail
o Answer yes when it asks to install the dependencies
o install GMail::Checker
o Answer yes when it asks to install the dependencies

After that you should have everything necessary to run chrishchun's gmail script. After I installed the gmail stuff and changed the username/password in the script, it ran without any trouble.
Top
Tyir
Apprentice
Apprentice
User avatar
Posts: 172
Joined: Mon Mar 08, 2004 5:45 am
Location: Montreal

  • Quote

Post by Tyir » Thu Apr 28, 2005 5:40 am

Hey, recent problem, I don't know if it is me... I'm using .18, and I noticed that my i2c sensors aren't updating.

When torsmo is first launched, they get the correct values (i2c temp 1), but then they stay that way, stuck.
Everything else updates normally.

Any ideas?
There are two things I have learnt in life:
1. Don't reveal everything you know.
Top
grad_guy
Tux's lil' helper
Tux's lil' helper
Posts: 109
Joined: Tue Nov 16, 2004 6:35 pm
Location: UCSD, La Jolla, CA
Contact:
Contact grad_guy
Website

  • Quote

Post by grad_guy » Thu Apr 28, 2005 9:02 pm

Hi,
I am glad my tweather.sh script can be of use for some people. I myself still use it. :D
There are some bugs when they separate AM and PM weather, but that dosn't happen too often, so I'll still leave it alone.

Here comes 'yet another xmms/bmp info script'. It will show some minimalistic info like this

Here is tmusic.sh.

Code: Select all

#!/bin/bash

#This script is free to modify and distribute.
#If you make some cool modification to it, let me know at straivir@ucsd.edu
#Use at your own risk.

#Requirement: bmp-infopipe and/or xmms-infopipe

#Todo: make that song title scrolling within maxcol

#User Setting here
maxcol=21
file=/tmp/xmms-info
player=BMP

#Grab needed information
status=`cat $file | grep Status: | cut -d : -f2`
title=`cat $file | grep Title: | cut -d : -f2`
pos=`cat $file | grep uSecPosition: | cut -d : -f2`
len=`cat $file | grep uSecTime: | cut -d : -f2`

#Count the length in characters of the title
size=`echo $title | wc -c`
#Calculate current position within that length
poscol=$(echo "$pos*$maxcol/$len" | bc)

#Printing
echo $player $status
echo $title | fmt -w $maxcol
for (( i=0; i<$maxcol; i++ ))
do
  if [ $i -eq $poscol ]; then
    echo -n 'O'
  else
    echo -n '='
  fi
done
#For new line
echo
Here is part of .torsmorc.

Code: Select all

${stippled_hr 2 1}
${color slate grey}Music: ${color }${execi 4 ~/tmusic.sh}
${stippled_hr 2 1}
Top
hpestilence
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 82
Joined: Thu Dec 16, 2004 9:26 pm

  • Quote

Post by hpestilence » Fri Apr 29, 2005 12:55 am

Hey, recent problem, I don't know if it is me... I'm using .18, and I noticed that my i2c sensors aren't updating.

When torsmo is first launched, they get the correct values (i2c temp 1), but then they stay that way, stuck.
Everything else updates normally.
Yeah I had sensor reading problems too this is what I did.

I found where my sensors were then which one is which (from cpu and motherboard) and added the following:

Code: Select all

${exec expr `cat /sys/bus/i2c/devices/1-0290/temp1_input` / 1000}
I had to do it like that because my sensors read like 39000 for cpu so I divided by 1000.

Oh yeah, your sensors should be located in "/sys/bus/i2c/devices" too
When the plague descends from Heaven above only Darkness will be your one true ally.
Top
Tyir
Apprentice
Apprentice
User avatar
Posts: 172
Joined: Mon Mar 08, 2004 5:45 am
Location: Montreal

  • Quote

Post by Tyir » Fri Apr 29, 2005 3:31 am

hpestilence wrote:
Hey, recent problem, I don't know if it is me... I'm using .18, and I noticed that my i2c sensors aren't updating.

When torsmo is first launched, they get the correct values (i2c temp 1), but then they stay that way, stuck.
Everything else updates normally.
Yeah I had sensor reading problems too this is what I did.

I found where my sensors were then which one is which (from cpu and motherboard) and added the following:

Code: Select all

${exec expr `cat /sys/bus/i2c/devices/1-0290/temp1_input` / 1000}
I had to do it like that because my sensors read like 39000 for cpu so I divided by 1000.

Oh yeah, your sensors should be located in "/sys/bus/i2c/devices" too
Yea, that works, but I didn't want to revert to exec.
Anyway, I found out that it is becase of i2c changes in linux > 2.6.10
There is a patch:
http://sourceforge.net/tracker/index.ph ... tid=650931
There are two things I have learnt in life:
1. Don't reveal everything you know.
Top
Poe
Bodhisattva
Bodhisattva
User avatar
Posts: 2155
Joined: Sat Apr 03, 2004 5:57 pm
Location: Mysłowice/Lublin, Poland
Contact:
Contact Poe
Website

  • Quote

Post by Poe » Fri Apr 29, 2005 11:03 am

@grad_guy
Can I please your full .torsmorc? If you want/can, please send to my mail (under signature) or send here.
thanks and greetz
Hardware:HP Pavilion DV6875SE[C2DT5550@1.83GHz_3GB-DDR2_320GB-SATA_GF8400GS]
http://popularcoffee.blogspot.com - Popkulturowa Kawa
RLU#342333
Top
grad_guy
Tux's lil' helper
Tux's lil' helper
Posts: 109
Joined: Tue Nov 16, 2004 6:35 pm
Location: UCSD, La Jolla, CA
Contact:
Contact grad_guy
Website

  • Quote

Post by grad_guy » Fri Apr 29, 2005 10:26 pm

Poe wrote:@grad_guy
Can I please your full .torsmorc? If you want/can, please send to my mail (under signature) or send here.
thanks and greetz

Code: Select all

background no
font -*-terminus-*-*-*-*-*-*-*-*-*-*-*-*

use_xft 1
xftfont Terminus :pixelsize=10
xftalpha 0.8

update_interval 1.0
own_window no
minimum_size 80 5
draw_shades yes
draw_outline no
draw_borders no
stippled_borders 0
border_margin 2
border_width 1
default_color white
default_shade_color black
default_outline_color black
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
gap_x 5
gap_y 100
no_buffers yes
uppercase no

TEXT
${color slate grey}${time %a, }${color }${time %e %B %G} 
${color slate grey}${time %Z,    }${color }${time %H:%M:%S}
${stippled_hr 2 1}
 ${execi 40000 cal}${stippled_hr 2 1}
${color slate grey}UpTime: ${color }$uptime 
${color slate grey}Lnx ${color }$kernel 
${stippled_hr 2 1}
${color slate grey}Net :
     ${color}Up  :${color } ${upspeed eth0} k/s
     ${color}Down:${color } ${downspeed eth0} k/s ${color} 
${stippled_hr 2 1}
${color slate grey}CPU :${color } $cpu%
     ${cpubar 3}
${color slate grey}RAM :${color } $memperc% $mem/$memmax
     ${membar 3}
${color slate grey}SWAP:${color } $swapperc% $swap/$swapmax
     ${swapbar 3}
${stippled_hr 2 1}
${color slate grey}Cpu   Mem   Procs ${color }
${execi 10 ps gaxo %cpu,%mem,comm | sort +0nr | head -n 5 | sed -e 's/-bin//' | sed -e 's/-media-play//'}
${stippled_hr 2 1}
${color slate grey}ROOT: ${color }${fs_used_perc /}% -- ${fs_size /}
     ${fs_bar 3 /}
${color slate grey}DHDD: ${color }${fs_used_perc /mnt/dhdd}% -- ${fs_size /mnt/dhdd}
     ${fs_bar 3 /mnt/dhdd}
${color slate grey}NFS1 : ${color }${fs_used_perc /mnt/nfs}% -- ${fs_size /mnt/nfs}
     ${fs_bar 3 /mnt/nfs}
${color slate grey}NFS2 : ${color }${fs_used_perc /mnt/nfs2}% -- ${fs_size /mnt/nfs2}
     ${fs_bar 3 /mnt/nfs2}
${stippled_hr 2 1}
${color slate grey}Weather :${color}
${execi 900 /home/nui/.torsmo/tweather.sh Today}
${stippled_hr 2 1}
${color slate grey}Tomorrow :${color}
${execi 900 /home/nui/.torsmo/tweather.sh Tomorrow}
${stippled_hr 2 1}
${color slate grey}Music: ${color }${execi 3 /home/nui/.torsmo/tmusic.sh}
${stippled_hr 2 1}
${color slate grey}Battery: ${color }$battery
Top
blendmaster
Apprentice
Apprentice
Posts: 196
Joined: Sun May 02, 2004 1:13 pm

  • Quote

Post by blendmaster » Tue May 03, 2005 2:31 am

Another way to get xmms info

This method is pretty simple. first you need xmmsctrl 1.8 or higher

Code: Select all

# emerge xmmsctrl
then, its pretty easy from reading the xmmsctrl help page (run "xmmsctrl help") to find out what commands you need to put into .torsmorc.
<snip>
print <string> : general formatted print, similar to printf. The codes are:
%n : new line,
%t : tab,
%F : current filename,
%T : current title,
%P : current position,
%s : playback time in sec,
%m : playback time in min:sec,
%S : song length in sec,
%M : song length in min:sec,
%v : master volume,
%l : playlist length,
%p : playback time in percent,
<snip>
then just do somthing like this:

Code: Select all

${color green}XMMS
${color}$stippled_hr
${color #1E90FF}title: ${color}${execi 10 /usr/bin/xmmsctrl title|cut -c -22}
${color #1E90FF}time: ${color}${execi 5 /usr/bin/xmmsctrl print %m} of ${execi 5 /usr/bin/xmmsctrl print %M}
${color #1E90FF}playlist: ${color}playing ${execi 10 /usr/bin/xmmsctrl print %P} of ${execi 10 /usr/bin/xmmsctrl print %l}
the cut is just to shorten the output so it won't widen the window. you could do all of them 1 second update times but then it uses a lot of cpu power. the end result looks somthing like this. the only bad thing about this method is that theres no way to just get the author or just the title. maybe in the next release of xmmsctrl.
Top
BosHaus
n00b
n00b
Posts: 40
Joined: Thu Jul 29, 2004 11:57 pm
Location: Dallas, TX

  • Quote

Post by BosHaus » Thu May 05, 2005 2:57 pm

I've been trying to get torsmo to load multiple instances at once in gnome.. I see that there's the option to double buffer and have them as windows, but then I get 4 copies of Torsmo showing up in my task bar on each of my desktops. Is there a way to hide those or am I going to have to single buffer and display them on the root? (the ficker drives me nuts).

http://www.calvin.edu/~awb3/new.jpg is an example of what I"m talkin about.
Top
Post Reply

223 posts
  • Page 5 of 9
    • Jump to page:
  • Previous
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • …
  • 9
  • Next

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic