Please excuse my newbieness with Linux systems but the shell script that I was intending had to be (and also if someone didn't know its executable bit must also be enabled by using chmod):
# if [ -n "$pid" ]
# then
# ps $pid &> /home/sanjeev/Desktop/gnomesettingsdebug1.txt
# else
# echo "No previous instance of gnome-settings-daemon running!" &> /home/sanjeev/Desktop/gnomesettingsdaemondebug.txt
# fi
while [ -n "$pid" ];
do
pid=$(pgrep gnome-settings-)
sleep 0
done
exit 0
----------------------------------------------------------------------------------------------------------------------------------
Turns out 'wait' only works for child processes. I wonder why.
Enabling the 'if' comments will output some useful information about previously running instance (be sure to change the path as according to your system). I also changed the name of the script from 'gnome-settings-daemon-fix.sh' to 'gnomesettingsdaemonfix.sh' as pgrep couldn't distinguish between process name of the running script and process name of the daemon as it compares only 15 characters of process names (Again, I cannot explain this). Hence, the edited 'gnome-settings-daemon.desktop' should be:
I captured the following about the previously running instance of settings daemon:
PID TTY STAT TIME COMMAND
1514 ? Ds 0:00 [gnome-settings-]
Collision between this instance and the instance run by '.desktop' file may be the cause of the theme problem in my system. This solution seems to be working for me.
EDIT to comment #23:
Please excuse my newbieness with Linux systems but the shell script that I was intending had to be (and also if someone didn't know its executable bit must also be enabled by using chmod):
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ---- fix.sh
#!/bin/bash
# gsettingsdaemon
pid=$(pgrep gnome-settings-)
# if [ -n "$pid" ] Desktop/ gnomesettingsde bug1.txt daemon running!" &> /home/sanjeev/ Desktop/ gnomesettingsda emondebug. txt
# then
# ps $pid &> /home/sanjeev/
# else
# echo "No previous instance of gnome-settings-
# fi
while [ -n "$pid" ];
do
pid=$(pgrep gnome-settings-)
sleep 0
done
exit 0
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----
Turns out 'wait' only works for child processes. I wonder why.
Enabling the 'if' comments will output some useful information about previously running instance (be sure to change the path as according to your system). I also changed the name of the script from 'gnome- settings- daemon- fix.sh' to 'gnomesettingsd aemonfix. sh' as pgrep couldn't distinguish between process name of the running script and process name of the daemon as it compares only 15 characters of process names (Again, I cannot explain this). Hence, the edited 'gnome- settings- daemon. desktop' should be:
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ---- autostart/ gnomesettingsda emonfix. sh ;/usr/lib/ gnome-settings- daemon/ gnome-settings- daemon' Autostart- Phase=Initializ ation Autostart- Notify= true AutoRestart= true Gettext- Domain= gnome-settings- daemon ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----
[Desktop Entry]
Type=Application
Name=GNOME Settings Daemon
Exec=bash -c 'bash /etc/xdg/
OnlyShowIn=GNOME;
NoDisplay=false
X-GNOME-
X-GNOME-
X-GNOME-
X-Ubuntu-
-------
I captured the following about the previously running instance of settings daemon:
PID TTY STAT TIME COMMAND
1514 ? Ds 0:00 [gnome-settings-]
Collision between this instance and the instance run by '.desktop' file may be the cause of the theme problem in my system. This solution seems to be working for me.