Starting Kleopatra minimized to system tray?

Is there a command line argument for starting kleopatra to the system tray? Or an option to have it auto-start with windows to the system tray?

Basically I use Gpg4win to sign my GitHub commits via GitHub desktop, but it doesn’t work unless I run Kleopatra first. I’ve tried plenty of other ways to try and get GPG running in the background without having to do it through Kleopatra but nothing seems to work, so this seems like the easiest option.

I tried doing “kleopatra --help” from this page but it said unknown option, so not sure if that’s outdated or what.

1 Like

Hello ThioJoe,

welcome to the forum!

Have you tried the following on the cli to start the gpg-agent?

gpg-connect-agent reloadagent /bye

1 Like

Forgot to reply but yep that command worked thanks!

Note that starting kleopatra in the right directory (or with the full path) works, e.g.

c:\Program Files (x86)\Gpg4win\bin>kleopatra.exe --help

and the mentioned command line flag there, also works, e.g.

c:\Program Files (x86)\Gpg4win\bin>kleopatra.exe --daemon

:slightly_smiling_face:

1 Like

In PowerShell that would be: & "C:\Program Files (x86)\Gpg4win\bin\kleopatra.exe" --daemon

And in cmd: "C:\Program Files (x86)\Gpg4win\bin\kleopatra.exe" --daemon

Creating a task

What worked well for me is creating a task with Task Scheduler in Windows:
Action > Create Task > name it however you want > under Triggers: At log on > under Actions: start a program cmd.exe under arguments: /c START "" /B "C:\Program Files (x86)\Gpg4win\bin\kleopatra.exe" --daemon > under Conditions you uncheck everything > under Settings you uncheck everything except: Allow task to be run on demand

That’s it you’re done.

Import task

You can also import the following xml for the task and review it, you get to see a task window filled in so you can also change it. See: A task created with Windows Task Scheduler to run Kleopatra at startup in the background · GitHub

Explanation

Explanation of the command: /c START "" /B "C:\Program Files (x86)\Gpg4win\bin\kleopatra.exe" --daemon

/c starts a hidden background console and START is a built in command of console which you can start programs without a window in the background. The empty “” directly after start is the title which can be empty. And B starts an application without creating a new window.