ransome1 / sleek

todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)
https://github.com/ransome1/sleek/wiki
MIT License
1.33k stars 104 forks source link

Hotkey to open/hide sleek window #505

Closed Kamul-PL closed 8 months ago

Kamul-PL commented 1 year ago

Does sleek have any hotkey to open/hide its window? I didn't find such a functionality.

It would be much more comfortable to use it (I'm the type of guy who doesn't like the mouse much) 😉 when some key combination (preferably configurable) will invoke the sleek window. Second use of the same combination should hide the window.

Thank you!

ransome1 commented 12 months ago

@Kamul-PL on which OS are you?

Kamul-PL commented 12 months ago

Currently mainly Linux Mint at home and Windows 10 at work.

ransome1 commented 12 months ago

On MacOS we have the Cmd + H shortcut, which is used to hide a window. That's an Apple convention.

I checked out some Windows apps but could not find a shared pattern on how these apps handle this. @Kamul-PL do you know how Windows apps typically handle this? Is there a shortcut convention? Same question for Linux.

ransome1 commented 12 months ago

So I checked some of my Windows applications. None has any function or shortcut to hide itself. I also did some research and there doesn't seem to be a default "Windows way" of hiding the active application. There are many workarounds but not a clean way like in MacOS (CMD + H).

In Electron (sleek is based on it) there is a way to hide the application window, but in Windows this basically leads to the application being hidden and not visible in the task bar. Like that I was not able to get it visible again.

At this point I don't see a way of implementing this for Windows, I'm afraid. And I don't want some custom shortcut in sleek, that then clashes with shortcuts on other operating systems.

akoylu commented 11 months ago

May this be a solution? https://www.electronjs.org/docs/latest/api/tray

ransome1 commented 11 months ago

@akoylu could you elaborate how the tray API can help here?

github-actions[bot] commented 8 months ago

This is an automated response. We acknowledge your report, and we appreciate your engagement. However, as there has been no recent activity in this thread, it has been marked as stale. If you have any further feedback or if the matter is still relevant, please do not hesitate to respond. Otherwise, this thread will be automatically closed in 15 days from now.

ransome1 commented 8 months ago

This issue has been discussed in another thread, which concluded in removing it from sleek on Windows and on Linux, but keeping it available on macOS. Reason being is that this feature is only really expected by mac-users.

On Windows users apparently use the Ctrl + D shortcut to expose the desktop and hiding single Windows doesn't seem to be a common use case.

On Linux it is even more difficult, since every desktop environment does something different. Thus users can be expected to be more willing to customise this kind of behavior with third party tools.

If you disagree, feel free to continue the discussion here.

dnngll commented 7 months ago

Windows 10 here.

I think, that's a very important feature. I try to avoid the mouse where I can, and having to single-click on the tray-icon to open Sleek is kind of a hassle. Maybe a hotkey like in todotxt.net could be implemented?

Thanks

andrei-a-papou commented 7 months ago

On Linux it is even more difficult, since every desktop environment does something different. Thus users can be expected to be more willing to customise this kind of behavior with third party tools.

I've been a desktop Linux user for over 20 years and I prefer keyboard-driven app switching just like @Kamul-PL does.

In my Linux experience, while some apps do offer a show/hide shortcut (e.g. GoldenDict), they typically allow you to customize and/or remove it to avoid conflicts with window manager/desktop environment shortcuts. Until sleek offers customizable shortcuts, it seems the best option is to use third-party tools such as xbindkeys, jumpapp, etc. There are plenty of those around.

Problem: At this time I couldn't make sleek work with jumpapp because there doesn't seem to be an easy enough way to programmatically raise and focus sleek when it's minimized to tray and no window is shown in the taskbar.

@ransome1 Would it be possible to implement single-instance mode for sleek? That way, when you try to launch sleek and it's sitting in the tray, sleek would simply raise and focus the existing instance (same as clicking "Show sleek" from the tray menu)? Currently you can launch multiple sleek instances, which I don't think makes sense -- we have file tabs for handling multiple files within a single instance anyway, correct?

Enforcing single-mode would essentially solve the issue of show/hide functionality under Linux. One could then assign a preferred shortcut to something like jumpapp -m -R -C -t '^sleek$' sleek in your WM/DE and voila.