kde Configure panels in gnome way, Configure kde desktop for each user
April 17, 2011 Leave a comment
HERE YOU CAN DOWNLOAD AND INSTALL ALL MY PANELS COPY AND PASTING A BASH CODE
AND HERE THERE IS A PREVIEW
Down here there is the old documentation a semi-tutorial to create your own panel
I WANT CREATE MY OWN PANEL , BUT I DON’T KNOW HOW TO DO
well i did a kate plugin for that … you can watch this video
MANUAL HOW TO : GET WIDGET PARAMETERS
You have to set some widgets ? and you wonder where they are , and mainly which parameter you have to use?
well the easier way it’s this :
Remove all panels then , add widgets and se them all as you want, after that open this file
kate ~/.kde/share/config/plasma-desktop-appletsrc
if you want print the settings in a fast way usefull for javascript
awk -F= '{print "applet.writeConfig(\"" $1 "\",\"" $2 "\");"}' testfile_that_has_settings_for_that_wiget_
on this file are stored all the informations about your widgets for example , if you press CTRL F and search for simple laucher you will find in my case :
....... [Containments][445][Applets][446] geometry=0,0,25,25 immutability=1 plugin=simplelauncher zvalue=0 [Containments][445][Applets][446][Configuration] format=Description icon=start-here showMenuTitles=true views=Applications,Favorites,Computer,Settings,RunCommand,Leave ..........
so to get what i want i should write :
this create a panel on top of your screen and it adds the simple laucher with some settings.. if you don’t understand well read down you will just keep in mind this :
var panel = new Panel
if (panelIds.length == 1) {
panel.location = 'top'
}
panel.height = 27
launcher = panel.addWidget("simplelauncher");
launcher.writeConfig("format", "Description");
launcher.writeConfig("showMenuTitles", "true");
launcher.writeConfig("views", "Applications,Favorites,Computer,Settings,RunCommand,Leave");
launcher.writeConfig("icon", "start-here");
some usefull stuff : Get all the name of widgets you should use in your javascript
widgets names can be got here /usr/share/kde4/services/ . i use this awk filter to get the correct names that you could use on the panels :
ls /usr/share/kde4/services/ | awk '/plasma-applet/{gsub(/plasma-applet-/,"") ;gsub (/.desktop/ ,"") ;print}'
HOW TO
First of all you have to remove kubuntu-default-settings , maybe before you could consider to locate where is this package,and where it is installed, on that folder you can find all the customization kubuntu team does for kde, they have customized 2 very important files like
the javascript that handles how and where panels must be displayed on the screen is this
kdesudo kate /usr/share/kde4/apps/plasma/layout-templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js
this script instead manages which kind of plasma activity you want start , desktop folder view and which widget you would like get on the desktop. this one is for the desktop
kdesudo kate /usr/share/kde4/apps/plasma-desktop/init/00-defaultLayout.js
if you have netbook version of plasma the files are :
kdesudo kate /usr/share/kde4/apps/plasma/layout-templates/org.kde.plasma-netbook.defaultPanel/contents/layout.js
kdesudo kate /usr/share/kde4/apps/plasma-netbook/init/00-defaultLayout.js
SET PANELS, POSITION HEIGHT AND WIDGET INTO THE PANEL
I will not explain because the readers of this blog , i guess , are smart so with this file you will be able to create the most of thing you would do just see this scheme
add panel 1
set panel 1
add widget panel 1
set widget panel 1
….
//comment
….
add panel 2
set panel 2
add widget panel 2
set widget panel 2
// comment
…
…
…
add panel N
set panel N
add widget panel N
set widget panel N
…
NOW THIS IS THE GNOME LAYOUT
/////////function remove in case of error of first remove :S
function remove()
{
for (i in panelIds) {
panelById(panelIds[i]).remove()
}
}
//////////////////////////////////////////////////////////
/////function remove standard///////////////////////////////
function RemoveOldPanels()
{
for (i in panelIds) {
// panelById(panelIds[i]).remove()
p = panelById(panelIds[i]);
if (typeof p === "undefined") {
print("E: Couldn't find first panel");
remove() //load the remove function in case of problems
}
else {
panelById(panelIds[i]).remove()
}
}
}
RemoveOldPanels() //load the function
//////////////////////////////////////////////////////////
//start another function to create panels layout
function gnome2(){
var panel = new Panel
if (panelIds.length == 1) {
// panel.location = 'bottom'
panel.location = 'top'
}
panel.height = 27
//panel.addWidget("launcher")
launcher = panel.addWidget("simplelauncher");
launcher.writeConfig("format", "Description");
launcher.writeConfig("showMenuTitles", "true");
launcher.writeConfig("views", "Applications,Favorites,Computer,Settings,RunCommand,Leave");
// launcher.writeConfig("icon", "start-here");
panel.addWidget("panelspacer_internal")
launcherinternet = panel.addWidget("simplelauncher");
launcherinternet.writeConfig("icon", "applications-internet");
launcherinternet.writeConfig("relativePath", "Internet/");
launcherinternet.writeConfig("format", "Description");
launchersystem = panel.addWidget("simplelauncher");
launchersystem.writeConfig("icon", "applications-system");
launchersystem.writeConfig("relativePath", "System/");
launchersystem.writeConfig("format", "Description");
var systemsettings = panel.addWidget("quicklaunch");
systemsettings.writeConfig("iconUrls","file:////usr/share/applications/kde4/systemsettings.desktop")
var help = panel.addWidget("quicklaunch")
//qlaunch.writeConfig("iconSize", "24")
help.writeConfig("iconUrls","file:///usr/share/applications/kde4/Help.desktop")
panel.addWidget("panelspacer_internal")
var firefox = panel.addWidget("quicklaunch")
firefox.writeConfig("iconUrls","file:///usr/share/applications/firefox.desktop")
panel.addWidget("pastebin")
var quick = panel.addWidget("quickaccess");
var dolphin = panel.addWidget("quicklaunch");
dolphin.writeConfig("iconUrls","file:////usr/share/applications/kde4/dolphin.desktop")
var konsol = panel.addWidget("quicklaunch")
konsol.writeConfig("iconUrls","file:///usr/share/applications/kde4/konsole.desktop")
//var stanndard = panel.addWidget("quicklaunch");
//
//
//panel.addWidget("smooth-tasks")
panel.addWidget("panelspacer_internal")
panel.addWidget("sm_cpu")
panel.addWidget("sm_ram")
panel.addWidget("sm_temperature")
panel.addWidget("systemtray")
clock = panel.addWidget("digital-clock");
clock.writeConfig("showDate", "true");
clock.writeConfig("showDay", "true");
clock.writeConfig("showSeconds", "true");
clock.writeConfig("showYear", "true");
clock.writeConfig("showShadow", "false");
clock.writeConfig("showYear", "true");
//clock.writeConfig("showTimezone", "true");
clock.writeConfig("plainClockFont", "Serif,12,-1,5,75,0,0,0,0,0");
clock.writeConfig("useCustomColor", "true");
clock.writeConfig("plainClockColor", "255,255,255");
clock.writeConfig("plainClockDrawShadow", "false");
lockout = panel.addWidget("lockout")
//lockout.writeConfig("showHibernateButton","true")
lockout.writeConfig("showLogoutButton","true")
lockout.writeConfig("showLockButton","false")
lockout.writeConfig("showSleepButton","false")
lockout.writeConfig("showSwitchUserButton","true")
//panel.addWidget("tasks")
//smooth-tasks
//panel.addWidget("trash")
var panel = new Panel
if (panelIds.length == 2) {
// we are the only panel, so set the location for the user panel.location = 'bottom'
panel.location = 'bottom'
}
panel.height = 27
//panel.addWidget("launcher")
//panel.addWidget("pastebin")
panel.addWidget("showdesktop")
panel.addWidget("tasks")
pager = panel.addWidget("pager");
pager.writeGlobalConfig("rows", "1");
panel.addWidget("trash")
//panel.addWidget("smooth-tasks")
}
gnome2()
SET PLASMA INIT
As said before this is the file (desktop case )
kdesudo kate /usr/share/kde4/apps/plasma-desktop/init/00-defaultLayout.js
here you can download some usefull stuff to use on this script,
var topLeftScreen = 0
var rect = screenGeometry(0)
// find our "top left" screen to put the folderview on it
for (var i = 1; i < screenCount; ++i) {
var g = screenGeometry(i)
if (g.x = rect.top) {
rect = g
topLeftScreen = i
}
}
for (var i = 0; i < screenCount; ++i) {
var desktop = new Activity
desktop.screen = i
desktop.wallpaperPlugin = 'image'
desktop.wallpaperMode = 'SingleImage'
print("for screen " + i)
if (i == topLeftScreen) {
var folderview = desktop.addWidget("folderview")
folderview.writeConfig("url", "desktop:/")
}
}
loadTemplate("org.kde.plasma-desktop.defaultPanel")

