I discovered today how to add modules to YaST. In the following, I used smart package manager to do this, but you can do this for any admin app.
First put this code:in /usr/share/YaST2/clients
{ // 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;
}
Next you'll put your applications icon in /usr/share/YaST2/theme/openSUSE/icons/32x3
and then put the [application name].desktop in /usr/share/applications/YaST2
The [application name].desktop, at least for smart, the code looks like this
[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
Now for more info on ycp you can read this http://forgeftp.novell.com/yast/doc/SL10.2/tdg/Book-YaSTReference.html
StartupNotify=true
Way cool Jonathnr! Sorry it is a bit hard to read with the Halloween theme up right now but will be changing Themes fairly soon.
Way cool Jonathnr! Sorry it is a bit hard to read with the Halloween theme up right now but will be changing Themes fairly soon.
-mattb4
the formatting didnt carry well either. I'd appreciate it if it could be fixed.
Nice. So your script actually replaces the YAST software manager, instead of just adding SMART?
Nice. So your script actually replaces the YAST software manager, instead of just adding SMART?
-bdquick
Not quite. I just renamed a couple of the YaST software files and there ya go. I did uninstall zypper and the YaST software modules though.
