LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-15-2011, 09:31 AM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 364

Rep: Reputation: 16
acpi result in hardstatus line in screen


Hi,

the command acpi gives me the percentage of battery that my laptop has. I would like to print the result of acpi in the hardstatus line of "screen".

How can I do that?
 
Old 04-15-2011, 11:18 PM   #2
corp769
Guru
 
Registered: Apr 2005
Posts: 5,807

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
Hello,

Can you please explain more of what you mean by placing the result in the "hardstatus" line? Thanks!

Josh
 
Old 04-17-2011, 11:58 AM   #3
xeon123
Member
 
Registered: Sep 2006
Posts: 364

Original Poster
Rep: Reputation: 16
The screen program contains a line at the bottom of the terminal that contains all the tabs that are open. In that line you can put also the time.

Here's my screenrc:
Code:
startup_message off
vbell off
escape /
defscrollback 5000
hardstatus alwayslastline
escape ^Bb
hardstatus string '%{= kG}%-Lw%{= kW}%50> %n*%f %t%{= kG}%+Lw%< %{= kG}%-=%D %m/%d/%y | %C:%s %A | %1`%{-}'
screen -t shell 0 bash
screen -t shell 1 bash
screen -t shell 2 bash
screen -t shell 3 bash
screen -t emacs 4 bash
screen -t emacs 5 bash
screen -t emacs 6 bash
screen -t elinks 7 bash
The hardstatus command of the screen configuration file is the hardstatus line that I'm talking about. Now, I would like to put the result of the command acpi in that line, so that I could see always the percentage of battery I still have.

The acpi command gives me the percentage of the battery that I still have:
Code:
acpi | awk  '{ print $4 }'
I would like to put the result of the command in the hardstatus instruction. How can I do that?

Thanks
 
Old 04-17-2011, 02:30 PM   #4
corp769
Guru
 
Registered: Apr 2005
Posts: 5,807

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
You could possibly make use of backticks to execute a command within declaring the hardstatus. I don't use screen all that much, so something like the following is what I am talking about:
Code:
`acpi | awk  '{ print $4 }'`
 
Old 04-18-2011, 02:01 AM   #5
xeon123
Member
 
Registered: Sep 2006
Posts: 364

Original Poster
Rep: Reputation: 16
no, doesn't work. I think it's not possible. Thanks anyway.
 
Old 04-18-2011, 05:22 AM   #6
corp769
Guru
 
Registered: Apr 2005
Posts: 5,807

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
You might be in luck: http://web.archiveorange.com/archive...FpmpQ6Lr4QavXv

Let me know if that would work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to disable acpi on command line Fred Caro Linux - Newbie 1 08-14-2010 06:26 AM
Delete first line from a grep result mbjunior99 Linux - Desktop 5 07-02-2009 01:07 AM
Reading screen output line by line basildon Linux - Newbie 1 09-23-2008 01:33 PM
showing grep result without the whole line Dr_Death_UAE Linux - General 12 09-07-2006 06:12 AM
How do I kill a screen from command-line if I know the screen name? CrewXp Linux - Software 6 08-27-2005 10:35 AM


All times are GMT -5. The time now is 03:31 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration