Skip to content
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

Delete all Login Items before running mli load #30

Open
3 tasks done
5ouma opened this issue Jan 22, 2024 · 0 comments
Open
3 tasks done

Delete all Login Items before running mli load #30

5ouma opened this issue Jan 22, 2024 · 0 comments
Assignees
Labels
🧨 Breaking Change Includes breaking changes 🎉 New Feature Introduce a new feature

Comments

@5ouma
Copy link
Owner

5ouma commented Jan 22, 2024

✏️ Describe the feature

Now Add() only adds Login Items from login_items.json as its name implies.
However, mli is usually used to set all Login Items, and system Login Items should respect them in the file.
System Login Items can be deleted by osascript -e 'tell app "System Events" to delete login items'.

mli/lib/oascript.go

Lines 46 to 59 in fd914ba

func (loginItems *LoginItems) Add() error {
for _, loginItem := range *loginItems {
if isExist, err := isExist(loginItem.Path); !isExist && err == nil {
fmt.Printf("⚠️ not found: \"%s\"\n", loginItem.Path)
continue
}
if _, err := mack.Tell("System Events", fmt.Sprintf(`make login item at end with properties { name: "%s", path: "%s", hidden: %v }`, loginItem.Name, loginItem.Path, loginItem.Hidden)); err != nil {
return err
}
fmt.Printf("🔍 %s\n", loginItem.Name)
}
return nil
}

✔︎ Confirm these checks

🗒️ Additional Information

No response

@5ouma 5ouma self-assigned this Jan 22, 2024
@5ouma 5ouma added this to the v1.0.0 milestone Mar 9, 2024
@5ouma 5ouma added 🧨 Breaking Change Includes breaking changes 🎉 New Feature Introduce a new feature and removed Type: Breaking Change labels Jun 20, 2024
@5ouma 5ouma removed this from the v1.0.0 milestone Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧨 Breaking Change Includes breaking changes 🎉 New Feature Introduce a new feature
Projects
None yet
Development

No branches or pull requests

1 participant