Results 1 to 9 of 9

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

  1. #1

    Default 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)
    Last edited by coolhand99; 03-Apr-2010 at 01:55. Reason: Info about my system

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,267
    Blog Entries
    1

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

    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.

  3. #3
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,267
    Blog Entries
    1

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

    Edit: Managed double reply somehow...

  4. #4

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

    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.... :-)

  5. #5
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,768
    Blog Entries
    14

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

    Did you try the script used on Ubuntu? Linux is linux.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  6. #6
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,267
    Blog Entries
    1

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

    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!

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,982

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

    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.
    Henk van Velden

  8. #8

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

    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.

  9. #9
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,654
    Blog Entries
    15

    Default Re: How do I make an icon, to open konsole, run a command and thentype password?

    Quote Originally Posted by coolhand99
    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;
    Code:
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •