Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$PID variable in helpers #21

Closed
xsuchy opened this issue Oct 16, 2014 · 7 comments
Closed

$PID variable in helpers #21

xsuchy opened this issue Oct 16, 2014 · 7 comments
Labels

Comments

@xsuchy
Copy link
Contributor

xsuchy commented Oct 16, 2014

I have process:

konqueror --preload

Which can be easily killed and does not need to be restarted again, it would be nice if I can write rule:

<app name="konqueror --preload" helper="kill $PID">

where $PID would be substituted by real PID before printing.

@FrostyX
Copy link
Owner

FrostyX commented Oct 16, 2014

Sure, we can definitely have this feature, but I would rather helper="kill {PID}" format instead of helper="kill $PID", so we could simply use str.format(...). Don't you mind?

@xsuchy
Copy link
Contributor Author

xsuchy commented Oct 16, 2014

{PID} is good as well.

@FrostyX
Copy link
Owner

FrostyX commented Oct 19, 2014

Hmm, what about when application has more instances (processes) ? Probably just print that kill helper for every instance?

How to restart:
    kill 1234; kill 4321; kill 5678

or maybe (i like it better)

How to restart:
    kill 1234
    kill 4321
    kill 5678

Its probably fine, but in default view

You should restart:
  * Some applications using:
      kill 1234; kill 4321; kill 5678  
      sudo service apache2 restart
      sudo service mpd restart
      ...

it doesn't look so friendly. But so far I don't know how to deal with it.

@xsuchy
Copy link
Contributor Author

xsuchy commented Oct 19, 2014

You can concate it:

   kill 1234 4321 5678

@xsuchy
Copy link
Contributor Author

xsuchy commented Oct 19, 2014

Hmm, but thinking about it... this can be done only if the helper string is identical. Because I can imagine helper script kill -USR1 {PID}

Anyway the functionality and usability is much more important. Visual style is less important.

@FrostyX
Copy link
Owner

FrostyX commented Oct 19, 2014

As you said, concating can't work for every command, so I would prefer this kind of output:

How to restart:
    kill 1234
    kill 4321
    kill 5678

and one-liner with semicolons for default view. I agree that this feature is very important, so I will surely implement it. However I think it could look better than

You should restart:
  * Some applications using:
      kill 1234; kill 4321; kill 5678  
      sudo service apache2 restart
      sudo service mpd restart
      ...

so I will give it a thought,

@FrostyX
Copy link
Owner

FrostyX commented Nov 11, 2014

Hmm, probably I will just print commented application's name after restart commands which use any {foo} argument and not use {name} at the same time.

Output will look like

kill 1234; kill 4321;  # konqueror

for this kind of helpers. Also I think it will avoid printing comment for most helpers which tells name of the application by themselves.

Advantage of this is clear - you can see what application will be killed, but still you can copy and paste the block of printed helpers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants