summaryrefslogtreecommitdiff
diff options
authorTed Gould <ted@gould.cx>2016-07-20 17:08:01 +0200
committerTed Gould <ted@gould.cx>2016-07-20 17:08:01 +0200
commit0794e1e677ab54bd46c6e64cd6c2f34d11c74971 (patch)
treea60a47fd082cb7bc494cbd8e7c203d903dae8c2b
parent58d55cce6ba8d1c74933c273ec0ea74ae1493ac6 (diff)
Switch to everything using the same shell script
(bzr r4153.9.7)
-rw-r--r--debian/unity7.conf22
-rw-r--r--debian/unity7.service2
-rw-r--r--tools/CMakeLists.txt4
-rwxr-xr-xtools/unity-compiz-profile24
4 files changed, 28 insertions, 24 deletions
diff --git a/debian/unity7.conf b/debian/unity7.conf
index 7290000ad..2e53bf215 100644
--- a/debian/unity7.conf
+++ b/debian/unity7.conf
@@ -4,27 +4,7 @@ author "Ted Gould <ted@ubuntu.com>, Marco Trevisan <marco@ubuntu.com>"
start on xsession SESSION=ubuntu and started unity-settings-daemon
stop on desktop-end
-pre-start script
- # If gnome-session is going to start compiz,
- # we don't want to be the ones doing it.
-
- if grep -q compiz /usr/share/gnome-session/sessions/ubuntu.session ; then
- echo "GNOME Session is starting Compiz"
- stop ; exit 0
- fi
-
- compiz_profile="ubuntu"
-
- if ! /usr/lib/nux/unity_support_test -p; then
- compiz_profile="ubuntu-lowgfx"
- fi
-
- echo "Using compiz profile '$compiz_profile'"
- initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile"
- export COMPIZ_CONFIG_PROFILE="$compiz_profile"
-
- /usr/lib/unity/unity-active-plugins-safety-check
-end script
+pre-start exec /usr/lib/unity/unity-compiz-profile
respawn
exec compiz
diff --git a/debian/unity7.service b/debian/unity7.service
index a7f71b9b5..deebf9aaf 100644
--- a/debian/unity7.service
+++ b/debian/unity7.service
@@ -6,6 +6,6 @@ After=unity-settings-daemon.service
PartOf=graphical-session.target
[Service]
-Environment=COMPIZ_CONFIG_PROFILE=ubuntu
ExecStart=/usr/bin/compiz
+ExecStart.Pre=/usr/lib/unity/unity-compiz-profile
Restart=on-failure
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index c2ea9d63e..af7d6a4c9 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -1,7 +1,7 @@
#
# Some unity tools
#
-install(FILES makebootchart.py unity-compiz-profile PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity)
+install(FILES makebootchart.py PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity)
install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
@@ -28,3 +28,5 @@ link_directories(${LIB_PATHS})
add_executable(unity-active-plugins-safety-check unity_active_plugins_safety_check.cpp)
target_link_libraries(unity-active-plugins-safety-check ${LIBS})
install(TARGETS unity-active-plugins-safety-check DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/)
+
+install(FILES unity-compiz-profile DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/)
diff --git a/tools/unity-compiz-profile b/tools/unity-compiz-profile
index c4ce30e2b..a366ba747 100755
--- a/tools/unity-compiz-profile
+++ b/tools/unity-compiz-profile
@@ -1,3 +1,25 @@
#!/bin/bash
-echo "This is the world"
+set -e
+
+# If gnome-session is going to start compiz,
+# we don't want to be the ones doing it.
+
+if grep -q compiz /usr/share/gnome-session/sessions/ubuntu.session ; then
+ echo "GNOME Session is starting Compiz"
+ stop ; exit 0
+fi
+
+compiz_profile="ubuntu"
+
+if ! /usr/lib/nux/unity_support_test -p; then
+ compiz_profile="ubuntu-lowgfx"
+fi
+
+echo "Using compiz profile '$compiz_profile'"
+
+initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile"
+systemctl set-environment --user COMPIZ_CONFIG_PROFILE="$compiz_profile"
+
+export COMPIZ_CONFIG_PROFILE="$compiz_profile"
+exec /usr/lib/unity/unity-active-plugins-safety-check