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

copyq fails to create a tray icon from a root script [solved] #2155

Closed
DoctorSubtilis opened this issue Oct 28, 2022 · 9 comments
Closed

copyq fails to create a tray icon from a root script [solved] #2155

DoctorSubtilis opened this issue Oct 28, 2022 · 9 comments
Labels

Comments

@DoctorSubtilis
Copy link

DoctorSubtilis commented Oct 28, 2022

Describe the bug
I have the correct icon tray starting copyq as user, but starting copyq as user from a root script (sudo -u myuser ...) I cannot get the icon tray (even the server starts).

To Reproduce
Steps to reproduce the behavior:

  1. Exit from copyq
  2. Start copyq with the command 'sudo -u myuser env QT_QPA_PLATFORM=xcb copyq --start-server show'
  3. You get the server working and the main window shown, but no tray icon

Expected behavior
Tray icon visible

Screenshots
If applicable, add screenshots to help explain your problem.

Version, OS and Environment
copyq --version
CopyQ Clipboard Manager 6.0.1
Qt: 5.15.2
KNotifications: 5.89.0
Compiler: GCC
Arch: x86_64-little_endian-lp64
OS: KDE neon 5.26

Additional context
Add any other context about the problem here.

@DoctorSubtilis
Copy link
Author

Updating to the last release (6.3.2) not fixed the icon tray problem

@hluk
Copy link
Owner

hluk commented Oct 31, 2022

I think KDE may hide icons by default. Can you configure visibility by right clicking on tray area and selecting "Configure System Tray..."?

image

image

@DoctorSubtilis
Copy link
Author

I had already tried this, but nothing to do. As I have said, the tray icon is correctly shown when I start copyq as user. The problem raises only when I start copyq from a root script. And this is why I have opened a new thread.
Thank you.

@hluk
Copy link
Owner

hluk commented Nov 1, 2022

I don't know what is the difference between sudo -u USER and running app without sudo - possibly some missing env variables.

Anyway, in this case the problems is not in the application itself but in the non-standard way it's being started. Not sure how much I can help here.

@hluk hluk closed this as completed Nov 1, 2022
@DoctorSubtilis
Copy link
Author

DoctorSubtilis commented Nov 1, 2022

The reason to use that "strange" code is that I need sudo to close and open mariadb before (and after) syncing my files, and so I need (/it is better) to close and restart copyq within a script executed as root, but at the same time a need my copyq (as user) and not a copyq of root.

@hluk
Copy link
Owner

hluk commented Nov 1, 2022

Actually, since this affects tray/notification area which uses D-Bus, I think you may need to override DBUS_SESSION_BUS_ADDRESS environment variable (with the value from user's env).

@DoctorSubtilis
Copy link
Author

Thank you: could you suggest me what code I should use? This doesn't work:

sudo -u myuser env DBUS_SESSION_BUS_ADDRESS=xcb copyq --start-server show
I mean: the server start and the main window appears, but no tray icon.

@hluk
Copy link
Owner

hluk commented Nov 2, 2022

Please see the real value for DBUS_SESSION_BUS_ADDRESS in your desktop environment. It is possibly something like unix:path=/run/user/1000/bus.

@DoctorSubtilis
Copy link
Author

DoctorSubtilis commented Nov 2, 2022

It works! Thank you!!
Some few other attempts and I will put resolved!

EDIT

Yes, it works!!!
Thank you.
You can close this thread.

@DoctorSubtilis DoctorSubtilis changed the title copyq fails to create a tray icon from a root script copyq fails to create a tray icon from a root script [solved] Nov 2, 2022
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