Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove OneDrive from navigation pane #2691

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BenignPigeon
Copy link

@BenignPigeon BenignPigeon commented Sep 7, 2024

Pull Request - Tweak to Remove OneDrive from navigation pane

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch
  • UI/UX improvement

Description

Added an option to remove onedrive from the navigation pane [below home and gallery] without removing OneDrive from the computer. The reason why I thought why this should be there is since there's an option to remove Home and Gallery in the tweaks section but not to remove the annoying OneDrive - Personal shortcut. This means that This PC isn't the first result.

Image of what I mean

image

Testing

This was just a simple addition so the testing was to make sure that all the changes to the registry were correct, and that reverting the tweak worked properly.

Impact

N/A since it's just a registry tweak that alters the navigation pane.

Issue related to PR

Additional Information

I wasn't sure where the "link" section should go to, so I linked it to the same page as the Home/Gallery Removal

Since I'm rather new to this and would like to contribute a bit more to FOSS, I'd appreciate any feedback of what I may have done incorrectly so I can improve. Thanks (:

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • My changes generate no errors/warnings/merge conflicts.
  • I have made corresponding changes to the documentation.

Added an option to remove onedrive from the navigation pane
I noticed a mistake
Copy link
Contributor

@MyDrift-user MyDrift-user left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @BenignPigeon, thanks for the commit.

There are some syntax errors with the logic you provided, because the script is saved in json, meaning we have to escape " correctly. Else it will think the string ends there even tho it does not and that creates a chain reaction. To fix that we put \ before the " to escape it.

will post a fixed snippet soon

EDIT:

here the correctly escaped invoke- & undoscript:

    "InvokeScript": [
      "
      REG ADD \"HKEY_CLASSES_ROOT\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" /f /v \"System.IsPinnedToNameSpaceTree\" /t REG_DWORD /d \"0\"
      REG ADD \"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" /f /v \"System.IsPinnedToNameSpaceTree\" /t REG_DWORD /d \"0\"
      REG ADD \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" /f /v \"HiddenByDefault\" /t REG_DWORD /d \"1\"
      REG ADD \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\NonEnum\" /f /v \"{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" /t REG_DWORD /d \"1\"
      "
    ],
    "UndoScript": [
      "
      REG ADD \"HKEY_CLASSES_ROOT\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" /f /v \"System.IsPinnedToNameSpaceTree\" /t REG_DWORD /d \"1\"
      REG ADD \"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" /f /v \"System.IsPinnedToNameSpaceTree\" /t REG_DWORD /d \"1\"
      REG DELETE \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" /v \"HiddenByDefault\" /f
      REG DELETE \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\NonEnum\" /v \"{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" /f
      "
    ],

@BenignPigeon
Copy link
Author

Thank you so much @MyDrift-user for the feedback.

In regards to your query:

I still don't understand what that would help with..
As far as I know that is the primary "feature" of OneDrive Desktop, what would the app be helpfull for if this shortcut is not there anymore.

These registry tweaks only remove the onedrive shortcut at the top [underneath home and gallery] from the navigation pane. This does not remove/unlink onedrive shortcuts e.g. the documents, pictures folders from OneDrive. I'll attach some pictures of what I mean.

Without running remove home and gallery, and my shortcut, this is what it looks like:
image

Notice how this pc isn't at the top. After running the tweak "remove home and gallery" in winutil, the onedrive personal shortcut still remains after:
image

However after running both the winutil "remove home and gallery" as well as my registry edits provided in this pull request, none of those remain and this pc is at the top.
image

These registry edits don't remove any onedrive functionality as you can still access all the folders. e.g. The downloads and desktop shortcuts there still link to the ones stored in onedrive. This really is just to make This PC be the first result without there being any other clutter at the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to remove OneDrive shortcut alongside home and gallery
2 participants