How to customize the System widget on mintMenu slab

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

How to customize the System widget on mintMenu slab

Postby dasunsrule32 on Wed Sep 17, 2008 3:01 am

In order to change different applications under the System widget, you will need to edit the following files (I wanted to replace the mintInstall application with the Add/Remove application typically seen in Ubuntu installs.). From my examples, you should be able to add whatever you want with a little thought and planning:

Open a terminal and type (If you're new, click Elyssa -> Terminal):

-- Make sure that you have gnome-app-install on your system, type in the terminal:

Code: Select all
sudo apt-get install gnome-app-install

Once that is done, continue on my friends!

Type in your terminal:

Code: Select all
gconf-editor

-- Scroll down to Apps -> mintMenu -> plugins -> system-management
-- Edit the 'install_software_cmd', change it to:

Code: Select all
/usr/bin/gnome-app-install

-- Close the editor

Now, run this next command in the terminal:

Code: Select all
sudo vi /usr/lib/linuxmint/mintMenu/plugins/system_management.py

or you can you use your favorite editor, for instance: gedit, I will be assuming you are using vi for this tutorial:

Code: Select all
sudo gedit /usr/lib/linuxmint/mintMenu/plugins/system_management.py

#PS - You can also do the aforementioned gconf edit here too by editing the following line:

Code: Select all
self.installSoftwareCmd = self.gconf.get( "string", "install_software_cmd", "/usr/lib/linuxmint/mintInstall/mintInstall.py").split()

and changing it to:

Code: Select all
self.installSoftwareCmd = self.gconf.get( "string", "install_software_cmd", "/usr/bin/gnome-app-install").split()

Doesn't matter, whatever you're more comfortable with.

-- Scroll down to:

Code: Select all
wTree.get_widget("label1").set_text(_("Software Portal"))

and change it to:

Code: Select all
wTree.get_widget("label1").set_text(_("Add/Remove..."))

-- If using vi, you will need to press the insert key to edit any lines in the configuration file.
-- Press escape to exit insert mode.
-- Now press and hold shift, and press z twice in immediate succesion to save your file.

To change the icon on the menu, do the following:

-- If you want the default gnome icon for the Add/Remove application, then run in the terminal:

Code: Select all
sudo cp /usr/share/icons/hicolor/scalable/apps/gnome-app-install.svg /usr/lib/linuxmint/mintMenu/plugins/gnome-app-install.svg

-- Now we need to edit the image down to size, run in the terminal:

Code: Select all
sudo gimp /usr/lib/linuxmint/mintMenu/plugins/gnome-app-install.svg

and render the vector image down to 22x22, is what I set mine to, click ok.
-- Go to file -> save as... -> in the name box type: gnome-app-install.png -> then click All Images and scroll down to PNG image (*.png) -> then click save.

Now we want to place our menu icon on the menu, do so by using your terminal and typing:

Code: Select all
sudo vi /usr/lib/linuxmint/mintMenu/plugins/system_management.glade

* Remember to press the insert key to edit in vi!

-- Go to the line:
Code: Select all
<property name="pixbuf">mintmenu_icon.png</property>
and change it to an icon that you like, couple things to note, make sure that it is in a 22x22 or 20x20 size, otherwise you will get some strange results.
-- Since we just made our icon from the vector image for the gnome-app-install, we will edit the line to look like this:
Code: Select all
<property name="pixbuf">gnome-app-install.png</property>

-- Now press shift + zz and that will save our config file.


Final steps now!

In the terminal, type:

Code: Select all
killall gnome-panel

-- This will kill your panel along the bottom, assuming you have a default install. DON'T PANIC!!! Your panel will restart momentarily.
-- When it's back up, you should see the changes wrought on the Elyssa menu -> Add/Remove...

That's it, we are now edited and can now use the gnome application installer.

EDIT: How to edit other portions of the System widget on the slab menu

Work with the same files as above:

Code: Select all
sudo vi /usr/lib/linuxmint/mintMenu/plugins/system_management.glade

(or substitute your favorite editor for vi, gedit for example)

Code: Select all
sudo vi /usr/lib/linuxmint/mintMenu/plugins/system_management.py

(or substitute your favorite editor for vi, gedit for example)

-- When looking at the files, you will see a matching information here, notice:

system_management.glade has:

Code: Select all
<widget class="GtkButton" id="install_software">

and system_management.py calls the widget in this line:

Code: Select all
self.installSoftwareBtn = wTree.get_widget( "install_software" )

now you see how and where it is calling the widgets at.

-- Simple concept to get, the system_management.glade file is the actual menu layout and coding for the menu itself and the system_management.py file is the actual code to what the system_management.glade is calling to execute.

-- So, to change any application to run in the system widget, you can edit this portion of the system_management.py:

Code: Select all
self.installSoftwareCmd = self.gconf.get( "string", "install_software_cmd", "/usr/lib/linuxmint/mintInstall/mintInstall.py").split()
                self.packagemanagerCmd = self.gconf.get( "string", "package_manager_cmd", "gksu /usr/sbin/synaptic").split()
                self.controlCenterCmd = self.gconf.get( "string", "control_center_cmd","gnome-control-center" ).split()
                self.terminalCmd = self.gconf.get( "string", "terminal_cmd","gnome-terminal" ).split()
                self.quitSessionCmd = self.gconf.get( "string", "quit_cmd", "gnome-session-save --kill" ).split()
                self.hideseparator = self.gconf.get( "bool", "hide_separator", False )

Now you can see how it is calling the files, just look at your slab menu and coordinate it with what you have here and the directions that have been given above and you will be able to change whatever you want there easily! Again, you can edit what is being executed in the above code, or use the directions at the top of the page for gconf. Cheers! :D

Use your imagination to place whatever applications you need under the system widget. Hope this was helpful. Please give me your feedback to help build upon or add to this. Thanks!

* Coming soon, how to customize the places widget on the mintMenu slab and how to customize the Applications menu on the mintMenu slab, will just extend this post and change the heading to customizing the entire slab menu.
Last edited by dasunsrule32 on Wed Sep 17, 2008 6:46 pm, edited 6 times in total.
John 3:16, "For God so loved the world, that He gave His ONLY begotten Son, that whosoever should believe on Him, shall not perish, but have everlasting life."
dasunsrule32
Level 1
Level 1
 
Posts: 14
Joined: Sun Aug 10, 2008 6:27 pm

Linux Mint is funded by ads and donations.
 

Re: How to customize the System widget on mintMenu slab

Postby Acid_1 on Wed Sep 17, 2008 3:25 am

Very nice tutorial. Well written. I would just like to say one thing though, if you were to write a future How To, and your tutorial only works with a specific editor (unlikely), it would be wise to use an easier one. I don't even know how to use vi. But that's a suggestion only. Good job man 8)
Website: Forkwhilefork
User avatar
Acid_1
Level 5
Level 5
 
Posts: 817
Joined: Thu Nov 01, 2007 11:12 pm
Location: Saskatchewan, Canada

Re: How to customize the System widget on mintMenu slab

Postby msuggs on Wed Sep 17, 2008 3:27 am

dasunsrule32 wrote: Please give me your feedback


Clever hack and nicely set out tutorial :) but if I wanted this I think I'd just install Ubuntu
msuggs
Level 5
Level 5
 
Posts: 882
Joined: Thu Jul 10, 2008 8:25 am
Location: non-local

Re: How to customize the System widget on mintMenu slab

Postby dasunsrule32 on Wed Sep 17, 2008 3:30 am

omns wrote:
dasunsrule32 wrote: Please give me your feedback


Clever hack and nicely set out tutorial :) but if I wanted this I think I'd just install Ubuntu


It will work with whatever application you want to place there. Change it and customize it. I just wanted that particular app, but anything you want! :D
John 3:16, "For God so loved the world, that He gave His ONLY begotten Son, that whosoever should believe on Him, shall not perish, but have everlasting life."
dasunsrule32
Level 1
Level 1
 
Posts: 14
Joined: Sun Aug 10, 2008 6:27 pm

Re: How to customize the System widget on mintMenu slab

Postby dasunsrule32 on Wed Sep 17, 2008 3:31 am

Acid_1 wrote:Very nice tutorial. Well written. I would just like to say one thing though, if you were to write a future How To, and your tutorial only works with a specific editor (unlikely), it would be wise to use an easier one. I don't even know how to use vi. But that's a suggestion only. Good job man 8)


All that has to happen is substitute wherever I use vi and use gedit, that will do it. :)
John 3:16, "For God so loved the world, that He gave His ONLY begotten Son, that whosoever should believe on Him, shall not perish, but have everlasting life."
dasunsrule32
Level 1
Level 1
 
Posts: 14
Joined: Sun Aug 10, 2008 6:27 pm

Re: How to customize the System widget on mintMenu slab

Postby msuggs on Wed Sep 17, 2008 5:01 pm

dasunsrule32 wrote:It will work with whatever application you want to place there. Change it and customize it. I just wanted that particular app, but anything you want! :D

Ah of course, very nice :)
msuggs
Level 5
Level 5
 
Posts: 882
Joined: Thu Jul 10, 2008 8:25 am
Location: non-local

Re: How to customize the System widget on mintMenu slab

Postby msuggs on Wed Sep 17, 2008 5:07 pm

Maybe you should add to the tutorial that you need to install gnome-app-install first because it isn't installed by default.
msuggs
Level 5
Level 5
 
Posts: 882
Joined: Thu Jul 10, 2008 8:25 am
Location: non-local

Re: How to customize the System widget on mintMenu slab

Postby dasunsrule32 on Wed Sep 17, 2008 6:40 pm

omns wrote:Maybe you should add to the tutorial that you need to install gnome-app-install first because it isn't installed by default.


Good call out, I think it is installed on Elyssa by default on the full disk. But simple enough edit to make it easier. Thanks. 8)
John 3:16, "For God so loved the world, that He gave His ONLY begotten Son, that whosoever should believe on Him, shall not perish, but have everlasting life."
dasunsrule32
Level 1
Level 1
 
Posts: 14
Joined: Sun Aug 10, 2008 6:27 pm

Re: How to customize the System widget on mintMenu slab

Postby msuggs on Wed Sep 17, 2008 6:43 pm

dasunsrule32 wrote: I think it is installed on Elyssa by default on the full disk.

I've just installed Elyssa r1 on the machine I'm sitting on and it's not there as a default.
msuggs
Level 5
Level 5
 
Posts: 882
Joined: Thu Jul 10, 2008 8:25 am
Location: non-local

Re: How to customize the System widget on mintMenu slab

Postby dasunsrule32 on Wed Sep 17, 2008 7:04 pm

omns wrote:
dasunsrule32 wrote: I think it is installed on Elyssa by default on the full disk.

I've just installed Elyssa r1 on the machine I'm sitting on and it's not there as a default.


Interesting, I am running 5-R1 also, and it was installed by default. Either way, I edited it to include install instructions for the gnome app installer. :D
John 3:16, "For God so loved the world, that He gave His ONLY begotten Son, that whosoever should believe on Him, shall not perish, but have everlasting life."
dasunsrule32
Level 1
Level 1
 
Posts: 14
Joined: Sun Aug 10, 2008 6:27 pm

Re: How to customize the System widget on mintMenu slab

Postby mbuhgakeruh on Fri Jan 09, 2009 1:29 pm

in linux mint 6 felicia, you only have to edit this file

Code: Select all
sudo gedit /usr/lib/linuxmint/mintMenu/plugins/system_management.py


then you can direct the icon and the open program of menu.
mbuhgakeruh
Level 1
Level 1
 
Posts: 10
Joined: Mon Dec 22, 2008 2:53 am
Location: indonesia

Re: How to customize the System widget on mintMenu slab

Postby dasunsrule32 on Fri Mar 20, 2009 2:12 am

mbuhgakeruh wrote:in linux mint 6 felicia, you only have to edit this file

Code: Select all
sudo gedit /usr/lib/linuxmint/mintMenu/plugins/system_management.py


then you can direct the icon and the open program of menu.


Ok, I will take a look at it. Thanks.
John 3:16, "For God so loved the world, that He gave His ONLY begotten Son, that whosoever should believe on Him, shall not perish, but have everlasting life."
dasunsrule32
Level 1
Level 1
 
Posts: 14
Joined: Sun Aug 10, 2008 6:27 pm

Re: How to customize the System widget on mintMenu slab

Postby piratesmack on Mon Mar 23, 2009 3:05 am

Nice tutorial :)

But "sudo gedit" and "sudo gimp" should be:
Code: Select all
gksu gedit

Code: Select all
gksu gimp


Running GUI apps with sudo can sometimes cause problems because the program is being run with root privileges, but the user's configuration files are being used.
http://ubuntuforums.org/showthread.php?t=801136
https://answers.launchpad.net/ubuntu/+s ... tion/51521
piratesmack
Level 5
Level 5
 
Posts: 710
Joined: Mon May 26, 2008 3:08 pm

Linux Mint is funded by ads and donations.
 

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 7 guests