Jump to content

roccitman

Member
  • Posts

    132
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by roccitman

  1. Thanks for taking the time! Learning a lot here.

     

    1) Grabbed the latest just now. 635 :)

     

    2) Still works, but may have found out what's wrong. I had to run it twice for it to catch the themes I was asking for:

    before...

    INFO      Light theme : Light
    INFO      Dark theme  : Dark
    

    after...

    INFO      Light theme : OS X Yosemite
    INFO      Dark theme  : OS X Yosemite Dark
    

    Can't explain that one, just hit the up arrow and did it again. Shrug.

     

    3) Perhaps some more goodies here:

    DEBUG     Started with options : {u'help': False, u'light': 'OS X Yosemite', u'quiet': False, u'times': False, u'dark': 'OS X Yosemite Dark', u'timezones': False, u'nothing': False, u'verbose': False}
    DEBUG     Deleted stale PID file : /tmp/net.deanishe.alfred-toggle-theme.pid
    DEBUG     light at 2015-03-03 21:00:34 UTC
    INFO      Light theme : OS X Yosemite
    INFO      Dark theme  : OS X Yosemite Dark
    INFO      Alfred theme set to `OS X Yosemite`
    INFO      Next change : Theme `OS X Yosemite Dark` at sunset in 7 hours, 41 minutes at 18:42 HST
    DEBUG     Forking into background ...
    

    As always, thanks for your patience here! Looks like it was simple thing, we'll see in 7 hours 40 minutes...

  2. [ETA astral and pytz versions]

     

    I gotta be missing something. More questions from me, sorry! 

     

    I sat and watched this morning but the theme never changed from dark to light. I do see there is a plist file in the ~/user/library/launchagents/ and it does seem to know when the sunrise is/was but the them never changed.

    <?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>Toggle Alfred theme at sunrise and sunset</string>
    	<key>ProgramArguments</key>
    	<array>
    		<string>/usr/bin/python</string>
    		<string>/Users/roccoapril/Documents/_home/toggle_alfred_theme.py</string>
    		<string>--dark</string>
    		<string>OS X Yosemite Dark</string>
    		<string>--light</string>
    		<string>OS X Yosemite</string>
    	</array>
    	<key>StartCalendarInterval</key>
    	<dict>
    		<key>Day</key>
    		<integer>3</integer>
    		<key>Hour</key>
    		<integer>6</integer>
    		<key>Minute</key>
    		<integer>57</integer>
    		<key>Month</key>
    		<integer>3</integer>
    	</dict>
    </dict>
    </plist>
    
    

    Do I have something set up wrong? If I rerun the script right now it will change the theme immediately. I ran it last night about an hour after sunset and it changed it to dark. 

     

    Just ran it again, and ...

    INFO      Light theme : OS X Yosemite
    INFO      Dark theme  : OS X Yosemite Dark
    INFO      Alfred theme set to `OS X Yosemite`
    INFO      Next change : Theme `OS X Yosemite Dark` at sunset in 10 hours, 55 minutes at 18:42 HST
    

    Looks right. It's 7:47 and sunset should be around 18:30.

     

    And it looks like the plist file was edited correctly

    <?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>Toggle Alfred theme at sunrise and sunset</string>
    	<key>ProgramArguments</key>
    	<array>
    		<string>/usr/bin/python</string>
    		<string>/Users/roccoapril/Documents/_home/toggle_alfred_theme.py</string>
    		<string>--dark</string>
    		<string>OS X Yosemite Dark</string>
    		<string>--light</string>
    		<string>OS X Yosemite</string>
    	</array>
    	<key>StartCalendarInterval</key>
    	<dict>
    		<key>Day</key>
    		<integer>3</integer>
    		<key>Hour</key>
    		<integer>18</integer>
    		<key>Minute</key>
    		<integer>43</integer>
    		<key>Month</key>
    		<integer>3</integer>
    	</dict>
    </dict>
    </plist>
    
    

    I gotta be missing something. Astral version

    >>> astral.__version__

    '0.8.1'

    Updated pytz to 2014.10 (from 2013.7). Can't imagine that was a problem, but IDK.

    >>> pytz.__version__

    '2014.10'

     

    -newbie out!

  3. Hey Gents

     

    Not smart enough to know this, is the error at the end of this output saying that something didn't go right?

    DEBUG     Started with options : {u'help': False, u'light': 'OS X Yosemite', u'quiet': False, u'times': False, u'dark': 'OS X Yosemite Dark', u'timezones': False, u'nothing': False, u'verbose': False}
    DEBUG     Sunrise on 2015-03-02 : 16:57:00 UTC
    DEBUG     Sunset on 2015-03-03 : 04:41:00 UTC
    DEBUG     dark : 04:49:05 UTC
    DEBUG     Current time : 2015-03-02 04:49:05 UTC = dark
    INFO      Light theme : OS X Yosemite
    INFO      Dark theme  : OS X Yosemite Dark
    INFO      Alfred theme set to : OS X Yosemite Dark
    INFO      Next change : Theme `OS X Yosemite` at sunrise in 12 hours, 8 minutes at 06:57 HST
    DEBUG     Forking into background ...
    Traceback (most recent call last):
      File "toggle_alfred_theme.py", line 582, in <module>
        sys.exit(main())
      File "toggle_alfred_theme.py", line 564, in main
        daemonise()
      File "toggle_alfred_theme.py", line 172, in daemonise
        os.chdir(os.path.dirname(__file__))
    OSError: [Errno 2] No such file or directory: ''
    
  4. Hey Deanishe

     

    Got my Python stuff installed, and got this output when I fired up your script.

     

    DEBUG     Started with options : {u'help': False, u'light': 'OS X Yosemite', u'quiet': False, u'times': False, u'dark': 'OS X Yosemite Dark', u'timezones': False, u'nothing': False, u'verbose': False}

    DEBUG     Sunrise on 2015-02-28 : 06:19:00 UTC

    DEBUG     Sunset on 2015-02-28 : 17:09:00 UTC

    DEBUG     light : 09:37:40 UTC

    DEBUG     Current time : 2015-02-28 09:37:40 UTC = light

    INFO      Light theme : OS X Yosemite

    INFO      Dark theme  : OS X Yosemite Dark

    INFO      Alfred theme set to : OS X Yosemite

    INFO      Next change : Theme `OS X Yosemite Dark` at sunset in 7 hours, 32 minutes at 18:09 CET

    DEBUG     Forking into background ...

    Traceback (most recent call last):

      File "toggle_alfred_theme.py", line 582, in <module>

        sys.exit(main())

      File "toggle_alfred_theme.py", line 564, in main

        daemonise()

      File "toggle_alfred_theme.py", line 172, in daemonise

        os.chdir(os.path.dirname(__file__))

    OSError: [Errno 2] No such file or directory: ''

     

    I'm on HST but this looks like it's set up for CET. Am I reading the output wrong? Did I miss a step?

    Cool stuff, can't wait to get it working.

    -roccit

  5. Why not just use OS X's built-in keyboard app shortcuts?

     

    System Preferences > Keyboard > Shortcuts > App Shortcuts

     

    Click "+", select FaceTime as the Application, "Mute" [without quotes] as the Menu Title, and select whatever shortcut you desire.

     

    Or else, you will have to do some GUI scripting as FaceTime takes control over the Microphone and the scripting will essentially be exactly what the above is anyway.

    Yeah, I tried that. It doesn't work for some reason if you're just doing FaceTime Audio:

    http://d.pr/i/1akfg

  6. Dear James and everybody else,

     

    Thanks so much for sharing this workflow, it's very helpful!

     

    I read all the pages of this thread but I couldn't find an answer, hence my post. I cannot get r in 2 days at 5pm to do something to work. To be more specific, the in and at parameters don't seem to work together in the same sentence.

     

    r at 5pm works fine (so it's not an issue with my Region Settings):

     

    PastedGraphic-1.png

     

    However,  in 2 days at 5pm returns this:

     

    PastedGraphic-2.png

     

    Could you please help me out?  :)

     

    Hey t87

     

    I found the same thing but I just started either doing hours or using decimals of days. Here's two examples:

    http://d.pr/i/17SPx

    http://d.pr/i/1i2Ow

  7. Just experimenting here. If I get excited I'll make it work for either Spotify or iTunes.

     

    control+option+command+down arrow to lower the volume

    control+option+command+up arrow to restore the volume 

     

    Of course you can mess with the applescript inside to change the percentage. The number just needs to be ≥ 0 all the way to ≤ 100.

     

     

    [EDIT] Stole some code from Patrick Stadler (his cool Play WF is here) and made it so it will work the volume for either iTunes or Spotify, whichever one is playing

     

    Download

  8. Odd. I stopped using the word "to" because it kept ending up in my reminders.

     

    So...

    "r in 5 minutes to check the noodles"

    Would produce a reminder with title "to check the noodles"

     

    Double odd. It's working right today: http://d.pr/i/K84c

    (well not right, but how I've been using it.)

  9. for the record, I love and need this workflow so much that I'm working on a command line implementation for reading and writing to the Event Store, where reminders and calendars are located :) I will take a while though, I'm not very keen with Obj-C

    Nice!

  10. Indeed, but the problem with using "r" is that it can trip over itself, meaning that it won't add reminders straight away.

     

    I might make a version of the plugin that's write-only.

    Yeah, I sometimes see that when I type "r in 5 minutes feed the cat" it will show up in reminders as "feed the c" or something like that.

     

    The write-only version would be very interesting. That's all I use it for anyway. It's, for some reason, easier for me to look at the reminders window (I have it on a separate Desktop) with just a swipe.

×
×
  • Create New...