3

How to remove right click "format" option from a disk icon in the launcher as it can lead to formatting by mistake.

2
  • You'll not be able to format a disk drive until you want to do it intentionally.. Always it'll prompt for your password.. Oct 15, 2013 at 11:58
  • Thanks Kumar but still I want to know if that option can be removed.
    – user202840
    Oct 15, 2013 at 12:52

1 Answer 1

6

As far as I know...the Format option is hardcoded in the Unity source.
You can try to edit source code to remove the format item.


NOTE: I recommend you to do this in a Virtual Machine or in a Test Machine to see is everything is OK. (In this example I'm running Ubuntu 12.04 with Unity 5.20.0).


1) Make sure you have enable the Source code repository

  • Open the Ubuntu Software Center.
  • In the Menu Bar choose Edit -> Software Sources. Click to enable "Source code repository". Just in case I use the "Main Server" to Download.

enter image description here

Open a Terminal window Ctrl+Alt+T and type:

  • sudo apt-get update

2) In the Terminal type the following to install the necessary packages.

  • sudo apt-get install build-essential quilt

3) Install build dependencies.

  • sudo apt-get build-dep unity

4) Create a folder to download the source code.

  • mkdir ~/Downloads/src

  • cd ~/Downloads/src

5) Download the source code & Export variables.

  • apt-get source unity

  • export QUILT_PATCHES=debian/patches

  • export EDITOR=gedit

6) Create the patch and Edit the source code.

  • cd unity-5.20.0/

  • quilt new 99_no_format_option.patch

  • quilt edit plugins/unityshell/src/DeviceLauncherIcon.cpp

Remove the lines... from 171 to 185.

enter image description here

Save the changes.

7) Build the deb packages.

  • quilt refresh
  • fakeroot dpkg-buildpackage

8) Install the deb packages.

  • cd ..

  • sudo dpkg -i *deb

9) Finally you can logout and Login to see the changes.

Before:

enter image description here

After:

enter image description here

Hope this helps.

1
  • You went and dirtied your hands with the source code D:!
    – Braiam
    Nov 2, 2013 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .