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
Option to start Cryptomator in background (system tray etc) incl. auto start on startup #418
Comments
Just wanted to add that this issue doesn't only include the option to start in hidden mode but also that Cryptomator can be automatically started on startup. |
I would like to see this feature on macOS. |
On Windows, closing the Cryptomator window exits the application and unmounts any vaults without asking for confirmation. At a minimum, I think a dialog box would be nice to prevent this from happening by accident, but of course it would be even better Cryptomator minimized to the tray and continued running in the background. |
Cryptomator should actually minimize to the tray when the window is closed and any vaults are unlocked. Just checked this and currently it really unmounts all vaults and exists when closing. @overheadhunter did we change this behaviour for some reason or is this a bug? |
I see some inconsistent behavior on Win7 here: I'm like 100% sure that the first time I tried it, closing the window quit cryptomator and unmounted the vault. After starting it again, it now minimizes to tray, without unmounting the vault. Can't reproduce. |
I love Cryptomator, but I needed to be able to start it silently in the tray before I can use it for my everyday purposes. #NoTrayIcon
; Runs Cryptomator hidden.
#include <File.au3>
#include <MsgBoxConstants.au3>
Func Basename($Path)
Local $Drive, $Dir, $FName, $Ext
_PathSplit($Path, $Drive, $Dir, $FName, $Ext)
Return $FName & $Ext
EndFunc
; Settings
$CRYPTOMATOR_PATH = "C:\Program Files\Cryptomator\Cryptomator.exe"
$CRYPTOMATOR_WINDOW = "[Title:Cryptomator]"
$MAX_RETRIES = 10
$RETRY_WAIT = 3000 ; milliseconds
If ProcessExists(Basename($CRYPTOMATOR_PATH)) Then
; MsgBox($MB_SYSTEMMODAL, "", "Cryptomator is already running.")
ConsoleWrite("Cryptomator is already running." & @CRLF)
Exit
EndIf
ConsoleWrite("Starting Cryptomator." & @CRLF)
For $I = 0 To ($MAX_RETRIES - 1) Step 1
ConsoleWrite("Attempt " & ($I + 1) & " of " & $MAX_RETRIES & @CRLF)
$Pid = Run($CRYPTOMATOR_PATH, "", @SW_HIDE)
If $Pid <> 0 Then
ConsoleWrite("PID: " & $Pid & @CRLF)
WinWait($CRYPTOMATOR_WINDOW, "", 20)
WinClose($CRYPTOMATOR_WINDOW)
WinWaitClose($CRYPTOMATOR_WINDOW, "", 20)
WinSetState($CRYPTOMATOR_WINDOW, "", @SW_SHOW)
; On window exit, Cryptomator will occasionally exit completely instead of minimizing to tray.
; This is a test for that bug.
If Not WinExists($CRYPTOMATOR_WINDOW) And ProcessExists($Pid) Then
; MsgBox($MB_SYSTEMMODAL, "", "Cryptomator started.")
ConsoleWrite("Cryptomator successfully started." & @CRLF)
ExitLoop
EndIf
EndIf
ConsoleWrite("Attempt failed." & @CRLF)
Sleep($RETRY_WAIT)
Next After installing Autoit, you can compile the script and add it to your "Startup" folder in your start menu. Then Cryptomator will auto-start on boot, in the tray, without interaction. I also got the "exit instead of closing to tray" bug when I was testing this script (Win 10 x64). I don't see any pattern to its occurrence and I can't consistently reproduce the issue. My script just loops 10 times and retries if Cryptomator auto-exited instead of minimizing to tray. |
Thats a nice workaround, will port this to Autohotkey! |
@0x4a please do, and please post it! 💯 |
Here we go:
This is more or less a direct copy of @what2345's work, should do exactly the same, works for me. Please report back! |
@0x4a dude...already?! copy or not, what are the chances of me scouring the tubes looking for such a thing only to stumble across your comment on github left 4 days prior to my arrival, and subsequently see you put something together before the clock strikes midnight same day?! you can't make this stuff up! YOU DA REAL HERO! thanks! |
@h-town you're welcome mate! You just had real good timing ;) So does it work for you? I can not reproduce the "closing does not minimize to tray"-bug at the moment, so the part where execution is retried is completely untested... @what2345 is the MVP here, he came up with the idea & execution. I just ported it... What we now need is a REAL HERO, who can fix the problem in the application itself, instead of MacGuyvering a way around :D |
@0x4a it's loaded up but i haven't had a chance (read: time) to reboot just yet. if it doesn't work i'll report back and try to do some hacking on it myself. oh the things we spend so much time on to avoid the 1 second inconvenience of minimizing a window! ;) |
Didn't try it with a real reboot neither. Did not work after rebooting, made some small changes to the script above, maybe this time? Did reboot one more time and it worked. Can't be bothered to reboot more ;) |
@0x4a i couldn't get the AHK version to work :( by chance have you had any success? |
@h-town where/how is it failing? |
@0x4a it's just not kicking off at all (updated version was used). cryptomator will execute on startup but the window remains on top. what i haven't tried:
|
|
I found an easy solution for Mac OSX for now.
That's it! @ |
I don't know if Cryptomator updated or something (I have version 1.3.2 1046) but my solution stopped working in a few days. |
As you can see this issue is scheduled for 1.5.0, which will be a release solely focused on UI and desktop integration issues. Before we start development, we will have at least one more 1.4.x release, though. |
Looking forward for the next cryptomator version. :) I solved it for me until 1.5.0 comes out by doing the following:
That's it. On the next windows start, the window should disappear after the delay entered by you and all unlocked drives should be mounted. Some additional tipps:
|
I'm on macOS and couldn't stand the extra icon in my dock, so I wrote a hidden startup solution for macOS without the extra Cryptomator icon lingering in the dock. To use:
on run {input, parameters}
if application "Cryptomator" is running then
return null
end if
repeat 20 times
# Runs Cryptomator hidden albeit with dock icon still displayed.
log "Attempting to run Cryptomator."
# run application "/Applications/Cryptomator.app"
do shell script "open -j \"/Applications/Cryptomator.app\""
set window_found to false
tell application "System Events"
# set visible of application process "Cryptomator" to false
# Wait up to thirty seconds for Cryptomator window to appear.
repeat 60 times
if exists window "Cryptomator" of application process "Cryptomator" then
log "Cryptomator window found."
set window_found to true
exit repeat
end if
delay 0.5
end repeat
if window_found then
log "Closing open Cryptomator window."
click (first button of every window of application process "Cryptomator" whose role description is "close button")
exit repeat
end if
end tell
# display dialog "Wait is over."
end repeat
return input
end run |
Caution @achimismaili Powershell solution does NOT work (at least on latest builds) and will forcibly close your vaults and pop up this message: All this call does is the same as clicking "close" on the window - which we already know does NOT currently leave it properly minimized to the tray. |
Just wanted to add that this issue needs a process that unmounts/locks the vaults when shutting down the machine. Because the application runs in background, there's no simple possibility for the user to unmount/lock a vault manually, so the application needs to do that. Or is there already a process present that unmounts/locks all vaults when shutting down the machine without unmounting/locking them manually? |
@overheadhunter Can someone please answer to my post above? Thank you. |
Launching in background is now merged on develop in 230436b. Still missing: Option to register Cryptomator to start after booting. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
For those of you working with Windows or macOS, please check out the 1.5.0 beta 2, which will now give your two options to
Please note, that auto unlock of vaults isn't yet available in the beta, though. |
Do these checkboxes actually work? I'm a new user of Cryptomator. I have "Hide window" checked but the app is still opening to the taskbar when booting up. Also, if I then try to close it wants to exit out vs. minimizing to the tray. |
It should still work. If you encounter any issues, this might be a bug. Please open a bug report with more details on your setup. |
Thanks. I figured it out. If you also uncheck "Show Tray Icon" then it just closes the app instead of minimizing it. |
Once issue #40 is resolved, it would be nice to have an option to start Cryptomator in "hidden" mode.
User story:
Workaround
As pointed out in this comment, it is currently already possible to configure Cryptomator like this manually.
The text was updated successfully, but these errors were encountered: