Repository: pwr-Solaar/Solaar

Issue:
Running solaar does not open solaar
```
➜ solaar --version
solaar 1.0.1
```
**What happens**
When running `solaar`, it does not open the application itself. It _does_ add a try icon with a battery indicator or whatever.
Running `solaar` a second time _does_ open the application windo.

**Expected result**
Running an application should open the application (that's pretty much as obvious as it gets). I shouldn't need to run it twice.
If anyone wants just the try icon, something like `solaar --tray-icon` would probably work.

**Other notes**
I no longer have a tray bar set up on my desktop. So right now, running solaar once is a no-op. Running it twice actually opens the application.


Discussion:
This has been the behaviour of Solaar for a long time.
The version of Solaar in this repository has a new option to control startup - `solaar --window=only` opens the main window at startup and doesn't use a tray icon at all.
> This has been the behaviour of Solaar for a long time.

Yes, that's correct.

>  The version of Solaar in this repository has a new option to control startup - solaar --window=only opens the main window at startup and doesn't use a tray icon at all.

I don't think this is a very sane default. Out of the box right now, running `solaar` does not open the application. This is very unintuitive (for any other application, running it opens it in foreground).

I've nothing against supporting a "run only in the background" scenario, but I don't think it should be the default for a desktop application.
@FFY00 Should the default behaviour of Solaar be changed so that without any arguments it starts with the main window open?  This would require fiddling with the installation process so that the autostart behaviour of Solaar doesn't change.

I think so. Just bring back `solaar-autostart.desktop`.
OK.  I'll get this set up.  I'll probably also add something to the documentation.

Resolving patch:
diff --git a/lib/solaar/gtk.py b/lib/solaar/gtk.py
--- a/lib/solaar/gtk.py
+++ b/lib/solaar/gtk.py
@@ -48,7 +48,7 @@ def _parse_arguments():
 							help='unifying receiver to use; the first detected receiver if unspecified. Example: /dev/hidraw2')
 	arg_parser.add_argument('--restart-on-wake-up', action='store_true',
 							help='restart Solaar on sleep wake-up (experimental)')
-	arg_parser.add_argument('-w', '--window', choices=('hide','show','only'), help='start with window hidden / showing / only (no tray icon)')
+	arg_parser.add_argument('-w', '--window', choices=('show','hide','only'), help='start with window showing / hidden / only (no tray icon)')
 	arg_parser.add_argument('-V', '--version', action='version', version='%(prog)s ' + __version__)
 	arg_parser.add_argument('--help-actions', action='store_true',
 							help='print help for the optional actions')
@@ -62,7 +62,7 @@ def _parse_arguments():
 		return
 
 	if args.window is None:
-		args.window = 'hide'
+		args.window = 'show' # default behaviour is to show main window
 
 	import logging
 	if args.debug > 0:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,7 @@ def _data_files():
 		yield _dirname(mo), [mo]
 
 	yield 'share/applications', ['share/applications/solaar.desktop']
-	yield autostart_path, ['share/applications/solaar.desktop']
+	yield autostart_path, ['share/autostart/solaar.desktop']
 
 	del _dirname
 


Test patch: