Issue with the logout function in the powermenu.sh script shipped with worm

There is an error in the powermenu.sh script with worm that is called from the power button in the default tint2 panel.

The command executed by the pwermenu script for logout is:

pkill -u user

And it should be:

pkill -u $USER

I have a patch that I can post if required.

It looks like it has already been changed in the latest version:

Can’t see the fix…

Unfortunately, this is the patch that created the issue. but thanks for pointing me to it, I’ll see if I cant create a fork request.

2 Likes

LOL…yeah, because it is the opposite…

That is where the issue was created.

1 Like

BTW, should it be $LOGNAME instead of $USER ??

1 Like

I’ve never used the $LOGNAME as I didn’t think it was standard enough to script against. But in all the examples I checked, $LOGNAME is set, and set the same as $USER. IF this is ALWAYS true, then I don’t see why it wouldn’t work. But I’m not familiar enough with this variable and why it exists to depend on it.

1 Like

I think they are not always the same. Just can’t remember when… :wink:

But I guess $USER is a good choice. Worm dev @codic12 should check this.

1 Like

Thanks for pointing this out. It seems that $USER is usually set but might not be depending on how you start your session. After doing some research, it seems the portable (posix compliant) way is to spawn a subshell running id -u -n, and I like to stay posix compliant :wink:

Should fix it: https://github.com/EndeavourOS-Community-Editions/worm/commit/e3f73e7d27b1ab67c2bba00fba7781f06446088d

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.