Page 1 of 1

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

Posted: 02 Aug 2012, 15:24
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?

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

Posted: 02 Aug 2012, 16:51
by voria
You found a bug. :P

I've just fixed it in the bzr branch (link).

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

Posted: 02 Aug 2012, 20:49
by n150p
Oh well. :lol:

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

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

Posted: 02 Aug 2012, 21:18
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).