victorkhugo
MIS
What I want to do is find out the current screen saver settings the current user has set.
The way that I'm doing it now is, I split the tasks into two different scripts.
#!/bin/tcsh
set j=`users`
foreach k ($j)
echo $k
if ("$k" != 'root') then
sudo -u $k /usr/bin/forceScreenSaverSimple
exit
endif
end
And then it calls the script forceScreenSaverSimple which it runs as everyone except root.
#!/bin/tcsh
set currTime = `defaults -currentHost read com.apple.screensaver idleTime`
if ($currTime > 1800) defaults -currentHost write com.apple.screensaver idleTime 1800
defaults -currentHost write com.apple.screensaver askForPassword true
chsh -s /bin/bash
There must be an easier way to do this that's all in one script.
The way that I'm doing it now is, I split the tasks into two different scripts.
#!/bin/tcsh
set j=`users`
foreach k ($j)
echo $k
if ("$k" != 'root') then
sudo -u $k /usr/bin/forceScreenSaverSimple
exit
endif
end
And then it calls the script forceScreenSaverSimple which it runs as everyone except root.
#!/bin/tcsh
set currTime = `defaults -currentHost read com.apple.screensaver idleTime`
if ($currTime > 1800) defaults -currentHost write com.apple.screensaver idleTime 1800
defaults -currentHost write com.apple.screensaver askForPassword true
chsh -s /bin/bash
There must be an easier way to do this that's all in one script.