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

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

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

Post by n150p »

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: 1383
Joined: 12 Feb 2009, 18:08
Location: Italy
Contact:

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

Post by voria »

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 Aug 2012, 15:16

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

Post by n150p »

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: 1383
Joined: 12 Feb 2009, 18:08
Location: Italy
Contact:

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

Post by voria »

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!
Post Reply