LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-11-2009, 01:43 PM   #1
Nikelandjelo
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
Ion3, statusbar monitor


I wrote monitor for displaying pcm volume. It works after restarting/booting ion3, but it stops in 4-20 minutes, and I can't find the reason. Does anybody have ideas?

This is monitor's code:
Code:
local function update_pcm()
        local all_info = io.popen("amixer sget PCM"):read("*a");
	local value = string.match(all_info, "%d+%%");
	if (value == nil) then
		state = "Error";
	end;
	statusd.inform("pcm", value);
	pcm_timer:set(1000, update_pcm);
end;

pcm_timer = statusd.create_timer();

update_pcm();
 
Old 10-12-2009, 03:14 PM   #2
Nikelandjelo
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Original Poster
Rep: Reputation: 0
I've solved this problem by myself. May be it's good to remove this thread.
But if smb wants to know, the problem was in:
Code:
local all_info = io.popen("amixer sget PCM"):read("*a");
local value = string.match(all_info, "%d+%%");
io.popen(...) returns nil sometimes, so error occurs in "string.match(all_info, "%d+%%");"

Last edited by Nikelandjelo; 10-12-2009 at 03:17 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I deleted the statusbar at the bottom of the screen of OpenSuse 11.1 (KDE4 desktop). hermanloos SUSE / openSUSE 7 11-05-2009 05:58 PM
Ion3 startup and F keys pootzko Linux - Desktop 4 10-12-2009 04:13 AM
ion3 phantom_cyph Linux - Desktop 10 01-06-2008 04:18 PM
Fluxbox System statusbar Kupo Linux - Software 5 04-30-2007 04:13 AM
Too big font [ion3] JussiKp Linux - Newbie 4 09-19-2006 06:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration