Skip to content
Snippets Groups Projects
Commit 8c13f8c8 authored by Ruben Rodriguez's avatar Ruben Rodriguez
Browse files

Updated gnome-session so trisquel-wm migrates profiles on startup

parent 572b14e0
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
set +e
# Migrate the profile if needed
[ -f ~/.config/profilemigrated ] || touch ~/.config/profilemigrated
if ! grep 6.0 -q ~/.config/profilemigrated ; then
# Reset Compiz
rm ~/.cache/compiz* ~/.compiz* ~/.config/compiz* -rf
for key in /apps/panel /apps/compiz /apps/compiz-1 /apps/compizconfig-1 /apps/compizconfig
do
gconftool --recursive-unset $key
done
# Update wallpaper if default is still used
if gsettings get org.gnome.desktop.background picture-uri |grep /usr/share/backgrounds/brigantia.jpg ; then
gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/toutatis.jpg'
fi
# Reset GNOME panel
cat << EOF | dconf load /org/gnome/gnome-panel/
[layout]
object-id-list=['menu-bar', 'home', 'abrowser', 'window-list', 'notification-area', 'indicators', 'clock', 'show-desktop']
toplevel-id-list=['panel']
[layout/objects/abrowser-0/instance-config]
location='file:///usr/share/applications/browser.desktop'
[layout/objects/abrowser-0]
object-iid='PanelInternalFactory::Launcher'
pack-index=20
toplevel-id='panel'
[layout/objects/abrowser/instance-config]
location='file:///usr/share/applications/browser.desktop'
[layout/objects/abrowser]
object-iid='PanelInternalFactory::Launcher'
pack-index=20
toplevel-id='panel'
[layout/objects/clock]
object-iid='ClockAppletFactory::ClockApplet'
pack-index=10
pack-type='end'
toplevel-id='panel'
[layout/objects/home/instance-config]
location='file:///usr/share/applications/home.desktop'
[layout/objects/home]
object-iid='PanelInternalFactory::Launcher'
pack-index=10
pack-type='start'
toplevel-id='panel'
[layout/objects/indicators]
object-iid='IndicatorAppletFactory::IndicatorApplet'
pack-index=20
pack-type='end'
toplevel-id='panel'
[layout/objects/menu-bar]
object-iid='PanelInternalFactory::MenuButton'
pack-index=0
pack-type='start'
toplevel-id='panel'
[layout/objects/notification-area]
object-iid='NotificationAreaAppletFactory::NotificationArea'
pack-index=30
pack-type='end'
toplevel-id='panel'
[layout/objects/show-desktop]
object-iid='WnckletFactory::ShowDesktopApplet'
pack-index=0
pack-type='end'
toplevel-id='panel'
[layout/objects/window-list]
object-iid='WnckletFactory::WindowListApplet'
pack-index=30
pack-type='start'
toplevel-id='panel'
[layout/toplevels/panel-0]
animation-speed='fast'
auto-hide=false
auto-hide-size=1
enable-arrows=true
enable-buttons=false
expand=true
hide-delay=300
monitor=0
orientation='bottom'
screen=0
size=44
unhide-delay=100
x=0
x-centered=false
x-right=-1
y=724
y-bottom=0
y-centered=false
[layout/toplevels/panel]
animation-speed='fast'
auto-hide=false
auto-hide-size=1
enable-arrows=true
enable-buttons=false
expand=true
hide-delay=300
monitor=0
orientation='bottom'
screen=0
size=44
unhide-delay=100
x=0
x-centered=false
x-right=-1
y=724
y-bottom=0
y-centered=false
EOF
fi
lsb_release -r -s > ~/.config/profilemigrated
WM=compiz
FALLBACK=openbox
which metacity && FALLBACK=metacity
which compiz || WM=$FALLBACK
[ -f ~/.disable-compiz ] && WM=$FALLBACK
grep access=v3 /proc/cmdline -q && WM=$FALLBACK
[ $(gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled) = "true" ] && WM=$FALLBACK
# Ugly hack to fix a hard to catch race condition
if gconftool --get /apps/metacity/general/titlebar_font |grep -q Cantarell
then
if ! [ -f /usr/share/fonts/opentype/cantarell/Cantarell-Bold.otf ]
then
echo The gconf db seems corrupted, saving at ~/.gconf.broken and cleaning it up
cp -a ~/.gconf ~/.gconf.broken
gconftool --recursive-unset /
fi
fi
/usr/lib/gnome-session/gnome-session-check-accelerated && exec $WM || exec $FALLBACK
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
VERSION=10 VERSION=12
COMPONENT=main COMPONENT=main
QUILT=skip QUILT=skip
...@@ -39,44 +39,7 @@ debian/tmp/usr/share/gnome-session/sessions/gnome-classic.session ...@@ -39,44 +39,7 @@ debian/tmp/usr/share/gnome-session/sessions/gnome-classic.session
EOF EOF
#% Add a wrapper for compiz #% Add a wrapper for compiz
cat << EOF > debian/scripts/trisquel-wm cp $DATA/trisquel-wm debian/scripts/trisquel-wm
#!/bin/sh
# Migrate the profile if needed
[ -f ~/.config/profilemigrated ] || touch ~/.config/profilemigrated
if ! grep $(lsb_release -r -s) -q ~/.config/profilemigrated ; then
rm ~/.cache/compiz* ~/.compiz* ~/.config/compiz* -rf
for key in /apps/panel /apps/compiz /apps/compiz-1 /apps/compizconfig-1 /apps/compizconfig
do
gconftool --recursive-unset $key
done
gsettings reset-recursively org.gnome.gnome-panel
gnome-panel --replace
lsb_release -r -s > ~/.config/profilemigrated
fi
WM=compiz
FALLBACK=openbox
which metacity && FALLBACK=metacity
which compiz || WM=\$FALLBACK
[ -f ~/.disable-compiz ] && WM=\$FALLBACK
grep access=v3 /proc/cmdline -q && WM=\$FALLBACK
[ \$(gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled) = "true" ] && WM=\$FALLBACK
# Ugly hack to fix a hard to catch race condition
if gconftool --get /apps/metacity/general/titlebar_font |grep -q Cantarell
then
if ! [ -f /usr/share/fonts/opentype/cantarell/Cantarell-Bold.otf ]
then
echo The gconf db seems corrupted, saving at ~/.gconf.broken and cleaning it up
cp -a ~/.gconf ~/.gconf.broken
gconftool --recursive-unset /
fi
fi
/usr/lib/gnome-session/gnome-session-check-accelerated && exec \$WM || exec \$FALLBACK
EOF
chmod 755 debian/scripts/trisquel-wm chmod 755 debian/scripts/trisquel-wm
cat << EOF > debian/scripts/trisquel-wm.desktop cat << EOF > debian/scripts/trisquel-wm.desktop
[Desktop Entry] [Desktop Entry]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment