Executing echo Command Using Launcher Icon [duplicate]

I am controlling the fan speed on my notebook using acpi and the command:

echo level n > /proc/acpi/ibm/fan
  • where level n is a number between 1 and 7.

It works, and after I changed the permissions of the fan file I was able to write to it from a terminal screen.

However, when I create a new launcher to do this from the desktop it doesn't work. The above line is in the 'Command' section and I have set permissions so that the icon is executed as a program but when I double-click on it nothing happens. There are no error messages displayed.

Is there something special about using the echo command in a launcher or am I doing this totally wrong?

4

1 Answer

I do this type of things a different way.

  1. Create a script ~./local/bin/fan.sh like this:

     #!/bin/sh
    echo level 5 > /proc/acpi/ibm/fan
  2. Make it executable

    chmod +x ~./local/bin/fan.sh
  3. Create a shortcut to this commad:

    pkexec /home/$USER/.local/bin/fan.sh

It will ask for a password.

This is for 18.04. In previous versions use gksu instead of pkexec.

1

You Might Also Like