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

Does not work with urxvt daemon #17

Closed
smkuehnhold opened this issue Jul 23, 2020 · 19 comments
Closed

Does not work with urxvt daemon #17

smkuehnhold opened this issue Jul 23, 2020 · 19 comments
Labels
bug Something isn't working fixed_in_dev This are fixed in dev branch but not yet pushed to Master.

Comments

@smkuehnhold
Copy link

When running a urxvt in client-server mode xwininfo | awk '/Window id:/{print $4}' | tr '[a-f]' '[A-F]' | pidswallow -t fails with bspc error for an invalid descriptor. Also interesting is that printing the cname of the client as found by the swallow function reveals the name of the daemon (urxvtd). I have no idea if this is expected or not

@Liupold
Copy link
Owner

Liupold commented Jul 23, 2020

add urxvtd to the swallowable var. (Refer adding terminal in README). and let me know if the issue persists. (you can just add a d at the end of urxvt.)

@Liupold
Copy link
Owner

Liupold commented Jul 23, 2020

Opps, I just tried that. It will not work

systemd(1)───urxvtd(128371)─┬─zsh(128646)
                            └─zsh(128809)

As the process will not split. There is no way to identify which child brought which window and which to hide. (Atleast with the current impl)

rohnch:~/$ xdotool search --pid 129750  
33554468
33554442

urxvtd will not work with this script. And I am not actively looking to implement this.
If you have any idea or want to add this feel free to do so.

@Liupold Liupold added bug Something isn't working wontfix This will not be worked on labels Jul 23, 2020
@smkuehnhold
Copy link
Author

smkuehnhold commented Jul 23, 2020

No, It'd have to be someone else ... or me in the not-so-near future (probably not). I appreciate the quick response. I wasn't sure if it was expected behavior (with an easy fix) and wanted to pass along an observation I had made. Now I know to look at alternative solutions or to make changes to my terminal emulator.

@Liupold
Copy link
Owner

Liupold commented Jul 23, 2020

I was looking into it urxvtd.
It seems around 30 MB less memory fro 100 terms. (for day to day usage 10-20 Terminals it will be very less. )

I don't know about your use case but using urxvt (non daemon) might not be terrible. (Just a suggestion).
Let this issue be open, if you found something that works. post here. Thanks a lot for reporting this issue.

@Liupold
Copy link
Owner

Liupold commented Aug 6, 2020

I am closing this as this issue is now pinned as #36.

@Liupold Liupold closed this as completed Aug 6, 2020
@Liupold Liupold removed the wontfix This will not be worked on label Aug 6, 2020
@Liupold
Copy link
Owner

Liupold commented Aug 6, 2020

@smkuehnhold

Try this script: https://github.com/Liupold/pidswallow/blob/daemon-fix/pidswallow.

  • Add this script to your path.
  • Launch with pidswallow -fgl
    * Add urxvtd (to swallowable)
    let me know if there is any issue (should work with urxvtd).

@Liupold Liupold reopened this Aug 6, 2020
@smkuehnhold
Copy link
Author

@smkuehnhold

Try this script: https://github.com/Liupold/pidswallow/blob/daemon-fix/pidswallow.

* Add this script to your path.

* Launch with `pidswallow -fgl`
  ~* Add urxvtd (to `swallowable`)~
  let me know if there is any issue (should work with urxvtd).

I'm glad progress has been made on this issue! I seem to have a couple of issues with the new script however. Sometimes the terminal is correctly swallowed and sometimes it is not. Also, sometimes when a terminal is swallowed, and it's child closed, the terminal remains hidden/is not vomited.

I am also seeing a couple of error messages.

  • cat: /tmp/pidswallow.pid: No such file or directory when first calling pidswallow -fgl after a reboot.
  • xev: unrecognized argument '-1' after opening a window from urxvtd

@Liupold
Copy link
Owner

Liupold commented Aug 6, 2020

This is not important. :

* `cat: /tmp/pidswallow.pid: No such file or directory` when first calling `pidswallow  -fgl` after a reboot.

But, this seems odd,
Try running: xev -root -1 (and see if this provide any error)

* `xev: unrecognized argument '-1'` after opening a window from urxvtd

It xev is causing problem you might want to drop -g from the pidswallow command.
try running pidswallow -fl.

@smkuehnhold
Copy link
Author

Try running: xev -root -1 (and see if this provide any error)

xev -root -1 does return the same error xev: unrecognized argument '-1'

It xev is causing problem you might want to drop -g from the pidswallow command.
try running pidswallow -fl

pidswallow -fl does remove the error message, but there seems to still be the same inconsistency with the swallowing.

@Liupold
Copy link
Owner

Liupold commented Aug 6, 2020

Try out the latest commit (same url).

@Liupold
Copy link
Owner

Liupold commented Aug 6, 2020

Try running: xev -root -1 (and see if this provide any error)

xev -root -1 does return the same error xev: unrecognized argument '-1'

https://gitlab.freedesktop.org/xorg/app/xev/-/commit/c51ca8f59ce5fff6b8c0705bd296460d8116cff2
(it's only in the new releases). Hope your repo will push that update soon.

@smkuehnhold
Copy link
Author

smkuehnhold commented Aug 6, 2020

Try out the latest commit (same url).

Still having the same issues. Here is a video for a quick sanity check.

Hope your repo will push that update soon.

Debian Stable 😢

@Liupold
Copy link
Owner

Liupold commented Aug 6, 2020

Thanks for reporting, I think you might wan't to kill the pidswallow from before runs.
Keep the term open.
use pidswallow -Vfl (logs) in a separate window instead of htop. And then try it.
are you using bspwm?

  • killall pidswallow; pidswallow -Vfl (Don't close / send to another workspace)
  • Test on the second term.

(It's working fine on my laptop, sorry about that)

Debian Stable 😢

xev -1 will be resolved shortly. (we will use xev without -1). Thanks a lot for the help.

@smkuehnhold
Copy link
Author

are you using bspwm?

Yes. bspwm 0.9.9 github

use pidswallow -Vfl (logs) in a separate window instead of htop

New video.

Output:

SWALLOWABLE: "   xterm konsole xfce4-terminal urxvtd  "
swallow - Scanning process tree of feh(7529): xdg-open:7461 bash:7440 urxvtd:3340 bspwm:3327 xinit:3322 startx:3298 login:3293 systemd:1
swallow - urxvtd(3340) detected as swallowable
swallow - 33554433 swallowing 0x00C000D0 using xdo hide {%pwid}
swallow - feh(33554433) swallowed urxvtd(0x00C000D0)
vomit - 33554433 vomiting 0x00C000D0 using xdo show {%pwid}
vomit - 33554433 vomited 0x00C000D0
swallow - Scanning process tree of feh(7675): xdg-open:7607 bash:7440 urxvtd:3340 bspwm:3327 xinit:3322 startx:3298 login:3293 systemd:1
swallow - urxvtd(3340) detected as swallowable
swallow - 33554433 swallowing 0x00C000D0 using xdo hide {%pwid}
swallow - feh(33554433) swallowed urxvtd(0x00C000D0)
vomit - 33554433 vomiting 0x00C000D0 using xdo show {%pwid}
vomit - 33554433 vomited 0x00C000D0
swallow - Scanning process tree of feh(7803): xdg-open:7735 bash:7440 urxvtd:3340 bspwm:3327 xinit:3322 startx:3298 login:3293 systemd:1
swallow - urxvtd(3340) detected as swallowable
swallow - 33554433 swallowing 0x00C000D0 using xdo hide {%pwid}
swallow - feh(33554433) swallowed urxvtd(0x00C000D0)
vomit - 33554433 vomiting 0x00C000D0 using xdo show {%pwid}
vomit - 33554433 vomited 0x00C000D0
swallow - Scanning process tree of feh(7957): xdg-open:7889 bash:7440 urxvtd:3340 bspwm:3327 xinit:3322 startx:3298 login:3293 systemd:1
swallow - urxvtd(3340) detected as swallowable
swallow - 33554433 swallowing 0x00C000D0 using xdo hide {%pwid}
swallow - feh(33554433) swallowed urxvtd(0x00C000D0)
vomit - 33554433 vomiting 0x00C000D0 using xdo show {%pwid}
vomit - 33554433 vomited 0x00C000D0
swallow - Scanning process tree of MainThread(5314): systemd:1

@Liupold
Copy link
Owner

Liupold commented Aug 6, 2020

I am thinking of something which will make this completely unnecessary. Need around a week at max. Thanks for your patience. using shell instead of terminal,

@Liupold Liupold mentioned this issue Aug 6, 2020
4 tasks
@Liupold
Copy link
Owner

Liupold commented Aug 6, 2020

@smkuehnhold
you might like this: https://github.com/Liupold/pidswallow/tree/shell-based/
(follow the instructions in readme of that branch).

@Liupold
Copy link
Owner

Liupold commented Aug 8, 2020

@smkuehnhold let me know if this is working or not.

@smkuehnhold
you might like this: https://github.com/Liupold/pidswallow/tree/shell-based/
(follow the instructions in readme of that branch).

@Liupold
Copy link
Owner

Liupold commented Aug 12, 2020

This will be closed when dev is merged to master. It's all seems to work at our end.
If you want you can now try out the dev branch. And let me know about any issue.

@Liupold Liupold added the fixed_in_dev This are fixed in dev branch but not yet pushed to Master. label Aug 12, 2020
@Liupold
Copy link
Owner

Liupold commented Aug 18, 2020

Fixed: 40104a9

@Liupold Liupold closed this as completed Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed_in_dev This are fixed in dev branch but not yet pushed to Master.
Projects
None yet
Development

No branches or pull requests

2 participants