Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Adding smart to YaST

  1. #1
    Join Date
    Jun 2008
    Posts
    1,825
    Blog Entries
    1

    Default Adding smart to YaST

    I thought it might be fun if I did this. At this point, I'm just tinkering. But one could add yum or apt4rpm/synaptic as well, or even all.

    I did try going to #yast they said
    <mvidner> Jonathan_R: you could add an icon to the yast control center to call some smart-gui
    <Jonathan_R> well yeah
    <Jonathan_R> but how would i do that
    <Jonathan_R> that is a start
    <Jonathan_R> it might be fun to use the yast software manager gui for the gui front end of the smart cli
    <Jonathan_R> i'm just tinkering right now
    <mvidner> Jonathan_R: see /usr/share/applications/YaST
    <Jonathan_R> just trying to see whats possible
    <bubli> mvidner: That wouldn't help. It is necessary, but not sufficient condition
    <mvidner> Jonathan_R: oh. that would be hard, I think
    <Jonathan_R> at this point i'd settle for something like this
    <Jonathan_R> adding smart as an option
    <bubli> Everything in /usr/share/applications/YaST is executed as '/sbin/yast [X-SuSE-YaST-Call]'
    <Jonathan_R> so that a user could choose software manager or smart\
    <bubli> while value of X-SuSE-YaST-Call must be a YaST client
    <Jonathan_R> ok
    <Jonathan_R> so how sould I get 1) the smart gui icon to show in software
    <Jonathan_R> and 2) to get that to be called and work
    So I checked all that out. The file /sbin/yast is pastebin - collaborative debugging tool which I don't see how to do as they suggest and add [X-SuSE-YaST-Call]
    ______________________________________________________________________________________
    Don't ask "if" something can be done, for it can always be done. Rather instead ask "How" can it be done.

  2. #2
    Join Date
    Jun 2008
    Posts
    1,825
    Blog Entries
    1

    Default Re: Adding smart to YaST

    So apparently ya need to add this code
    Code:
    { // begin
    
    //===================================================================
    // Start smart either Text (commandline) or GUI mode
    //-------------------------------------------------------------------
    integer status = 0;
    
    if (UI::TextMode())
    {
            y2milestone("Running smart in command line mode.");
        Popup::Error(_("Cannot run smart in text-mode"));
            status = (integer)UI::RunInTerminal("/usr/bin/smart");
    }
    else
    {
            y2milestone("Running smart in GUI mode.");
            status = (integer)SCR::Execute(.target.bash, "/usr/bin/smart");
    }
    
    y2milestone("smart finished with exit code: <%1>", status);
    if (status == 0) {
            return `next;
    }
    return `nil;
    
    }
    and put it here /usr/share/YaST2/clients The same would be true for yum or synaptic. As far as the icons, add an icon to YaST control centre you'll need 1) create .new .desktop file alike to those already present in /usr/share/applications/YaST2

    I hope this helps someone other than me. It was fun.

    Much thanks to bubli in #yast for writing the ycp code and helping me with this.
    ______________________________________________________________________________________
    Don't ask "if" something can be done, for it can always be done. Rather instead ask "How" can it be done.

  3. #3
    Join Date
    Jun 2008
    Posts
    1,825
    Blog Entries
    1

    Default Re: Adding smart to YaST

    Actually, I had to do some debugging. The code looks like this
    Code:
    { // begin
    
    //===================================================================
    // Start smart either Text (commandline) or GUI mode
    //-------------------------------------------------------------------
    integer status = 0;
    
    if (UI::TextMode())
    {
            y2milestone("Running smart in command line mode.");
        // Popup::Error(_("Cannot run smart in text-mode"));
            status = (integer)UI::RunInTerminal("/usr/bin/smart --shell");
    }
    else
    {
            y2milestone("Running smart in GUI mode.");
        // Popup::Error(_("Cannot run smart in GUI-mode"));
            status = (integer)SCR::Execute(.target.bash, "/usr/bin/smart --gui");
    }
    
    y2milestone("smart finished with exit code: <%1>", status);
    if (status == 0) {
            return `next;
    }
    return `nil;
    
    }
    By default, it brings up the smart gui. Now as I said, you can modify this so that you could have yumex or synaptic if you wanted.
    ______________________________________________________________________________________
    Don't ask "if" something can be done, for it can always be done. Rather instead ask "How" can it be done.

  4. #4
    palladium NNTP User

    Default Re: Adding smart to YaST

    > By default, it brings up the smart gui. Now as I said, you can modify
    > this so that you could have yumex or synaptic if you wanted.


    i think what you have done has a lot of 'neat' appeal, but i wonder
    what is the added benefit of having YaST launch smart, rather than
    directly placing smart in the menu system and click on it instead of
    YaST..

    or, you could make a menu item which launched a window where you could
    then have an icon to choose between:

    YaST
    Smart
    Yumex (whatever that is)
    Synaptic/Apt
    a root powered CLI
    whatever...

    --
    palladium

  5. #5
    Join Date
    Jun 2008
    Posts
    1,825
    Blog Entries
    1

    Default Re: Adding smart to YaST

    Quote Originally Posted by palladium View Post
    > By default, it brings up the smart gui. Now as I said, you can modify
    > this so that you could have yumex or synaptic if you wanted.


    i think what you have done has a lot of 'neat' appeal, but i wonder
    what is the added benefit of having YaST launch smart, rather than
    directly placing smart in the menu system and click on it instead of
    YaST..

    or, you could make a menu item which launched a window where you could
    then have an icon to choose between:

    YaST
    Smart
    Yumex (whatever that is)
    Synaptic/Apt
    a root powered CLI
    whatever...

    --
    palladium

    I'm not sure what you mean by "window where you could
    then have an icon" Here is what it looks like on my end
    ______________________________________________________________________________________
    Don't ask "if" something can be done, for it can always be done. Rather instead ask "How" can it be done.

  6. #6
    Join Date
    Jun 2008
    Posts
    1,825
    Blog Entries
    1

    Default Re: Adding smart to YaST

    I had to put the smart icon in /usr/share/YaST2/theme/openSUSE/icons/32x32 to get it to show up in YaST. The smart.desktop file looks like this
    Code:
    [Desktop Entry]
    
    Type=Application
    Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Software;
    
    X-KDE-ModuleType=Library
    X-KDE-RootOnly=true
    X-KDE-HasReadOnlyMode=true
    X-KDE-Library=yast2
    X-SuSE-YaST-Call=smart
    
    X-SuSE-YaST-Group=Software
    X-SuSE-YaST-Argument=
    X-SuSE-YaST-RootOnly=true
    X-SuSE-YaST-AutoInst=
    X-SuSE-YaST-Geometry=
    X-SuSE-YaST-AutoInstResource=
    
    Icon=smart
    Exec=/sbin/yast2 smart
    
    Name=Smart Package Manager
    GenericName=A next generation package manager written in python that functions on multiple distributions
    X-KDE-SubstituteUID=true
    StartupNotify=true
    For more info on ycp see http://forgeftp.novell.com/yast/doc/...Reference.html
    ______________________________________________________________________________________
    Don't ask "if" something can be done, for it can always be done. Rather instead ask "How" can it be done.

  7. #7
    Join Date
    Jun 2008
    Posts
    1,825
    Blog Entries
    1

    Default Re: Adding smart to YaST

    @palladium

    Yes, I am aware. Infact, I have smart as a quick launch on my bottom pannel.
    ______________________________________________________________________________________
    Don't ask "if" something can be done, for it can always be done. Rather instead ask "How" can it be done.

  8. #8
    Join Date
    Jun 2008
    Posts
    1,825
    Blog Entries
    1

    Default Re: Adding smart to YaST

    Just as a point of interest, you can use the script, modify it of course, to put any admin app into YaST. Guarddog, firestarter, cups, and so on. Now you know how to make YaST into whatever you want.
    ______________________________________________________________________________________
    Don't ask "if" something can be done, for it can always be done. Rather instead ask "How" can it be done.

  9. #9
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,731
    Blog Entries
    2

    Default Re: Adding smart to YaST

    Pretty impressive Jonathan_R. And easier to grasp without the side issues of the missing posts.
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  10. #10
    Join Date
    Jun 2008
    Location
    East of Podunk
    Posts
    32,908
    Blog Entries
    15

    Default Re: Adding smart to YaST

    Quote Originally Posted by Jonathan R
    Just as a point of interest, you can use the script, modify it of
    course, to put any admin app into YaST. Guarddog, firestarter, cups, and
    so on. Now you know how to make YaST into whatever you want.
    Hi
    I'm assuming the X reference can be changed for the GTK/Gnome version?

    --
    Cheers Malcolm (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
    up 17 days 5:40, 3 users, load average: 0.06, 0.02, 0.00
    GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18


Page 1 of 2 12 LastLast

Posting Permissions

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