7

After install of RabbitVCS I get git, svn and Hg integration in Nautilus. How to remove Hg and Git from context menu?

  • The right-click context menu? – anonymous2 Aug 8 '16 at 19:33
11
+50

I've found a hackingish way of doing that. I'm assuming you've installed rabbitvcs-nautilus. I've tested it in Ubuntu 16.04.

After installing it, if you restart nautilus, you'll find entry for three types of VCS, namely git, mercurial (hg) and SVN. Here is a screenshot of context menu after default installation.

Default menu items with git, hg and svn

Now, to remove git and mercurial menus, Open /usr/lib/python2.7/dist-packages/rabbitvcs/util/contextmenu.py with your favorite text editor. I'm using sublime text in the example

subl /usr/lib/python2.7/dist-packages/rabbitvcs/util/contextmenu.py

Now, go to line 1329. Comment-out lines from 1329 to 1372. Which are basically menu item entries for git and mercurial. After commenting out, the lines become

File: /usr/lib/python2.7/dist-packages/rabbitvcs/util/contextmenu.py
1329:             # (MenuRabbitVCSGit, [
1330:             #     (MenuClone, None),
1331:             #     (MenuInitializeRepository, None),
1332:             #     (MenuSeparator, None),
1333:             #     (MenuDiffMenu, [
1334:             #         (MenuDiff, None),
1335:             #         (MenuDiffPrevRev, None),
1336:             #         (MenuDiffMultiple, None),
1337:             #         (MenuCompareTool, None),
1338:             #         (MenuCompareToolPrevRev, None),
1339:             #         (MenuCompareToolMultiple, None),
1340:             #         (MenuShowChanges, None),
1341:             #     ]),
1342:             #     (MenuShowLog, None),
1343:             #     (MenuStage, None),
1344:             #     (MenuUnstage, None),
1345:             #     (MenuAddToIgnoreList, ignore_items),
1346:             #     (MenuSeparator, None),
1347:             #     (MenuRename, None),
1348:             #     (MenuDelete, None),
1349:             #     (MenuRevert, None),
1350:             #     (MenuClean, None),
1351:             #     (MenuReset, None),
1352:             #     (MenuCheckout, None),
1353:             #     (MenuSeparator, None),
1354:             #     (MenuBranches, None),
1355:             #     (MenuTags, None),
1356:             #     (MenuRemotes, None),
1357:             #     (MenuSeparator, None),
1358:             #     (MenuGitExport, None),
1359:             #     (MenuMerge, None),
1360:             #     (MenuSeparator, None),
1361:             #     (MenuAnnotate, None),
1362:             #     (MenuSeparator, None),
1363:             #     (MenuCreatePatch, None),
1364:             #     (MenuApplyPatch, None),
1365:             #     (MenuSeparator, None),
1366:             #     (MenuSettings, None),
1367:             #     (MenuAbout, None)
1368:             # ]),
1369:             # (MenuRabbitVCSMercurial, [
1370:             #     (MenuSettings, None),
1371:             #     (MenuAbout, None)
1372:             # ])
1373:         ]
1374: 

I've printed line numbers here.

Here is two screenshot which shows the context menu before and after of disabling this.

Screenshot: After disabling

After disabling Git and HG

  • 1
    Yay! Thanks - this works. I should have spent more time looking for those lines. Now that you've point it out to me I can see them. – starbeamrainbowlabs Aug 12 '16 at 16:38
  • glad to see it working there too! :) – Anwar Aug 12 '16 at 18:16
0

have a look for the launcher for RabbitVCS and edit out the quicklist entries.

The launcher will be in ~/.local/share/applications/ or /usr/share/applications , it will be a desktop file.

The extra options should be defined in [Desktop Action ] blocks , these can be deleted and then removed from the Actions line.

Changes should show up instantly.

  • It doesn't look like there's an entry for RabbitVCS in either of those locations. Perhaps it's because it doesn't have a launcher icon and it only adds to the right click menu in nautilus? – starbeamrainbowlabs Aug 9 '16 at 19:03
  • You might need to grep the desktop files to find it , some of the filenames are non obvious – Amias Aug 10 '16 at 8:22
  • Have done - I seriously can't find it. I ran grep -in -A 5 -B 5 rabbit ** in /usr/share/applications and ti turned up nothing :/ – starbeamrainbowlabs Aug 10 '16 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.