Author Topic: provisioning per-user autostart scripts?  (Read 2007 times)

pyperdown

  • Full Member
  • ***
  • Posts: 65
    • View Profile
provisioning per-user autostart scripts?
« on: January 10, 2013, 11:56:59 AM »
This should be simple, but for some reason it doesn't appear to run.

The goal here in our shared netbook environment is to
a) disable the password requirement on the screen saver
b) cleanup any leftover files (lock and .parentlock) in the user's browser profile

The script works when run from a terminal, but does not run at login despite a .config/autostart entry to launch it...

The autostart file (.cleanup.desktop) contains:


[Desktop Entry]
Type=Application
Exec=bash ~/.cleanup.sh
Hidden=false
NoDisplay=true
X-GNOME-Autostart-enabled=true
Name[en_US]=cleanup
Name=cleanup
Comment[en_US]=cleanup
Comment=cleanup
~                 

And the .cleanup.sh script contains:

#!/bin/bash
sleep 10
echo -en "\07"
killall -KILL firefox-bin
killall -KILL firefox

find ~./.mozilla/ -iname ".parentlock" -exec rm -f {} \;
find ~./.mozilla/ -iname "lock" -exec rm -f {} \;
find ~./.mozilla/ -iname "places.sqlite" -exec rm -f {} \;
find ~./.mozilla/ -iname "places.sqlite-journal" -exec rm -f {} \;
touch ~/I_RAN

#This is for 12.04LTS
gsettings set org.gnome.desktop.screensaver lock-enabled false

# this is for 10.04LTS
gconftool-2 --type boolean -s /apps/gnome-power-manager/lock/blank_screen false
gconftool-2 --type boolean -s /apps/gnome-power-manager/lock/gnome_keyring_hibernate false
gconftool-2 --type boolean -s /apps/gnome-power-manager/lock/gnome_keyring_suspend false
gconftool-2 --type boolean -s /apps/gnome-power-manager/lock/hibernate false
gconftool-2 --type boolean -s /apps/gnome-power-manager/lock/suspend false
gconftool-2 --type boolean -s /apps/gnome-power-manager/lock/use_screensaver_settings true
gconftool-2 --type boolean -s /apps/gnome-screensaver/lock_enabled false


pyperdown

  • Full Member
  • ***
  • Posts: 65
    • View Profile
Re: provisioning per-user autostart scripts? solved (maybe)
« Reply #1 on: January 10, 2013, 05:10:27 PM »
Well somebody didn't read the .desktop file spec.

2 things

tilde needs to escaped, along with some other characters
even with the tilde, it does not expand to the homedir

what I did find is that changing the Exec to just bash ./.cleanup worked.

http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables