How do I make an icon, to open konsole, run a command and then type password?

I have been trying to make a USB modem work on opensuse (the gsm wireless broadband type).

I have edited the usb_modeswitch config file, so that Opensuse now recognizes my Huawei 1732 modem. It works just fine.

BUT… to make to modem start, I have to run usb_modeswitch.

Is it possible to have an icon, that can be clicked, that will do the following:

Open konsole.
Run the command usb_modeswitch
Type my password

I did this in Ubuntu, but I cannot find out how to in Opensuse…

If this question is in the wrong place in the forums, please tell me, and I’ll correc it.

Thanx!


OS: Linux 2.6.31.12-0.2-pae i686
KDE: 4.3.1 “version 6”
System: openSUSE 11.2 (i586)

Does NetworkManager recognise the device? What is the output of ‘lsusb’ with device plugged in?

From memory, there is a file /usr/share/hal/fdi/information/10freedesktop/10-modem.fdi (or similar) which assists NM (via HAL) identify various devices by vendor and product ID. You may find you can edit this file (as root) to include your device’s ID, so that it can be controlled via NM.

Edit: Managed double reply somehow…

Yeah, NM recognizes the USB stick. But I have to run the usb_modeswitch command, so that the system does not mistake it for a usb memory stick.

As soon as I open konsole, and run usb_modeswitch, the modem pops up, and connects automatically.

I’ll try your solution, but what I was after was a simple icon that will open a console and run a command… :slight_smile:

Did you try the script used on Ubuntu? Linux is linux.

Yeah, NM recognizes the USB stick. But I have to run the usb_modeswitch command, so that the system does not mistake it for a usb memory stick.

As soon as I open konsole, and run usb_modeswitch, the modem pops up, and connects automatically.

A simple udev rule could be used to activate usb-modeswitch as outlined here:

usb-modeswitch - GeeksOnHigh!

To make an icon, anywhere on the desktop right click, unlock widgets, right click again, add widget. You can add a command to the widget (of course) and that can be a konsole call. And a konsole call can have a command to be executed inside it (I did not re-check all the docs of the new konsole, but that is how I should go).

When konsole is not very willing (the redesign has some flaws imho), try good old xterm.

EDIT: I like the udev solution.

Tried the udev rule… no go. Still have to run the usb_modeswitch from konsole (and then it works fiiiine).

The icon method (my choice, if I have one) also is no go. I do click on the add widget, but then I get a list of available widgets… none fits what I need.

I am SURE I am missing something very basic here…

Anyone?

If it were not for my father, I would just open the konsole and rund the d**n command when I wanted to use the mobile broadband… but he will have problems with that one.

Hi
All you need to run is;


kdesu /usr/sbin/usb_modeswitch

In KDE you should be able to create a launcher? If so enter the above
command and you should be good to go.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 5 days 21:55, 5 users, load average: 1.72, 1.65, 1.50
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.53