Git Product home page Git Product logo

auto-selfcontrol-rs's People

Contributors

alexanderdickie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

auto-selfcontrol-rs's Issues

--deploy generates bad .plist

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?

Not starting automatically

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!

Problem in documentation

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.