2

I tried adding a desktop shortcut like described here

but those answers seem to be outdated since 19.10

I try to add this script as launcher on my desktop:

sudo /usr/local/sbin/turbo-boost.sh toggle

you find the script and my try to add it as desktop icon here: https://unix.stackexchange.com/a/547261/20661


UPDATE:

The .desktop file doesn't work if I click on it in the default file browser nautilus in Ubuntu 19.10, but it works fine in a thunar window.

I tried this now: I created another launcher with the command line

Exec=sudo /usr/bin/tempfile

which behaves strange:

  • If I call this in nautilus it creates a temp file which belongs to my user
  • If called in thunar, it asks for sudo password in another shell window and then creates a temp file that belongs to root
rubo77
  • 32,486

1 Answers1

1

This .desktop-file works if you have an entry in sudoers:

my_username_here ALL = NOPASSWD: /usr/local/sbin/turbo-boost.sh

Make sure, you add an entry Path and GenericName and put it in this location: /usr/share/applications/toggle-turbo-boost.desktop

[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Name=toggle turbo-boost
Icon=/usr/share/icons/Humanity/apps/64/gkdebconf-icon.svg
Exec=sudo /usr/local/sbin/turbo-boost.sh toggle
X-MultipleArgs=false
Categories=GNOME;GTK;
StartupNotify=true
GenericName=Toggle Turbo-Boost
Path=/tmp/

It is not possible to click on it in nautilus, but you can search for i in the dash:

  1. press SUPER and search for "Toggle Turbo Boost", you will see the icon.
  2. press ENTER to execute, or right click to "Add to Favorites" which will add a button in the quick-start bar.
rubo77
  • 32,486