KAutostart Class Reference
from PyKDE4.kdecore import *
Inherits: QObject
Detailed Description
KAutostart provides a programmatic means to control the state of autostart services on a per-user basis. This is useful for applications that wish to offer a configurable means to allow the application to be autostarted.
By using this class you future-proof your applications against potential future or platform-specific changes to the autostart mechanism(s).
Typical usage might look like:
KAutostart autostart; // without an entryName arg, gets name from KAboutData autostart.setAutostarts(true); // will now start up when the user logs in // set the value in our configuration settings to reflect whether or not // we will actually start up on log in config.setAutoStart(autostart.autoStarts());
Method Documentation
addToAllowedEnvironments | ( | self, | ||
QString | environment | |||
) |
Adds an environment to the list of environments this service may start in.
- See also:
- setAllowedEnvironments(), removeFromAllowedEnvironments()
addToExcludedEnvironments | ( | self, | ||
QString | environment | |||
) |
Adds an environment to the list of environments this service may not be autostarted in
- See also:
- removeFromExcludedEnvironments()
QStringList allowedEnvironments | ( | self ) |
Returns the list of environments (e.g. "KDE") this service is allowed to start in. Use checkAllowedEnvironment() or autostarts() for actual checks.
This does not take other autostart conditions into account. If any environment is added to the allowed environments list, then only those environments will be allowed to autoload the service. It is not allowed to specify both allowed and excluded environments at the same time.
- See also:
- setAllowedEnvironments()
bool autostarts | ( | self, | ||
QString | environment=QString(), | |||
KAutostart.Conditions | check=KAutostart.NoConditions | |||
) |
Returns whether or not the service represented by entryName in the autostart system is set to autostart at login or not
- Parameters:
-
environment if provided the check will be performed as if being loaded in that environment check autostart conditions to check for (see commandToCheck())
- See also:
- setAutostarts()
bool checkAllowedEnvironment | ( | self, | ||
QString | environment | |||
) |
Checks whether autostart is allowed in the given environment, depending on allowedEnvironments() and excludedEnvironments().
- Since:
- 4.3
QString command | ( | self ) |
Returns the associated command for this autostart service
- See also:
- setCommand()
QString commandToCheck | ( | self ) |
Returns the executable to check for when attempting to autostart this service. If the executable is not found in the user's environment, it will not autostart.
- See also:
- setCommandToCheck()
QStringList excludedEnvironments | ( | self ) |
Returns the list of environments this service is explicitly not allowed to start in. Use checkAllowedEnvironment() or autostarts() for actual checks.
This does not take other autostart conditions such as into account. It is not allowed to specify both allowed and excluded environments at the same time.
- See also:
- setExcludedEnvironments()
bool isServiceRegistered | ( | self, | ||
QString | entryName | |||
) |
Checks whether or not a service by the given name entryName is registered with the autostart system. Does not check whether or not it is set to actually autostart or not.
- Parameters:
-
entryName the name of the service to check for
removeFromAllowedEnvironments | ( | self, | ||
QString | environment | |||
) |
Removes an environment to the list of environments this service may start in.
- See also:
- addToAllowedEnvironments()
removeFromExcludedEnvironments | ( | self, | ||
QString | environment | |||
) |
Removes an environment to the list of environments this service may not be autostarted in
- See also:
- addToExcludedEnvironments()
setAllowedEnvironments | ( | self, | ||
QStringList | environments | |||
) |
Sets the environments this service is allowed to start in
- See also:
- allowedEnvironments(), addToAllowedEnvironments()
setAutostarts | ( | self, | ||
bool | autostart | |||
) |
Sets the given exec to start automatically at login
- Parameters:
-
autostart will register with the autostart facility when true and deregister when false
- See also:
- autostarts()
setCommand | ( | self, | ||
QString | command | |||
) |
Set the associated command for this autostart service
- See also:
- command()
setCommandToCheck | ( | self, | ||
QString | exec | |||
) |
Sets the executable to check for the existence of when autostarting this service
- See also:
- commandToCheck()
setExcludedEnvironments | ( | self, | ||
QStringList | environments | |||
) |
Sets the environments this service is not allowed to start in
- See also:
- excludedEnvironments(), addToExcludedEnvironments()
setStartPhase | ( | self, | ||
KAutostart.StartPhase | phase | |||
) |
Sets the service (by name) this service should be started after.
Note that this is KDE specific and may not work in other environments.
- See also:
- StartPhase, startPhase()
setVisibleName | ( | self, | ||
QString | entryName | |||
) |
Sets the user-visible name for this autostart service.
- See also:
- visibleName()
QString startAfter | ( | self ) |
Returns the name of another service that should be autostarted before this one (if that service would be autostarted).
- Internal:
- Since:
- 4.3
KAutostart.StartPhase startPhase | ( | self ) |
Returns the autostart phase this service is started in.
Note that this is KDE specific and may not work in other environments.
- See also:
- StartPhase, setStartPhase()
QString visibleName | ( | self ) |
Returns the user-visible name this autostart service is registered as
- See also:
- setVisibleName(), setEntryName()
Enumeration Documentation
Condition |
- Enumerator:
-
StartPhase |
- Enumerator:
-