maximise-active-pane-obsidian icon indicating copy to clipboard operation
maximise-active-pane-obsidian copied to clipboard

Include option to hide sidebars

Open NeighNeighNeigh opened this issue 4 years ago • 6 comments

Would it be possible to include a setting where when entering fullscreen, the pane takes up the entire window, occluding any sidebars that may be open at the time?

NeighNeighNeigh avatar Jan 22 '21 00:01 NeighNeighNeigh

I came to ask the same thing, +1 for this request!

I also took a look at Razumihin/obsidian-fullscreen-plugin - that definitely "works" in that regard, but I don't like that it enters "fullscreen" mode on macOS which basically blocks access to any and all other apps while in that mode.

luckman212 avatar Feb 22 '21 14:02 luckman212

+1 from me too. The weird thing is that currently the file tree gets minimized when invoking ctrl-shift-x but not the right side panels. Would be great if they would get out of the way too. Thanks!

Addition: in the meantime people might consider setting a shortcut for Toggle Left Side Pane and Toggle Right Side Pane in Obsidian settings. I chose alt-ctrl-short-R and alt-ctrl-short-L for this.

j-peeters avatar Apr 28 '21 13:04 j-peeters

+1 from me too. I came here just to request this feature as @luckman212 . We really need this option to hide the sidebars (right and left) when Maximise is active.

I really hope we can get this feature!

FelipeRearden avatar Jun 16 '21 10:06 FelipeRearden

The weird thing is that currently the file tree gets minimized when invoking ctrl-shift-x but not the right side panels.

For me, none of the panels (including the file tree) get minimized.

Addition: in the meantime people might consider setting a shortcut for Toggle Left Side Pane and Toggle Right Side Pane in Obsidian settings. I chose alt-ctrl-short-R and alt-ctrl-short-L for this.

Thank you for writing this. I did not realize that it was possible, as I was searching "maximize" or "hide". :)

And yes, naturally this request gets a +1 from me as well, @deathau . That's the reason I came here in this repo and issues section.

mikkovedru avatar Jul 24 '21 23:07 mikkovedru

Until this request is implemented, I figured out a really nice way to circumvent the limitations and get the functionality!

I am using AutoKey, a desktop automation utility for Linux and X11. Not to be confused with the AutoHotKey (a Windows version, https://www.autohotkey.com/ ). Frankly, AutoHotKey for Windows is a better software and one can easily find how to replicate what I did and described below.

So what I did was:

  1. In Obsidian settings I set 2 shortcuts: a) Toggle Left Side Pane = Ctrl+Shift+L (a combination that is never used anywhere). b) Toggle Right Side Pane = Ctrl+Shift+R c) Maximize Active Pane: Toggle = removed Ctrl+Shift+X and added Ctrl+Shift+Y.
  2. In AutoKey I created a file "Obsidian hide all panels.py". In that file's settings I also: a) set hotkey to ctrl+shift+z b) set "Window Filter" to obsidian.obsidian (so it works only in Obsidian window and you can continue using the ctrl+shift+z key combination in other programs) c) to the script file itself I wrote this:
import time

#time.sleep(0.2)
keyboard.send_keys("<ctrl>+<shift>+l")
#time.sleep(0.2)
keyboard.send_keys("<ctrl>+<shift>+r")

Remember to press Ctrl+S to save the file. image

  1. In AutoKey I also created a second file "Obsidian hide all panels and windows except one.py". In that file's settings I also: a) set hotkey to ctrl+shift+x b) set "Window Filter" to obsidian.obsidian c) to the script file itself I wrote this:
import time

#time.sleep(0.2)
keyboard.send_keys("<ctrl>+<shift>+l")
#time.sleep(0.2)
keyboard.send_keys("<ctrl>+<shift>+r")
#time.sleep(0.2)
keyboard.send_keys("<ctrl>+<shift>+y")

Remember to press Ctrl+S to save the file. image

So now it works marvelously!

  • If I press ctrl+shift+z, then both left and right panes disappear. Pressing the combination again brings those panes back.
  • If I press ctrl+shift+x, then both left and right panes disappear as well as the main text file window is maximized. Pressing the combination again brings everything back.

P.S. A caveat about AutoKey scripts. AutoKey has much more problems than Windows' AutoHotKey including the otherwise simple-sounding and essential functionality. One of the typical problems has to do with sending keystrokes. Sometimes they are not being sent, sometimes extra stuff is being sent. Very frustrating! Everything depends on one's particular scrips, hardware, programs, and luck. Therefore quite often one needs to put the script to sleep in between actually useful code lines (otherwise, not all of the commands will be executed on time and in correct order). This time those two scripts happened to work properly on my machine at this moment of time (this might easily change), therefore I commented out the time.sleep(0.2) lines. Your mileage might vary: you might even need to increase the sleep time.

Edit: P.P.S. Another non-obvious cool thing about my changes is that if you use one of the functions only once and after that continue using the other function (so either once ctrl+shift+x and after then only ctrl+shift+zs; or ctrl+shift+z and after then only ctrl+shift+xs), then you are able to switch between "All documents visible, but no side panes" and "Only one document visible with side panes"! This might be very useful in some cases!

mikkovedru avatar Jul 25 '21 00:07 mikkovedru

One downside here is that if you already the left sidebar closed, toggling will open it. I really miss Obsidian having a way to hide it (not toggle)

kurko avatar Jan 27 '23 16:01 kurko