Autostart client on Linux

If we drop bitmask.desktop file into the directory ~/.config/autostart/ then Bitmask will autostart when the user logs in.

I propose this for the rules for autostart:

(1) whenever the app is started, we create the file ~/.config/autostart/bitmask.desktop if it does not already exist.

(2) whenever the application is quit via a UI command (like going to the menu and saying quit), then we remove the autostart file before quitting.

(3) whenever the application is quit by other means (got a signal to quit) we leave the autostart file in place. the assumption being that this halt was caused by a restart or logout.

This will make autostart work like the VPN state: instead of a configuration option we simply restore what the prior state was when the user logs in.

I think that we should probably autostart the app minimized. This can be achieved by specifying a different Exec= than the normal .desktop file.

For example:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=Bitmask
Comment=Secure Communication
Exec=bitmask --start-hidden
Terminal=false
Icon=bitmask

This, of course, depends on the application supporting --start-hidden.

I have deleted the other autostart related issues pertaining to Linux.

(from redmine: created on 2014-01-16, closed on 2014-07-25, duplicates #5867, blocks #4990 (closed))