Sidebar Toggler
Finer control of the Obsidian sidebars. To be used with an external window manager.
What the plugin does
It adds four commands for toggling the sidebar. As opposed to Obsidian's native commands, which only allow toggling of the sidebars, you can explicitly determine whether to show or hide them.
- Hide left sidebar
- Hide right sidebar
- Show left sidebar
- Show right sidebar
In addition, the plugin registers four URI schemes for those commands:
obsidian://sidebar?side=left&show=false
obsidian://sidebar?side=right&show=false
obsidian://sidebar?side=left&show=true
obsidian://sidebar?side=right&show=true
Purpose of this plugin
The main use for this plugin is to provide a simple and clear method for window management apps to control Obsidian's sidebars. Just add something like open "obsidian://sidebar?side=left&show=false"
to your window management configuration to have your window manager control Obsidian's sidebars.
I, for example, have configured to hide Obsidian's sidebars when I trigger a vertical split of my windows. When I maximize my Obsidian window, the sidebars are shown again.
For the macOS Automation app Hammerspoon, for example, such a function could look like this:
function toggleObsidianSidebar (obsiWin)
local obsi_width = obsiWin:frame().w
local screen_width = obsiWin:screen():frame().w
if (obsi_width / screen_width > 0.6) then
hs.urlevent.openURL("obsidian://sidebar?side=left&show=true")
else
hs.urlevent.openURL("obsidian://sidebar?side=left&show=false")
end
end
Similar plugins
Hide Sidebars when Narrow shows/hides the sidebars automatically based on configurable pixel widths.
Installation
Right now, the plugin is still in beta. It can be installed with the BRAT Plugin.
When published, it will be available in Obsidian's Community Plugin Browser via: Settings
→ Community Plugins
→ Browse
→ Search for "Sidebar Toggler"
Contribute
Please use the .eslintrc
configuration located in the repository and run eslint before doing a pull request, and please do not use prettier
.
# Run eslint fixing most common mistakes
eslint --fix *.ts
About the Developer
In my day job, I am a sociologist studying the social mechanisms underlying the digital economy. For my PhD project, I investigate the governance of the app economy and how software ecosystems manage the tension between innovation and compatibility. If you are interested in this subject, feel free to get in touch!
Profiles
Donate
If you feel very generous, you may also buy me something from my Amazon wish list. But please donate something to developers who still go to college, before you consider buying me an item from my wish list!