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

user-defined signal 1 #4

Closed
apprehensions opened this issue Oct 13, 2021 · 9 comments
Closed

user-defined signal 1 #4

apprehensions opened this issue Oct 13, 2021 · 9 comments

Comments

@apprehensions
Copy link

clicking on statusbar/module makes dwmblocks-async crash with code 138 output:
user-defined signal 1 dwmblocks

this happens when used with my modified dwm build + default dwm only patched with dwm-statuscmd-status

@apprehensions
Copy link
Author

statuscmd patch i used included sending a SIGUSR1, the main statuscmd patch sends a SIGRTMIN, however dwmblocks-async only accepts SIGRTMIN.

@Pyxels
Copy link

Pyxels commented Oct 13, 2021

I have had the same problem, where you able to fix it by just applying the other patch or do I have to completely redo dwm?

@UtkarshVerma
Copy link
Owner

UtkarshVerma commented Oct 13, 2021

Ah, I made a minor typo.😅
This is happening because I encoded the block index in the output rather than the signal.
That's why clicking on the second block is sending signal 1 to dwmblocks, which kills it as it is not handled.
Let me fix this up real quick.

As pointed by wael, this is because dwmblocks-async doesn't handle SIGUSR1. You'll need to patch dwm for handling this. dwm-flexipatch does mention something about this.

You basically update this function in dwm source.
https://github.com/bakkeby/dwm-flexipatch/blob/master/patch/bar_dwmblocks.c#L29

@apprehensions
Copy link
Author

apprehensions commented Oct 13, 2021

@Pyxels all i had to do was change

sigqueue(dwmblockspid, SIGUSR1, sv);

to

sigqueue(dwmblockspid, SIGRTMIN+dwmblockssig, sv);

temporary soluton

@Pyxels
Copy link

Pyxels commented Oct 13, 2021

Thanks that fixed the crashing bug.
Though now every click is counted as two, do you have the same problem?

@apprehensions
Copy link
Author

Thanks that fixed the crashing bug. Though now every click is counted as two, do you have the same problem?

no, but can i have the script used so i can see if i can produce the same problem?

note the fix above is only a temporary solution.

@Pyxels
Copy link

Pyxels commented Oct 13, 2021

#!/bin/sh

case $BLOCK_BUTTON in
        1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
        2) setsid -f "$TERMINAL" -e bpytop ;;
        3) notify-send "🖥 CPU module " "\- Shows CPU temperature.
- Click to show intensive processes.
- Middle click to open bpytop." ;;
        6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

sensors | awk '/Core 0/ {print "🌡" $3}'

This for example.
Im also having issues with the ordering of the blocks. I created a new issue for that (#5)
But don't waste too much time on it, I can look into it later by myself or just use the older version which worked fine for me.

@UtkarshVerma
Copy link
Owner

This is not a bug. dwmblocks-async assumes you've patched dwm with the statuscmd patch, as mentioned in the README, which doesn't depend on SIGUSR1. Therefore it doesn't handle SIGUSR1, which causes it to die when some process sends it that signal.

Simple solution for this is to patch dwm with the latest statuscmd patch, which doesn't use SIGUSR1.

@apprehensions
Copy link
Author

is there a reason to use SIGRTMIN over SIGUSR1? currently rebuilding my whole dwm build just to fix this really dumb location issue, i tried to move around the update signals and it didn't help.

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

No branches or pull requests

3 participants