How to 'grep' Samsung Tools on the command line?

Discussions about Linux installation and configuration on Samsung laptops
n150p
Supporter
Supporter
Posts: 4
Joined: 02/08/2012, 15:16

How to 'grep' Samsung Tools on the command line?

Postby n150p » 02/08/2012, 15:24

Hi guys,

I'd like to grep some details from samsung-tools on the command line to show them in my system monitor (it's conky, but that doesn't matter for the question).

I try to use grep to read the output from samsung-tools, however, I only get an error.

Here's what I do:

Code: Select all

~$ samsung-tools -c status | grep -w 'mode'
Traceback (most recent call last):
  File "/usr/bin/samsung-tools", line 771, in <module>
    main()
  File "/usr/bin/samsung-tools", line 723, in main
    Cpu(options.cpu, options.show_notify).apply()
  File "/usr/bin/samsung-tools", line 276, in apply
    print CPU_TEMPERATURE + " " + self.__temp() + unicode(" °C", "utf8")
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 22: ordinal not in range(128)


What I wanted to do: the command was supposed to print out the 'Fan mode: ...' line. Obviously, it does not.

As I'm just an experienced user but not a code guy, I don't know what the error means. Can somebody tell me what I am doing wrong?

User avatar
voria
Administrator
Administrator
Posts: 1378
Joined: 12/02/2009, 18:08
Location: Italy
Contact:

Re: How to 'grep' Samsung Tools on the command line?

Postby voria » 02/08/2012, 16:51

You found a bug. :P

I've just fixed it in the bzr branch (link).
Image
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!

n150p
Supporter
Supporter
Posts: 4
Joined: 02/08/2012, 15:16

Re: How to 'grep' Samsung Tools on the command line?

Postby n150p » 02/08/2012, 20:49

Oh well. :lol:

Thanks for the quick fix. How long will it approximately take to show up in the ubuntu repositories?

User avatar
voria
Administrator
Administrator
Posts: 1378
Joined: 12/02/2009, 18:08
Location: Italy
Contact:

Re: How to 'grep' Samsung Tools on the command line?

Postby voria » 02/08/2012, 21:18

Well, I have no plans for a new release at the moment.

If you need the fix quickly, you can just apply it to your installed Samsung Tools.
Edit the file '/usr/bin/samsung-tools' and add the 3 new lines of code as shown in the bzr commit (link).
Image
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Return to “Linux On My Samsung”

Who is online

Users browsing this forum: No registered users and 1 guest