~unity-team/unity/x-sru5

« back to all changes in this revision

Viewing changes to tools/compiz-profile-selector.in

  • Committer: Marco Trevisan (Treviño)
  • Date: 2017-07-17 14:34:19 UTC
  • Revision ID: mail@3v1n0.net-20170717143419-movs7jmx2gnufqba
UnitySettings: listen to compiz profile status in order to set low_gfx value

Instead of changing this value back and forth multiple times, just wait
this to be really changed in compiz, and update our internal variable
accordingly.
Also take care of the gsettings unity's lowgfx value only if the user has
set it.

This fixes an infinite loop when starting compiz in a lowgfx environment.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
compiz_profile="ubuntu"
16
16
settings_profile="unity"
 
17
supports_3d=true
17
18
 
18
19
if ! /usr/lib/nux/unity_support_test -p; then
19
 
  settings_profile="unity-lowgfx"
 
20
  supports_3d=false
20
21
fi
21
22
 
22
 
if [ "$(gsettings get com.canonical.Unity lowgfx)" == "true" ]; then
23
 
  settings_profile="unity-lowgfx"
 
23
if [ "$UNITY_LOW_GFX_MODE" != 0 ]; then
 
24
  if [ "$supports_3d" == false ] ||
 
25
     [ "$(gsettings get com.canonical.Unity lowgfx)" == "true" ]; then
 
26
    settings_profile="unity-lowgfx"
 
27
  fi
24
28
fi
25
29
 
26
30
echo "Using compiz profile '$compiz_profile:$settings_profile'"
27
31
 
28
32
if [ -n "$UPSTART_SESSION" ]; then
29
33
  initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile"
 
34
  initctl set-env -g UNITY_HAS_3D_SUPPORT="$supports_3d"
 
35
  initctl set-env -g UNITY_DEFAULT_PROFILE="$settings_profile"
30
36
else
31
37
  systemctl --user set-environment COMPIZ_CONFIG_PROFILE="$compiz_profile"
 
38
  systemctl --user set-environment UNITY_HAS_3D_SUPPORT="$supports_3d"
 
39
  systemctl --user set-environment UNITY_DEFAULT_PROFILE="$settings_profile"
32
40
fi
33
41
 
34
42
dbus-update-activation-environment --verbose COMPIZ_CONFIG_PROFILE="$compiz_profile"
 
43
dbus-update-activation-environment --verbose UNITY_HAS_3D_SUPPORT="$supports_3d"
 
44
dbus-update-activation-environment --verbose UNITY_DEFAULT_PROFILE="$settings_profile"
35
45
 
36
46
export COMPIZ_CONFIG_PROFILE="$compiz_profile"
 
47
export UNITY_HAS_3D_SUPPORT="$supports_3d"
 
48
export UNITY_DEFAULT_PROFILE="$settings_profile"
37
49
 
38
50
@UNITY_LIBDIR@/compiz-config-profile-setter $settings_profile
39
51
@UNITY_LIBDIR@/unity-active-plugins-safety-check