Comments (4)
You can add custom Raycast scripts to achieve this functionality. Commands you'll need are
open keepingyouawake:///activate
open keepingyouawake:///deactivate
open keepingyouawake:///toggle
for example, you can use the following code (keepingyouawake.py)
#!/usr/bin/env python3
#
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title keepingyouawake
# @raycast.mode silent
# @raycast.packageName Raycast Scripts
#
# Optional parameters:
# @raycast.argument1 { "type": "text", "placeholder": "on/off/Toggle", "optional": true}
import sys
import subprocess
if sys.argv[1].lower() == 'on':
subprocess.call("open keepingyouawake:///activate", shell=True)
elif sys.argv[1].lower() == 'off':
subprocess.call("open keepingyouawake:///deactivate", shell=True)
else:
# no argument will toggle on/off
subprocess.call("open keepingyouawake:///toggle", shell=True)
from keepingyouawake.
That's definitely a good idea to provide a customizable keyboard shortcut 👍. Thanks for the suggestion!
from keepingyouawake.
Sure thing! I think if KYA gets integrated with Raycast, then it would solve the problem because one can set shortcuts in Raycast. For example, this does what KYA does within Raycast, but unfortunately it doesn't show the status in the menu bar like KYA.
from keepingyouawake.
You can add custom Raycast scripts to achieve this functionality. Commands you'll need are
open keepingyouawake:///activate
open keepingyouawake:///deactivate
open keepingyouawake:///toggle
for example, you can use the following code (keepingyouawake.py)
#!/usr/bin/env python3 # # Required parameters: # @raycast.schemaVersion 1 # @raycast.title keepingyouawake # @raycast.mode silent # @raycast.packageName Raycast Scripts # # Optional parameters: # @raycast.argument1 { "type": "text", "placeholder": "on/off/Toggle", "optional": true} import sys import subprocess if sys.argv[1].lower() == 'on': subprocess.call("open keepingyouawake:///activate", shell=True) elif sys.argv[1].lower() == 'off': subprocess.call("open keepingyouawake:///deactivate", shell=True) else: # no argument will toggle on/off subprocess.call("open keepingyouawake:///toggle", shell=True)
Thanks, this is the way. I aliased it with ka
in Raycast and solved the problem!
from keepingyouawake.
Related Issues (20)
- Lock Screen When Lid is Closed HOT 2
- doesn't seem to work on Big Sur HOT 3
- Start at Login Problems macOS version 11.3 on M1 HOT 2
- Is there a way to automatically make the coffee cup full? HOT 2
- Allow to disable On/Off notifications HOT 4
- allow display to sleep vs locking HOT 2
- The app stops working some times HOT 6
- Option "Indefinitely" cannot be deleted in Settings. HOT 3
- Creating a schedule HOT 1
- Not working in macOS Ventura? HOT 1
- Display the time that remains until the activation duration is elapsed
- Activate URI schemes doesn't work anymore HOT 6
- Doesn't work on OSX Ventura HOT 10
- command line parameters with duration don't seem to work HOT 2
- When I unlock the machine It switches back to the default state!
- Update check on start
- External display advanced option spams caffeinate processes HOT 1
- Bug: Theme does not switch while active HOT 1
- does not work when the lid is close : lock screen is opened (ventura) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keepingyouawake.