-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Support for SwiftDialog 2.5.0 Login Window Context #52
Comments
This is definitely something I plan to add, but likely will be a few more weeks before I am able to put engineering time to it |
I'm working on a PR for it at the moment. I'm just trying to find the right place to put it in the code so it makes sense and doesn't overcomplicate the existing code. Currently, the I have a check inside I haven't done any testing of it, but I'll push the PR once I have something that looks workable for folks to try out. |
I recommend the following: If that option is set to We may also want to find/replace (carefully) the name of the We need to also be careful this doesn't step on the |
Wanted to run this potential solution by you to see how you felt about it: function check_run_at_loginwindow(){
showAtLoginWindowSetting=$($pBuddy -c "Print ShowAtLoginWindow" "$BaselineConfig")
if [ "$showAtLoginWindowSetting" = "true" ]; then
showAtLoginWindow="true"
else
showAtLoginWindow="false"
fi
} I then decided to better preserve your original code by using a function loginwindow_action(){
# default loginwindow setting to false, change if true
showAtLoginWindow="false"
check_run_at_loginwindow
case "$showAtLoginWindow" in
"true")
debug_message "Baseline has been set to run at loginwindow, skip verified user check.";;
"false" | *)
#Set our test to false
verifiedUser="false"
#Loop until user is found
while [ "$verifiedUser" = "false" ]; do
#Get currently logged in user
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
else #Verify the current user is not root, loginwindow, or _mbsetupuser
if [ "$currentUser" = "root" ] \
|| [ "$currentUser" = "loginwindow" ] \
|| [ "$currentUser" = "_mbsetupuser" ] \
|| [ -z "$currentUser" ]
then
#If we aren't verified yet, wait 1 second and try again
sleep 1
else
#Logged in user found, but continue the loop until Dock and Finder processes are running
if pgrep -q "dock" && pgrep -q "Finder"; then
uid=$(id -u "$currentUser")
log_message "Verified User is logged in: $currentUser UID: $uid"
verifiedUser="true"
fi
fi
fi
debug_message "Disabling verbose output to prevent logspam while waiting for user at timestamp: $(date +%s)"
set +x
done
debug_message "Re-enabling verbose output after finding user at timestamp: $(date +%s)";;
esac
} I used a find/replace to swap |
I am good with this format, however, it does not appear that this accounts for |
Perhaps we need to think of this more like "Run mode" Is the "Run mode" "Original Flavor, Silent, or LoginWindow" ? What do you think? If so, |
That actually makes way more sense to treat it as such. So then you could just call |
I've been thinking on this. I think the goal needs to be: Determine which runmode we have by reading all of the relevant configuration profile keys, then at the step where So read the config to see if silent is there, read the config to see if runatloginwindow is there (also read the command line arguments for both) Then do one if/elif statement:
What do you think? |
I rebased from |
Thats awesome, I look forward to reviewing when I am able. I don't have any changes in the works in the Thank you for your contribution! |
Computer labs and shared resource computers often need to be redeployed without a user logged in to have them provisioned before a user needs it.
SwiftDialog 2.5.0 added support for a
--loginwindow
flag that can be executed by a LaunchDaemon to enable this functionality.I propose setting up a
ShowAtLoginWindow
key that validates SwiftDialog 2.5.0 or newer is installed, skips the logged in user check, and runs SwiftDialog with the--loginwindow
flag.The text was updated successfully, but these errors were encountered: