Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
4
votes
1
answers
2269
views
qmlscene can't find Qt installation even though qtchooser lists versions
I'm running this in a folder with `main.qml`: ```shell $ qmlscene main.qml qmlscene: could not find a Qt installation of '' ``` Then I checked ```shell $ qtchooser -list-versions 4 5 qt4-x86_64-linux-gnu qt4 qt5-x86_64-linux-gnu qt5 ``` ... and tried ```shell $ sudo qmlscene -qt=qt5-x86_64_linux-gnu...
I'm running this in a folder with
main.qml
:
$ qmlscene main.qml
qmlscene: could not find a Qt installation of ''
Then I checked
$ qtchooser -list-versions
4
5
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5
... and tried
$ sudo qmlscene -qt=qt5-x86_64_linux-gnu main.qml
qmlscene: could not find a Qt installation of 'qt5-x86_64_linux-gnu'
user304200
(41 rep)
Aug 7, 2018, 02:26 PM
• Last activity: Aug 7, 2025, 10:06 AM
2
votes
2
answers
3600
views
How do I downgrade a whole group of packages with pacman?
I need an old version of qt5 for anki. (qt5-5.7) Therefore I would like to downgrade all qt5-packages (the whole group). Is there a way to do this with pacman?
I need an old version of qt5 for anki. (qt5-5.7)
Therefore I would like to downgrade all qt5-packages (the whole group).
Is there a way to do this with pacman?
linuscl
(550 rep)
Mar 10, 2017, 03:46 PM
• Last activity: Jul 11, 2025, 12:09 PM
4
votes
1
answers
4287
views
Buildroot OpenGL Capable Backend
I'm trying to configure QT 5 through buildroot and some options are not available with the message `requires an OpenGL-capable backend`. I'm using buildroot 2013.08-rc1 but the same message comes up with 2013.05. I'm targeting x86_64 core2 platform and I can't find any options to select OpenGL backe...
I'm trying to configure QT 5 through buildroot and some options are not available with the message
requires an OpenGL-capable backend
. I'm using buildroot 2013.08-rc1 but the same message comes up with 2013.05.
I'm targeting x86_64 core2 platform and I can't find any options to select OpenGL backend (or OpenGL anything actually).
How can I enable OpenGL backend in buildroot?
Kristina
(751 rep)
Aug 6, 2013, 02:58 PM
• Last activity: Jul 8, 2025, 06:00 PM
0
votes
0
answers
34
views
QT applications segfault under WAYLAND in GNOME
I cannot launch any QT application from gnome-shell because they segfault. e.g. `torbrowser-launcher` ``` Jun 28 12:25:43 arch-xps systemd[1452]: Started Application launched by gnome-shell. Jun 28 12:25:43 arch-xps python[4287]: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFO...
I cannot launch any QT application from gnome-shell because they segfault.
e.g.
torbrowser-launcher
Jun 28 12:25:43 arch-xps systemd: Started Application launched by gnome-shell.
Jun 28 12:25:43 arch-xps python: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Jun 28 12:25:43 arch-xps python: qt.qpa.xcb: could not connect to display
Jun 28 12:25:43 arch-xps python: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Jun 28 12:25:43 arch-xps python: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Jun 28 12:25:43 arch-xps systemd-coredump: Process 4287 (torbrowser-laun) of user 1000 terminated abnormally with signal 6/ABRT, processing...
Jun 28 12:25:43 arch-xps systemd[1] : Created slice Slice /system/systemd-coredump.
Jun 28 12:25:43 arch-xps systemd[1] : Started Process Core Dump (PID 4303/UID 0).
Jun 28 12:25:43 arch-xps systemd-coredump: [🡕] Process 4287 (torbrowser-laun) of user 1000 dumped core.
Stack trace of thread 4287:
#0 0x00007f33c34a774c n/a (libc.so.6 + 0x9774c)
#1 0x00007f33c344ddc0 raise (libc.so.6 + 0x3ddc0)
#2 0x00007f33c343557a abort (libc.so.6 + 0x2557a)
#3 0x00007f33c22982e0 _ZNK14QMessageLogger5fatalEPKcz (libQt5Core.so.5 + 0x982e0)
#4 0x00007f33be1368c6 _ZN22QGuiApplicationPrivate25createPlatformIntegrationEv (libQt5Gui.so.5 + 0x1368c6)
#5 0x00007f33be136f99 _ZN22QGuiApplicationPrivate21createEventDispatcherEv (libQt5Gui.so.5 + 0x136f99)
#6 0x00007f33c24c9525 _ZN23QCoreApplicationPrivate4initEv (libQt5Core.so.5 + 0x2c9525)
#7 0x00007f33be13704e _ZN22QGuiApplicationPrivate4initEv (libQt5Gui.so.5 + 0x13704e)
#8 0x00007f33be954d36 _ZN19QApplicationPrivate4initEv (libQt5Widgets.so.5 + 0x154d36)
#9 0x00007f33bf2d9133 n/a (QtWidgets.abi3.so + 0x2d9133)
#10 0x00007f33c2c60af7 n/a (sip.cpython-313-x86_64-linux-gnu.so + 0x1aaf7)
#11 0x00007f33c3863250 n/a (libpython3.13.so.1.0 + 0x263250)
#12 0x00007f33c37dbc83 n/a (libpython3.13.so.1.0 + 0x1dbc83)
#13 0x00007f33c3760e3b _PyObject_MakeTpCall (libpython3.13.so.1.0 + 0x160e3b)
#14 0x00007f33c37752be _PyEval_EvalFrameDefault (libpython3.13.so.1.0 + 0x1752be)
#15 0x00007f33c37a8dda n/a (libpython3.13.so.1.0 + 0x1a8dda)
#16 0x00007f33c3760d9d _PyObject_MakeTpCall (libpython3.13.so.1.0 + 0x160d9d)
#17 0x00007f33c37752be _PyEval_EvalFrameDefault (libpython3.13.so.1.0 + 0x1752be)
#18 0x00007f33c384c8b9 PyEval_EvalCode (libpython3.13.so.1.0 + 0x24c8b9)
#19 0x00007f33c388af5c n/a (libpython3.13.so.1.0 + 0x28af5c)
#20 0x00007f33c388801b n/a (libpython3.13.so.1.0 + 0x28801b)
#21 0x00007f33c3885718 n/a (libpython3.13.so.1.0 + 0x285718)
#22 0x00007f33c38849d2 n/a (libpython3.13.so.1.0 + 0x2849d2)
#23 0x00007f33c3884343 n/a (libpython3.13.so.1.0 + 0x284343)
#24 0x00007f33c388248b Py_RunMain (libpython3.13.so.1.0 + 0x28248b)
#25 0x00007f33c3839dcb Py_BytesMain (libpython3.13.so.1.0 + 0x239dcb)
#26 0x00007f33c34376b5 n/a (libc.so.6 + 0x276b5)
#27 0x00007f33c3437769 __libc_start_main (libc.so.6 + 0x27769)
#28 0x0000564d96d2a045 _start (/usr/bin/python3.13 + 0x1045)
Stack trace of thread 4302:
#0 0x00007f33c34ade22 n/a (libc.so.6 + 0x9de22)
#1 0x00007f33c34a1fda n/a (libc.so.6 + 0x91fda)
#2 0x00007f33c34a2024 n/a (libc.so.6 + 0x92024)
#3 0x00007f33c351c5a6 ppoll (libc.so.6 + 0x10c5a6)
#4 0x00007f33c1909e04 n/a (libglib-2.0.so.0 + 0x5fe04)
#5 0x00007f33c1909ee5 g_main_context_iteration (libglib-2.0.so.0 + 0x5fee5)
#6 0x00007f33c2521489 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x321489)
#7 0x00007f33c24c807b _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2c807b)
#8 0x00007f33c22f531b _ZN7QThread4execEv (libQt5Core.so.5 + 0xf531b)
#9 0x00007f33bc8f4d2e n/a (libQt5DBus.so.5 + 0x17d2e)
#10 0x00007f33c22f1859 n/a (libQt5Core.so.5 + 0xf1859)
#11 0x00007f33c34a57eb n/a (libc.so.6 + 0x957eb)
#12 0x00007f33c352918c n/a (libc.so.6 + 0x11918c)
ELF object binary architecture: AMD x86-64
while launching it from terminal, it starts successfully! and I get:
$ torbrowser-launcher
Tor Browser Launcher
By Micah Lee & Tor Project, licensed under MIT
version 0.3.7
https://gitlab.torproject.org/tpo/applications/torbrowser-launcher/
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Launching Tor Browser.
Running /home/mattia/.local/share/torbrowser/tbb/x86_64/tor-browser/start-tor-browser.desktop
Launching './Browser/start-tor-browser --detach'...
same happens with picard
, torbrowser
or masterpdfeditor
instead GPXSee
starts fine!
It looks like **gnome-shell** ignores customized variable **QT_QPA_PLATFORM** (which I defined in *.bashrc*),
so I tried launching torbrowser
forcing that variable as empty, and it segfaults, as well:
$ QT_QPA_PLATFORM= torbrowser-launcher
Tor Browser Launcher
By Micah Lee & Tor Project, licensed under MIT
version 0.3.7
https://gitlab.torproject.org/tpo/applications/torbrowser-launcher/
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aborted (core dumped)
Any help is welcome!
**EDIT-1:** system does not have XWayland, or better, I disabled it from gnome-shell[[1] ];
---
Arch Linux, GNOME 48 under Wayland, qt{5,6}-wayland packages installed
mattia.b89
(3398 rep)
Jun 28, 2025, 10:41 AM
• Last activity: Jul 6, 2025, 05:39 PM
4
votes
1
answers
197
views
How does BusCtl compare to QDBus?
`busctl` is from `systemd`, whereas `dbus-qt6` (and `dbus`) are from `qt6-qttools`. These are very different projects, yet these tools perform the same purpose. Considering that both are fundamentally necessary to have installed at the same time as a user of a SystemD-based Linux distribution (Fedor...
busctl
is from systemd
, whereas dbus-qt6
(and dbus
) are from qt6-qttools
. These are very different projects, yet these tools perform the same purpose. Considering that both are fundamentally necessary to have installed at the same time as a user of a SystemD-based Linux distribution (Fedora) and Qt-based DE (KDE Plasma), which should I utilise, and when?
If an example is necessary, consider:
1. busctl --user call org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver Lock
1. qdbus-qt6 org.freedesktop.ScreenSaver /ScreenSaver Lock
RokeJulianLockhart
(541 rep)
Jul 4, 2025, 01:51 PM
• Last activity: Jul 4, 2025, 05:23 PM
0
votes
0
answers
21
views
VLC Not Adhering to Theme Correctly (KDE Plasma/Kvantum)
This theme (Gently) used to make the highlighted areas of VLC in the image below transparent, now it doesn't. Other applications are working fine (Kate, Dolphin, plasmoids, menus). I've been playing around in InkScape for hours but no changes https://i.imgur.com/AfEG4Xc.png
This theme (Gently) used to make the highlighted areas of VLC in the image below transparent, now it doesn't. Other applications are working fine (Kate, Dolphin, plasmoids, menus). I've been playing around in InkScape for hours but no changes

ToneyFox
(1 rep)
Jun 29, 2025, 12:45 PM
5
votes
1
answers
2351
views
Is there a way to set the QT icon theme, and other theme elements, from the command line?
I'm trying to automate the process of theming QT5 programs, in the absence of a DE like KDE, by writing a script that does it. I know that GTK has a bunch of config files that can specify all the aspects of a theme, but what's the equivalent for QT5? So far, I've found out that I can set `QT_THEME_O...
I'm trying to automate the process of theming QT5 programs, in the absence of a DE like KDE, by writing a script that does it. I know that GTK has a bunch of config files that can specify all the aspects of a theme, but what's the equivalent for QT5?
So far, I've found out that I can set
QT_THEME_OVERRIDE
to set the theme, and XCURSOR_THEME
to set the cursor theme (QT5 appears to respect this). But what about the icon theme and everything else?
I've also seen [this Arch Wiki section](https://wiki.archlinux.org/index.php/qt#Configuration_of_Qt5_apps_under_environments_other_than_KDE_Plasma) about a similar issue, and a few other questions that suggest using the graphical configurator qt5ct
, but I'm really trying to write something that makes this change, rather than have a configurator do it, so that I don't have to repeat this process if I replicate my system install somewhere else.
(This is so I can write a .nix expression for home-manager that can handle qt5 theming declaratively, but that's beside the point.)
Jonathan
(1330 rep)
Aug 21, 2018, 06:40 PM
• Last activity: Jun 7, 2025, 04:05 AM
0
votes
1
answers
35
views
Reset Python and QT5 installation for programming GUI in Python-QT
This questions was thrown out from there: https://stackoverflow.com/questions/79655756/reset-python-and-qt-installation-for-programming-in-python-qt Because off-topic This, when trying to use *pycrypto*: warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. src/MD2.c:31:10...
This questions was thrown out from there: https://stackoverflow.com/questions/79655756/reset-python-and-qt-installation-for-programming-in-python-qt
Because off-topic
This, when trying to use *pycrypto*:
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
src/MD2.c:31:10: fatal error: Python.h: No such file or directory
31 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycrypto
Failed to build pycrypto
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pycrypto)
And also this:
File "/usr/lib/python3/dist-packages/cola/hotkeys.py", line 12, in
STAGE_MODIFIED = hotkey(Qt.ALT + Qt.Key_A)
TypeError: unsupported operand type(s) for +: 'Modifier' and 'Key'
are two of the stuff which doesn't work anymore. A lot of other libs can't be installed or updated anymore.
I did
apt install git-cola
a long time before and everything was well.
I tried to set up a qt-development environment, but installed some libs as sudo. I ignored warnings about installing as sudo :-( Tried to apt-remove qt...
and reinstall Tried apt remove git-cola /purge /install
again and again with different pip remove/install
It seems, as I mixed up a lot of python and qt stuff.
Please help me, to get git-cola and qt running again.
More info: Linux .. 6.8.0-60-generic #63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22 19:00:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Edit: I ignored this message:
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv . Use the --root-user-action option if you know what you are doing and want to suppress this warning.
And I will do no more. I used venv sometimes before, and will use it more often, now.
rundekugel
(321 rep)
Jun 6, 2025, 04:21 PM
• Last activity: Jun 6, 2025, 04:36 PM
0
votes
1
answers
2490
views
CloudCompare fails to launch with error: “QXcbConnection: Could not connect to display :0”
In the last week, CloudCompare has suddenly stopped launching. When trying to launch via desktop icon, nothing happens. When trying to launch via commandline (e.g. `$ cloudcompare.CloudCompare`) nothing happens and I get the following error: QXcbConnection: Could not connect to display :0 Aborted (c...
In the last week, CloudCompare has suddenly stopped launching. When trying to launch via desktop icon, nothing happens. When trying to launch via commandline (e.g.
$ cloudcompare.CloudCompare
) nothing happens and I get the following error:
QXcbConnection: Could not connect to display :0
Aborted (core dumped)
Trying to launch CloudCompare with sudo
/as root user returns a slightly different error message:
mkdir: cannot create directory '/run/user/0': Permission denied
QXcbConnection: Could not connect to display :0
Having looked around Github, here and various other forums, this seems to be a problem that people have encountered with other programs that use Qt and/or OpenGL (see 1 , 2 , 3 ). I also realise that this isn't really enough information to debug the problem, so if there is any other diagnostic info I can/should provide, let me know and I will add it.
My Environment
--------------
- **OS & Version:** Ubuntu 14.04 LTS
- **CC Version:** v2.8.1 (latest)
- **Graphics card:** Intel Haswell Mobile
- **Qt version:** 5.2.1
Matt
(31 rep)
Nov 3, 2017, 12:26 AM
• Last activity: May 27, 2025, 04:04 PM
0
votes
1
answers
3085
views
How to properly set QT_STYLE_OVERRIDE env var in GNOME on NixOS?
I have a question about theming for Qt apps on Gnome. I'm running NixOS with Gnome, using Home Manager and Flakes. My theme is Adwaita-dark, but I've noticed that some Qt apps such as VLC do not have a dark theme applied. I tried tweaking all `qt` related settings in `home.nix`, but it didn't work....
I have a question about theming for Qt apps on Gnome.
I'm running NixOS with Gnome, using Home Manager and Flakes. My theme is Adwaita-dark, but I've noticed that some Qt apps such as VLC do not have a dark theme applied.
I tried tweaking all
qt
related settings in home.nix
, but it didn't work.
I got a clue to what the issue was when I ran qt5ct
and it showed this message:
Please remove the QT_STYLE_OVERRIDE environment variable (current value: adwaita).
The QT_QPA_PLATFORMTHEME environment variable is not set correctly (current value: gnome, required value: qt5ct).
I finally found a workaround by adding the following to configuration.nix
:
environment.variables = {
"QT_STYLE_OVERRIDE" = pkgs.lib.mkForce "adwaita-dark";
};
And now it works, Qt apps have the dark theme.
However, this feels like a messy hack and I'd like to understand how to do it properly, if possible. Has anyone dealt with this before?
user22311319
(1 rep)
Jul 30, 2023, 11:23 PM
• Last activity: May 18, 2025, 01:03 PM
0
votes
0
answers
25
views
Jupyter QtConsole GUI window ignores configured width and height
Below, two `qtconsole` instances, the first uses a font size of 14 pts, the second a font size of 12 pt — both use a width of 81 characters, [![two instances of qtconsole][1]][1] As you can see, the actual widths in characters is quite different, and however it is not 81, while the width in pixels i...
Below, two
qtconsole
instances, the first uses a font size of 14 pts, the second a font size of 12 pt — both use a width of 81 characters,
![two instances of qtconsole ][1]
As you can see, the actual widths in characters is quite different, and however it is not 81, while the width in pixels is approximately the same (the 12pt one is slightly narrower).
Also (no picture for this…) the pixel height of the windows is exactly the same, so at least one of the instances has a height that differs from the 25 lines I have requested in the config file.
Is this behaviour what is intended, is it a bug or have I misundertood everything?
Is it possible to force a specific width/height in characters/lines for this QT application?
---
Here is my ~/.jupyter/jupyter_qtconsole_config.py
c = get_config()
c.JupyterWidget.font_size = 12; # it was 14 when I started the 1st instance
c.JupyterWidget.console_width = 81;
c.JupyterWidget.console_height = 25;
c.JupyterWidget.font_family = "Cascadia Code";
c.JupyterWidget.syntax_style = "fruity";
gboffi
(1376 rep)
Apr 29, 2025, 11:16 AM
• Last activity: Apr 29, 2025, 07:02 PM
0
votes
1
answers
2155
views
trying to find qt4 libraries on centos7
I am installing the default QT on the base yum repos (version 4: `sudo yum qt qt-devel`. I can see that it includes the bin (in `/usr/lib64/qt4/bin`) and the includes (in `/usr/include/Qt` , `/usr/include/QtCore`). I am not sure where the lib files are, or if they are named in the same format as the...
I am installing the default QT on the base yum repos (version 4:
sudo yum qt qt-devel
. I can see that it includes the bin (in /usr/lib64/qt4/bin
) and the includes (in /usr/include/Qt
, /usr/include/QtCore
). I am not sure where the lib files are, or if they are named in the same format as the qt3 lib directory (/usr/lib64/qt-3.3/lib/libqt-mt.so.3
). Are these files in the same naming convention i.e. libqt-mt.so.4
, or what would I be looking for here?
basil
(153 rep)
Jan 21, 2020, 04:58 PM
• Last activity: Apr 26, 2025, 03:04 AM
0
votes
1
answers
2373
views
upgrade qt 5.6 to 5.9 in centos 7
CentOS 7 ships with Qt 5.6, is there a way of upgrading to Qt 5.9?. current version. QMake version 3.0 Using Qt version 5.6.2 in /usr/lib64 I dont want to install Qt from [qt.io][1], as I am not going to develop applications, the application I'm trying to run requires `QtQuick version 2.9` which is...
CentOS 7 ships with Qt 5.6, is there a way of upgrading to Qt 5.9?.
current version.
QMake version 3.0
Using Qt version 5.6.2 in /usr/lib64
I dont want to install Qt from qt.io , as I am not going to develop applications, the application I'm trying to run requires
QtQuick version 2.9
which is available in Qt 5.9.
Junius L
(71 rep)
Jan 1, 2018, 01:16 PM
• Last activity: Apr 21, 2025, 11:03 PM
0
votes
1
answers
163
views
Debian Sid, legacy nvidia 340.108 driver ruins running Qt software
Debian Sid. With nouveau all working good. But after installing legacy 340.108 nvidia driver for my gf9800 i have Segmentation Fault at launching all Qt GUI software. And opposite, Qt works again after uninstalling nvidia driver. But very strange that if i run Qt soft via debugging tools such gdb or...
Debian Sid.
With nouveau all working good. But after installing legacy 340.108 nvidia driver for my gf9800 i have Segmentation Fault at launching all Qt GUI software. And opposite, Qt works again after uninstalling nvidia driver.
But very strange that if i run Qt soft via debugging tools such gdb or strace i have no errors.
and 2048-Qt
Only one Qt application starting normally - CMake GUI and Audacious Qt theme
Segmentation fault
gdb ./doomseeker
strace ./doomseeker
Same is with Qbittorrent


#include
int main(int argc, char **argv)
{
QApplication app(argc, argv);
return 0;
}
Is where any solution to fix this?
Alexander Procenko
(1 rep)
Feb 11, 2023, 12:42 PM
• Last activity: Apr 19, 2025, 10:18 PM
0
votes
1
answers
13890
views
xhost: unable to open display "desktop:0"
UPDATE 1: I am not using SSH. I am using a local machine. UPDATE 2: I restarted the X and notice that the Xauthority file that I am exporting to is actually being updated: $ sudo systemctl restart display-manager $ ls /run/user/1000/gdm/Xauthority* -rwx------ 1 mona mona 96 Jan 25 16:07 /run/user/10...
UPDATE 1: I am not using SSH. I am using a local machine.
UPDATE 2: I restarted the X and notice that the Xauthority file that I am exporting to is actually being updated:
$ sudo systemctl restart display-manager
$ ls /run/user/1000/gdm/Xauthority*
-rwx------ 1 mona mona 96 Jan 25 16:07 /run/user/1000/gdm/Xauthority
Also, after I restarted the X, the other two Xauthority files, namely
/run/user/1000/gdm/Xauthority-c
and /run/user/1000/gdm/Xauthority-l
, are gone as can be seen below:
$ fd Xauthority /
/run/user/1000/gdm/Xauthority
and I can call xauth after reboot:
$ xauth
Using authority file /run/user/1000/gdm/Xauthority
xauth>
Following https://unix.stackexchange.com/questions/199891/invalid-mit-magic-cookie-1-key-when-trying-to-run-program-remotely I tried:
[9080:9072 0:2035] 02:14:50 Mon Jan 25 [mona@goku:pts/0 +1] ~/research/code/vision/integration
$ export DISPLAY=desktop:0
18838/31772MB(vision)
and then:
$ xhost +local:
xhost: unable to open display "desktop:0"
how could I fix this problem?
$ lsb_release -a
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
Another similar example:
$ xclock
Error: Can't open display: desktop:0
More details:
$ xclock
Error: Can't open display: desktop:0
27296/31772MB
[3266:3258 3:2008] 02:54:16 Mon Jan 25 [mona@goku:pts/0 +1] ~
$ export DISPLAY=":0.0"
26016/31772MB
[3266:3258 3:2009] 02:57:24 Mon Jan 25 [mona@goku:pts/0 +1] ~
$ xclock
Invalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: :0.0
$ export DISPLAY=":0"
26238/31772MB
[3266:3258 3:2011] 02:57:40 Mon Jan 25 [mona@goku:pts/0 +1] ~
$ xclock
Invalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: :0
$ xhost +mona
Invalid MIT-MAGIC-COOKIE-1 keyxhost: unable to open display ":0"
$ firefox
Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused
Error: cannot open display: :0
$ xclock
Invalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: :0
25694/31772MB
[3266:3258 3:2026] 03:04:35 Mon Jan 25 [mona@goku:pts/0 +1] ~
$ export DISPLAY=desktop:0
25694/31772MB
[3266:3258 3:2027] 03:04:49 Mon Jan 25 [mona@goku:pts/0 +1] ~
$ xclock
Error: Can't open display: desktop:0
Also, I am having weird characters in Xauthority file:
$ xrandr | nc termbin.com 9999
Invalid MIT-MAGIC-COOKIE-1 keyCan't open display :0
21618/31772MB
[9136:3258 0:2002] 03:49:16 Mon Jan 25 [mona@goku:pts/2 +1] ~
$ fd Xauthority /
/run/user/1000/gdm/Xauthority
/run/user/1000/gdm/Xauthority-c
/run/user/1000/gdm/Xauthority-l
22048/31772MB
[9136:3258 0:2003] 03:51:26 Mon Jan 25 [mona@goku:pts/2 +1] ~
$ cat /run/user/1000/gdm/Xauthority-c
22048/31772MB
[9136:3258 0:2004] 03:51:49 Mon Jan 25 [mona@goku:pts/2 +1] ~
$ cat /run/user/1000/gdm/Xauthority-l
22081/31772MB
[9136:3258 0:2005] 03:51:58 Mon Jan 25 [mona@goku:pts/2 +1] ~
$ cat /run/user/1000/gdm/Xauthority
gokuMIT-MAGIC-COOKIE-1R��9��s{�H��H�l��gokuMIT-MAGIC-COOKIE-1R��9��s{�H��H�l22081/31772MB
[9136:3258 0:2006] 03:52:03 Mon Jan 25 [mona@goku:pts/2 +1] ~
Also, setting it to the found Xauthority file didn't solve the problem:
$ export XAUTHORITY=/run/user/1000/gdm/Xauthority
22022/31772MB
[9136:3258 0:2010] 03:54:31 Mon Jan 25 [mona@goku:pts/2 +1] ~
$ xclock
Invalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: :0
I am uid 1000:
uid=1000(mona) gid=1000(mona) groups=1000(mona),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare)
I also have these about xauth
:
$ xauth info
Authority file: /run/user/1000/gdm/Xauthority
File new: no
File locked: no
Number of entries: 2
Changes honored: yes
Changes made: no
Current input: (argv):1
21740/31772MB
[11979:11971 0:2016] 05:26:34 Mon Jan 25 [mona@goku:pts/0 +1] ~
$ xauth list
goku/unix: MIT-MAGIC-COOKIE-1 SECRET_KEY
#ffff#676f6b75#: MIT-MAGIC-COOKIE-1 SECRET_KEY

Mona Jalal
(119 rep)
Jan 25, 2021, 07:18 PM
• Last activity: Apr 4, 2025, 06:02 AM
1
votes
0
answers
44
views
How can I reliably block GUI-initiated system shutdown when systemd-inhibit only delays terminal shutdown commands?
I'm developing a desktop application using PySide6 for Linux, and I need to prevent or delay system shutdowns that are initiated from the graphical interface. I know that running systemd-inhibit --what=shutdown --who="MyApp" --why="Blocking shutdown" ... works for terminal-initiated shutdowns (like...
I'm developing a desktop application using PySide6 for Linux, and I need to prevent or delay system shutdowns that are initiated from the graphical interface. I know that running systemd-inhibit --what=shutdown --who="MyApp" --why="Blocking shutdown" ... works for terminal-initiated shutdowns (like when using systemctl poweroff), but many desktop environments (e.g., GNOME or KDE) seem to bypass these inhibitors when the shutdown is triggered from the GUI (for example, via gnome-session-quit --power-off).
My questions are:
1. Is there a user-space, non-root method to reliably block or delay GUI-initiated shutdowns on Linux?
2. What systemd, DBus, or desktop API mechanisms (or combinations thereof) can be leveraged so that GUI shutdown requests are also inhibited?
3. Are there any proven approaches or workarounds that work across different desktop environments without requiring system-level modifications (like altering polkit rules or shutdown scripts)?
Any insights, code examples, or documentation references would be greatly appreciated.
Nirav Jangale
(11 rep)
Mar 31, 2025, 08:18 AM
1
votes
0
answers
35
views
Xorg not starting when invoked from Python
I'm creating a display manager (dm) in python, which waits to Xorg to start in order to run the GUI. ### Python (omitted unnecessary code like widgets and classes and functions) ``` import os (more imports of PyQt6 etc ...) ....... class LoginWindow( QMainWindow ): def __init__(self): super().__init...
I'm creating a display manager (dm) in python, which waits to Xorg to start in order to run the GUI.
### Python
(omitted unnecessary code like widgets and classes and functions)
import os
(more imports of PyQt6 etc ...)
.......
class LoginWindow( QMainWindow ):
def __init__(self):
super().__init__()
# Make window full screen
self.setWindowFlags(Qt.WindowType.FramelessWindowHint |
Qt.WindowType.WindowStaysOnTopHint
)
..........
.......... (unnecessary code to the problem)
def cancel(self, window):
if not window :
...
def start_x11():
xorg =subprocess.run("Xorg :0 -nolisten tcp -background none -logfile /var/log/mydm/xorg.log vt1",shell=True)
return xorg
def start_user_session(username) :
loginctl = subprocess.run(f"loginctl enable-linger {username}",shell=True)# ,capture_output=True)
#print(loginctl)
if loginctl.returncode == 0 :
subprocess.run(f"sudo -u {username} dbus-launch startxfce4",shell=True)
if __name__ == "__main__" :
if start_x11().returncode == 0 :
app = QApplication(sys.argv)
app.setStyleSheet('''
QPushButton#loginDockButton {
border: none;
padding: 0px;
margin: 0px;
}
''')
window = LoginWindow()
window.show()
sys.exit(app.exec())
As you can see, i'm using **subprocess.run()** in order to run **Xorg**.
And when asked to an **AI** to resolve the problem,i was recommended to run :
subprocess.run("loginctl enable-linger {username}",shell=True)
According to that **AI**, it let the users child processes to run even if logged out, this
in order to prevent closing **dbus** process. **(though still wonder how this can help 🤔)**
### Unit Service
[Unit]
Description=mydm
Conflicts=getty@tty1.service
After=systemd-user-sessions.service plymouth-quit.service
Requires=systemd-logind.service
[Service]
ExecStart=/usr/bin/python3 /etc/mydm/src/mydm_login.py
Restart=always
RestartSec=3
StandardOutput=syslog
StandardError=syslog
TTYPath=/dev/tty1
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
[Install]
WantedBy=graphical.target
I have to admit that the unit service code, was all generated by an **AI** because
i didn't have any idea how unit files work and neither **systemd** or **systemctl**
### Logfile
After some minutes of sadness and grief from not seeing my GUI, i decided to look at into the **logfile** from **Xorg** and got the next :
[ 3671.154] Current Operating System: Linux MrDikxon 6.13.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000 x86_64
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
grep EE /var/log/mydm/xorg.log
[ 3671.154] (EE) systemd-logind: failed to get session: PID 4060 does not belong to any known session
[ 3671.171] (EE) Failed to load module "fbdev" (module does not exist, 0)
[ 3671.172] (EE) Failed to load module "vesa" (module does not exist, 0)
[ 3671.186] (EE) open /dev/dri/card0: No such file or directory
[ 3671.191] (II) Initializing extension MIT-SCREEN-SAVER
[ 3671.193] (EE) AIGLX error: dlopen of /usr/lib/dri/i965_dri.so failed (/usr/lib/dri/i965_dri.so: cannot open shared object file: No such file or directory)
[ 3671.193] (EE) AIGLX error: unable to load driver i965
grep WW /var/log/mydm/xorg.log
[ 3671.154] (WW) The directory "/usr/share/fonts/misc" does not exist.
[ 3671.154] (WW) The directory "/usr/share/fonts/TTF" does not exist.
[ 3671.154] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[ 3671.154] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[ 3671.154] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[ 3671.154] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[ 3671.169] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[ 3671.171] (WW) Warning, couldn't open module fbdev
[ 3671.172] (WW) Warning, couldn't open module vesa
[ 3671.186] (WW) Falling back to old probe method for modesetting
When doing it when (NI,??) didn't get any output.
this is my first time working with Xorg or sysmted, so i dont know really what can i do.
So i havent tried anything yet, and unix & linux stackexchange threads doesn't seem to relate much to what i need
rustymanito
(35 rep)
Mar 14, 2025, 03:32 AM
• Last activity: Mar 15, 2025, 04:42 AM
0
votes
1
answers
144
views
QXcbConnection: Could not connect to display within a service
I have a shell script that sets environment variables and runs an executable. It looks like this: ```shell export PATH=$PATH:/some/extra/binaries export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/some/extra/lib cd /path/to/execuatble DISPLAY=:0.0 nohup ./app & ``` When I run the shell script as as user from...
I have a shell script that sets environment variables and runs an executable. It looks like this:
export PATH=$PATH:/some/extra/binaries
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/some/extra/lib
cd /path/to/execuatble
DISPLAY=:0.0 nohup ./app &
When I run the shell script as as user from the terminal it encounters no problem. However I also wrote a service file that runs a python script which among other things launches this shell. Example python file:
import subprocess
import sys
import logging
logger = logging.getLogger(__file__)
logger.setLevel(logging.INFO)
try:
result = subprocess.run(["/path/to/shell/script/script.sh"], universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
logger.info(result)
except Exception as e:
logger.info("Error starting process: " + str(e), e)
The python file is running within a systemd service with a service file:
[Unit]
Description=App runner Service
After=network.target
[Service]
Environment=PYTHONUNBUFFERED=1
ExecStart=/usr/bin/python3 /path/to/python/script/script.py
Restart=always
RestartSec=5
User=root
[Install]
WantedBy=multi-user.target
When I run the service, I look at what it does with journalctl -f -u servicename
, and I can see the shell script failing when I try to run the application with
No protocol specified \n QXcbConnection: Could not connect to display :0.0
What is the root cause and how can I fix it? I'm open to changes of either the shell script, python, or the service file.
I suspect it has to do with the fact that systemd run this as root. BTW, I have no idea why would I even need an X server since this app doesn't have any GUI. Maybe it has to do with the fact that it uses Qt (we used Qt for a non-gui app since we wantd an event loop and to utilize the signal /slot mechanism to pass events between threads and objects easily.
If this is relevant it runs on Ubnuntu 16.04
Yair M
(103 rep)
Feb 19, 2025, 09:22 PM
• Last activity: Mar 8, 2025, 03:09 PM
0
votes
1
answers
284
views
After upgrade to Plasma 6, some icons are blurry
I have a high DPI display. On X11, I scaled the display to 125% by forcing the font DPI to 120 (which is 96*1.25) as a workaround since Plasma's display scaling always caused slight blurriness of icons. Since the upgrade to Plasma 6, this trick no longer worked and I got back the same problem of blu...
I have a high DPI display. On X11, I scaled the display to 125% by forcing the font DPI to 120 (which is 96*1.25) as a workaround since Plasma's display scaling always caused slight blurriness of icons.
Since the upgrade to Plasma 6, this trick no longer worked and I got back the same problem of blurry icons, especially annoying in the taskbar.
td211
(477 rep)
Mar 2, 2025, 06:09 AM
• Last activity: Mar 2, 2025, 07:00 AM
2
votes
0
answers
738
views
xfce4-terminal in fluxbox follows a different style/theme to xfce4-terminal in xfce
I am using xubuntu 18.04, but this question should preferably be applicable to all linux installations having both desktop managers "xfce" and "fluxbox". So I have started with xubuntu (i.e. ubuntu with xfce) but I have also `apt install fluxbox` as well. In "Xfce" I use `xfce4-settings-manager` to...
I am using xubuntu 18.04, but this question should preferably be applicable to all linux installations having both desktop managers "xfce" and "fluxbox".
So I have started with xubuntu (i.e. ubuntu with xfce) but I have also
However, when I switch to "fluxbox":
As you can see the window's menubar, as well as the preferences window do not obey the selected theme. This is a problem in "nautilus" file manager as well, but not for other applications (such as "Thunar" file manager, which works correctly)
Does it perhaps not follow "gtk-2.0" styles ?
For that I have set gtk-3.0 in "~/.config/gtk-3.0/settings.ini"
[Settings]
gtk-theme-name = Adwaita-dark
gtk-icon-theme-name = SimplyGrey
gtk-fallback-icon-theme = gnome
gtk-font-name = Sans 10
# next option is applicable only if selected theme supports it
gtk-application-prefer-dark-theme = true
I have also setup QT to use GTK+ styles, but the issue persists. What am I missing here ?
apt install fluxbox
as well.
In "Xfce" I use xfce4-settings-manager
to select a theme, the result for "Adwaita-dark" theme is shown below, for the "x-terminal-emulator" application: 

nass
(1508 rep)
Nov 30, 2018, 12:59 PM
• Last activity: Jan 27, 2025, 12:36 PM
Showing page 1 of 20 total questions