0

I'm using MX Linux 21 (Debian 11 based OS), I could run this command from terminal, but when I created a launcher with terminal=true, it didn't work, what I'm missing? The command is

echo '2-2:1.0' | sudo tee /sys/bus/usb/drivers/usb-storage/unbind

and the .desktop entry is

[Desktop Entry]
Version=1.0
Type=Application
Name=Samsung Off
Comment=
Exec=echo '2-2:1.0' | sudo tee /sys/bus/usb/drivers/usb-storage/unbind
Icon=
Path=
Terminal=true
StartupNotify=false

1 Answer 1

2

Since this is a complex bash pipeline, you should use it that way:

Exec=bash -c "echo '2-2:1.0' | sudo tee /sys/bus/usb/drivers/usb-storage/unbind"

But I am concerned that sudo might be asking for a password, so in that case, it should be run in a terminal:

Exec=gnome-terminal -- bash -c "echo '2-2:1.0' | sudo tee /sys/bus/usb/drivers/usb-storage/unbind"
1
  • thanks, I don't have gnome-terminal, I have xfce4-terminal, replace yours with xfce4-terminal, but it did not ask for password, so I'm afraid it's not working, but the 1st option worked, the terminal asked me to enter password. Thanks so much.
    – michaelbr
    Commented Mar 6, 2022 at 16:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .