alexanderdickie / auto-selfcontrol-rs Goto Github PK
View Code? Open in Web Editor NEWSchedule automatic activations of SelfControl
Schedule automatic activations of SelfControl
thank you for your service kind sir. the other one did not work but this is perfect. thank you so much
Thanks for creating this tool!
Tiny correction that's necessary in your README.md file: it says ./auto-self-control-rs --write_example_config
when it should say ./auto-selfcontrol-rs --write_example_config
(No hyphen between "self" and "control").
Other than that, great tool! IMHO, the next great thing would be the ability to define a daily schedule, the way the "original" scheduler does. Thanks again!
Hi, thanks for your work on this!
I've been trying to get it running (macos 12.6.3 on a 2017 MB air), following the instructions for Intel macs. It initially didn't work for me (i.e., launchagent just wouldn't load), but today I took a closer look at the .plist file that is being generated by --deploy, and it turns out that's where the issue is:
plutil ~/Library/LaunchAgents/com.main-auto-selfcontrol-rs.plist
returns
/Users/tt/Library/LaunchAgents/com.main-auto-selfcontrol-rs.plist: Found non-key inside <dict> at line 24
the faulty plist looks like this, line 24 is the end of the second <dict>
entry after StartCalendarInterval
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.main-auto-selfcontrol-rs.plist</string>
<key>ProgramArguments</key>
<array>
<string>/Users/tt/auto-selfcontrol-rs</string>
<string>--execute</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>0</integer>
</dict>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>8</integer>
</dict>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>10</integer>
</dict>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>12</integer>
</dict>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>14</integer>
</dict>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>16</integer>
</dict>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>18</integer>
</dict>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>20</integer>
</dict>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>22</integer>
</dict>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
I'm pretty new to all this, but googling the error message suggests that each <dict>
entry should be preceded by some key, presumably <key>StartCalendarInterval</key>
, and if I edit the plist accordingly plutil
tells me it's OK; and I can launctl load
it succesfully, and it does start a block, etc.
so this might be an easy fix?
There is an issue with the behaviour of the software, as it doesn't automatically start at the requested time.
I went to look for the .plist file generated in the LaunchAgents folder, and it seems off.
Here's what my schedule in the config.aoml file looks like:
[Mon, Tue, Wed, Thu, Fri] = [ (08:30 -> 12:30), (13:30 -> 19:30) ]
And here's what the scheduling part of the .plist file looks like after --deploy:
<key>StartCalendarInterval</key> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>8</integer> </dict> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>13</integer> </dict> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>8</integer> </dict> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>13</integer> </dict> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>8</integer> </dict> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>13</integer> </dict> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>8</integer> </dict> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>13</integer> </dict> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>8</integer> </dict> <dict> <key>Minute</key> <integer>30</integer> <key>Hour</key> <integer>13</integer> </dict> <key>RunAtLoad</key> <true/>
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.