Comments (3)
i think you should use pkexec replace nginx with redshift
{
"type": "toggler",
"title": "Nginx Server",
"command_on": "/usr/bin/pkexec systemctl start nginx",
"command_off": "/usr/bin/pkexec systemctl stop nginx",
"detector": "ps cax | grep nginx | grep -o '^[ ][0-9]'",
"notify_when" : ["on"]
}
and creatrea pkexec policy
from gnome-extension-quicktoggler.
@suyash192 As @deepaksp has said, the extension provides you flexible way to configure your entries. Originally I implemented only toggler
, and for convenience to toggle system-wide services I derived systemd
from it. Of course those derived entries are not complete and satisfy everyone, and then the choice you can make is to directly use the base type.
I am working on some more flexible derivation policy. Take the example of yours to explain this idea:
{
"deftype": "systemd",
"base": "toggler",
"var": ["user", "unit"],
"command_on": "systemctl $(if [${user}]; then echo --user; fi) start ${unit}",
"command_off": "systemctl $(if [${user}]; then echo --user; fi) stop ${unit}",
"detector": "systemctl $(if [${user}]; then echo --user; fi) status ${unit} | grep 'Active: activ[ei]'"
}
where user
and unit
are passed in through environment variable. It can take quite some time to implement this. Please keep watching.
from gnome-extension-quicktoggler.
@suyash192 This policy has been implemented in the lastest commit 34fa6c5. Have a try under the guidance of README, and report to me if there are any problems.
from gnome-extension-quicktoggler.
Related Issues (12)
- "wrong" detection of service status HOT 3
- react on returncode instead of "space" on toggler HOT 2
- Compatibility metadata outdated HOT 2
- encourage people to share their menu entries HOT 2
- GNOME 3.36 compatibility HOT 1
- Not available on Gnome 3.20 HOT 4
- Updating the extension does not keep settings HOT 1
- Reload button n Icons ! HOT 7
- Add localization support HOT 6
- Option to hide "filter" field HOT 1
- Upate on Gnome-Extensions HOT 3
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 gnome-extension-quicktoggler.