aboutsummaryrefslogtreecommitdiff
path: root/src/arctica-greeter.vala
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-05-16 14:27:06 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-05-16 14:27:06 +0200
commit237d6304de6211646d20581c192f9da969325e25 (patch)
tree4f1607e17febea17fada7a356c99701f57a2a4c7 /src/arctica-greeter.vala
parent5ad2a0e4dcf229ea9bd4df234d510a64712dddcd (diff)
downloadarctica-greeter-237d6304de6211646d20581c192f9da969325e25.tar.gz
arctica-greeter-237d6304de6211646d20581c192f9da969325e25.tar.bz2
arctica-greeter-237d6304de6211646d20581c192f9da969325e25.zip
indicator services: Launch inicator power service via systemd before showing the greeter.
Diffstat (limited to 'src/arctica-greeter.vala')
-rw-r--r--src/arctica-greeter.vala45
1 files changed, 39 insertions, 6 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index e7e3ba0..314f35f 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -556,7 +556,6 @@ public class ArcticaGreeter
Environment.set_variable ("GTK_MODULES", "atk-bridge", false);
Pid atspi_pid = 0;
- Pid systemd_pid = 0;
try
{
@@ -652,6 +651,8 @@ public class ArcticaGreeter
debug ("Creating Arctica Greeter");
var greeter = new ArcticaGreeter (do_test_mode);
+ Pid dummy_pid = 0;
+
if (!do_test_mode)
{
@@ -671,12 +672,28 @@ public class ArcticaGreeter
null,
SpawnFlags.SEARCH_PATH,
null,
- out systemd_pid);
+ out dummy_pid);
}
catch (Error e)
{
warning ("Error starting Ayatana Indicators Application Service: %s", e.message);
}
+ try
+ {
+ string[] argv;
+
+ Shell.parse_argv ("systemctl --user start ayatana-indicator-power", out argv);
+ Process.spawn_async (null,
+ argv,
+ null,
+ SpawnFlags.SEARCH_PATH,
+ null,
+ out dummy_pid);
+ }
+ catch (Error e)
+ {
+ warning ("Error starting Ayatana Indicators Power Service: %s", e.message);
+ }
/* Make nm-applet hide items the user does not have permissions to interact with */
Environment.set_variable ("NM_APPLET_HIDE_POLICY_ITEMS", "1", true);
@@ -705,9 +722,10 @@ public class ArcticaGreeter
debug ("Cleaning up");
- if (systemd_pid != 0)
+ if (!do_test_mode)
{
- /* Start the indicator services */
+
+ /* Stop the indicator services */
try
{
string[] argv;
@@ -718,13 +736,28 @@ public class ArcticaGreeter
null,
SpawnFlags.SEARCH_PATH,
null,
- out systemd_pid);
+ out dummy_pid);
}
catch (Error e)
{
warning ("Error stopping Ayatana Indicators Application Service: %s", e.message);
}
- systemd_pid = 0;
+ try
+ {
+ string[] argv;
+
+ Shell.parse_argv ("systemctl --user stop ayatana-indicator-power", out argv);
+ Process.spawn_async (null,
+ argv,
+ null,
+ SpawnFlags.SEARCH_PATH,
+ null,
+ out dummy_pid);
+ }
+ catch (Error e)
+ {
+ warning ("Error stopping Ayatana Indicators Power Service: %s", e.message);
+ }
}
if (atspi_pid != 0)