-
Posts
132 -
Joined
-
Last visited
-
Days Won
3
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by roccitman
-
-
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...
-
[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!
-
Heh, happy to help
OK, yeah. Output looks perfect now
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 9 hours, 57 minutes at 18:41 HST
-
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: ''
-
Deanishe is really good at python.
Indeed!
I am very much a beginner with command line stuff so thanks for your patience. Looks like all the variables are happy now:
INFO Next change : Theme `OS X Yosemite Dark` at sunset in 7 hours, 17 minutes at 18:40 HST
-
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
-
Sweet! Thanks a ton!
-
Nice! I wonder if Alfred workflows can be automated. I'd like for this to turn on in the evening and off in the morning. Lazy and all, you know
-
OK, found this workflow by "pborenstein" which uses system volume instead of trying to focus on just FaceTime's use of the input source.
Ewww, nice find!
I added a hotkey to mine, so I don't have to evoke Alfred.
-
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:
-
Please download the latest version, which has this new pattern
Thanks Jack James! Gotta admit, this is a slick addition. It's been fun being close to the evolution of this workflow.
-roccit
Btw, are you a DJ in your spare time?
-
Yeah, I only do around 5 per day so it works for me. You've reached the end of my tech support abilities on this workflow
-
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):
However, r in 2 days at 5pm returns this:
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:
-
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
-
Seems to work fine on 10.10. Awesome!
-
I've had some oddness with Yosemite. Seems like things needed to be shaken out. A few reboots never hurt anybody
-
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.)
-
Hmm. We may need a Yosemite update. Anyone else having trouble?
Am I missing something?
-
Nice tip, would be perfect. Now to just teach myself how to
My lazy wants to just buy this: https://itunes.apple.com/us/app/clockwise/id644904486?mt=12
-
Hey group
I'm trying to set up my machine to run an AppleScript after a period of inactivity (like a screensaver). I wonder if Alfred can handle that. Any thoughts?
-
Excellent and simple little action. Thanks Vitor!
-
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!
-
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.
-
As noted on the first post, "radd" works fine in Mavericks for creating reminders with this workflow
FWIW, both "r" and "radd" work the same for me.
(Mavericks on a 2013 MBP)
Automatically change themes at sunrise and sunset
in Themes
Posted
Darn, it didn't. The themes got reset back to 'light' and 'dark' again. Not sure what's going on. Machine was sleeping during the change so might be the same thing that Richard was seeing. We'll try again in the morning, heh.