Linux Lite Forums

General => Security & Bug Fixes => Topic started by: trinidad on November 08, 2016, 12:14:59 PM

Title: Widget Quirk
Post by: trinidad on November 08, 2016, 12:14:59 PM
Interesting little quirk in the behavior of the new widget. When I open up XFCE4 terminal, Logged in as: reads trinidadtrinidad in the widget. When I exit the terminal it reverts back to the single entry - trinidad. Does not do this with LX terminal, or ROX terminal, only XFCE4 terminal. Not sure why yet.

Wow just tried it again, opened three XFCE4 terminals and got: trinidadtrinidadtrinidadtrinidad.

Also does it with UX terminal, and X terminal. Tried changing defaults but makes no difference.

TC
Title: Re: Widget Quirk
Post by: unclebaldie on November 08, 2016, 01:39:54 PM
Yep, same thing happens on my Conky/widget.


Had me worried for a while, until I figured out that the widget displays 'users' (plural) and opening a terminal is another 'user' access, or something like that - I'm sure that someone else has a more elegant explanation! I am happy to be corrected (only by mistakes do we learn).


HTH
Phil

Title: Re: Widget Quirk
Post by: trinidad on November 08, 2016, 03:30:46 PM
This is going to be an issue for me as it adds the user for new tabs as well, six tabs, six users. I prefer the XFCE terminal on my client desktops because of the customizations it allows, but I like the new highly visible widget as well. I want both to work so I'm searching now for the cause. As I said before this does not occur with LXterm, or ROXterm but I do not want to use them on my client boxes.

TC
Title: Re: Widget Quirk
Post by: unclebaldie on November 08, 2016, 04:45:05 PM
@TC,

Don't know if this helps.
There is an environment variable set named $USER.
In the ~/.conky/widget, there is a line, towards the bottom of the file:

${color}Logged in as:   ${alignr}${color}${user_names}

I edited the line as follows (alteration in red);

${color}Logged in as:   ${alignr}${color}$USER

It now displays my username, and opening an XFCE4-terminal does not add the name again.
It seems to have fixed that problem, but maybe others can advise if this will have any adverse effect ?


HTH,
Phil

Title: Re: Widget Quirk
Post by: trinidad on November 09, 2016, 05:19:07 AM
Yep. I should have noticed that. The brackets would allow for notifications of logins of root, which of course doesn't happen in Ubuntu setup to use sudoers, and not su root like Debian in the terminal. Easy to miss. Thanks. It's a safe change. Fixed just fine for me. All my clients will be single users. I'll test it tomorrow on a multi user desktop.

TC
Title: Re: Widget Quirk
Post by: Jerry on November 23, 2016, 09:03:20 PM
Upon reflection, I'm going to go with $USER in the next Lite Widget. Have you tested this yet tc (multi users)?
Title: Re: Widget Quirk
Post by: trinidad on November 24, 2016, 10:22:09 AM
I have tried a variety of scripts with conditionals, attempting to get the {user_name} to display root when sudo is used. $USER will only display the user name logged in from lightdm login. I intend to fix this. When the terminal goes to sudo I want Conky to change the name to root or sudo, or at least add a warning message. I think the {uid_name} function might do this with an {if_match} conditional but I haven't got it working yet. It is definitely in the works for me though. May have to root the whole widget with user permission to enable on/off. As you know this is problematic with "ioctl" error reporting in root, which is not a good fix because every ssh and bashrc config file has to match with root. Ubuntu thing.

TC