Giter Site home page Giter Site logo

Comments (3)

deepaksp avatar deepaksp commented on July 4, 2024

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.

Shihira avatar Shihira commented on July 4, 2024

@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.

Shihira avatar Shihira commented on July 4, 2024

@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)

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.