Lefora Free Forum
88 views

Adding modules to YaST

Page 1
posts 1–9 of 9
Gecko - moderator
154 posts

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

Lizard King - founder
1451 posts

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.

__________________
Learn Linux in your spare time! Start now on a exciting future where the pay and prestige is unlimited. suseunbound.lefora.com/
Gecko - moderator
154 posts

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.

Gecko - moderator
154 posts

Here is what my YaST looks like now.

Monitor Lizard - admin
548 posts

Nice.  So your script actually replaces the YAST software manager, instead of just adding SMART?

__________________
www.suseunbound.com I'm a PC and I run on Linux
Gecko - moderator
154 posts

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.

Monitor Lizard - admin
548 posts

gotcha

__________________
www.suseunbound.com I'm a PC and I run on Linux
Page 1
posts 1–9 of 9

Reply to: ‘Adding modules to YaST’

Membership Required

You must be a member to post in this Forum

join now