You are not logged in.

#1 2025-10-20 16:59:53

archaea
Member
Registered: 2025-10-20
Posts: 20

[SOLVED] How to change cursor theme for only one application?

Recently migrated my main system from Xubuntu 22.04 to Arch Linux w/ Xfce.  I have a script that runs gnuplot with XCURSOR_THEME=bloom environment variable set, so that gnuplot use the bloom cursor theme while the Xfce settings set a different cursor theme for everywhere else.  In Xubuntu 22.04 this worked.  In Arch Linux, XCURSOR_THEME has no effect on almost all applications?

$ pacman -Q | grep -i gnuplot
gnuplot 6.0.3-1

Using the method from https://www.baeldung.com/linux/process- … -variables I have confirmed that the XCURSOR_THEME environment variable is actually set correctly for the gnuplot process.

Testing some more apps, XCURSOR_THEME does work in sqlitebrowser and qt5ct (both installed from Arch repos) but not anywhere else?

$ pacman -Q | grep -P 'sqlitebrowser|qt5ct'
qt5ct 1.9-1
sqlitebrowser 3.13.1-2

How to get gnuplot to use bloom cursor theme without setting bloom cursor theme for all programs?

A sort-of workaround: I have Weston installed, so can set the following in ~/.config/weston.ini and run the script inside the Weston window:

[shell]
cursor-theme=bloom
cursor-size=16

but launching Weston adds enough steps that it's inconvenient for this case, it would be preferable to use the script in the main Xfce session.

To clarify why I want to set bloom cursor theme for only this one program: I prefer the Pop cursor theme in general, so have the cursor theme set to Pop in Xfce settings, but the bloom cursor theme's crosshair cursor has a "hole" in the middle whereas Pop cursor theme's crosshair is solid, so with bloom it's much easier to pinpoint what I'm clicking on when the cursor is the crosshair.  If there is no solution to set a different cursor theme for an individual application, this particular issue could be addressed by replacing the Pop crosshair cursor with bloom's (Read through https://wiki.archlinux.org/title/Cursor_themes but not seeing how to override a cursor from the active theme?)

Last edited by archaea (2025-10-21 22:04:12)

Offline

#2 2025-10-21 07:01:48

unixman
Member
Registered: 2015-03-12
Posts: 182

Re: [SOLVED] How to change cursor theme for only one application?

Are you use wayland or x11 session?
Arch is default to wayland.

Beware that gnuplot is pure X11 app. It has no wayland support. Its just work(mostly) on wayland because of xwayland compability layer.
Whether to respect or not  XCURSOR_THEME envvar is upto apps or compositor there is no enforcement.

make XCURSOR_THEME envvar as global env then test again.

Last edited by unixman (2025-10-21 07:03:07)

Offline

#3 2025-10-21 18:21:45

archaea
Member
Registered: 2025-10-20
Posts: 20

Re: [SOLVED] How to change cursor theme for only one application?

unixman wrote:

Are you use wayland or x11 session?

I'm using Xfce X11 session.

unixman wrote:

Whether to respect or not  XCURSOR_THEME envvar is upto apps or compositor there is no enforcement.

Thanks for this info, didn't realize XCURSOR_THEME support was implemented "individually" by each application/toolkit.  In that case should mention that gnuplot appears to be Qt6, and I configure Qt6 apps appearance with qt6ct to set to Oxygen Qt6 style.

$ pacman -Qi gnuplot
Name            : gnuplot
Version         : 6.0.3-1
Description     : Plotting package which outputs to X11, PostScript, PNG, GIF, and others
Architecture    : x86_64
URL             : http://www.gnuplot.info
Licenses        : LicenseRef-Gnuplot
Groups          : None
Provides        : None
Depends On      : cairo  gcc-libs  gd  glib2  glibc  gtk3  libcaca  libcerf  libwebp  libx11  lua  pango  qt6-5compat  qt6-base
                  qt6-svg  readline  wxwidgets-common  wxwidgets-gtk3
Optional Deps   : None

Sounds like I need to research this as a Qt6 specific question of how Qt6 decides what cursor theme to use.

Offline

#4 2025-10-21 18:51:54

unixman
Member
Registered: 2015-03-12
Posts: 182

Re: [SOLVED] How to change cursor theme for only one application?

thanks for the info.i was wrong.
a am not aware that gnuplot has both qt and gtk gui backkend.
therefore you count gnuplot as wayland native app.

Since it has both(gtk & qt) gui backend maybe that backends have per app cursor-settings support.
such gui frameworks or desktop environments (say kde, xfce, gnome ..) can support such use cases if they wants.

i dont know. maybe someone know or you have to research as you say.

BTW: you are able set weston-session as default via systemd, or login managers(gdm, sddm, ..) or other means.

Last edited by unixman (2025-10-21 19:00:37)

Offline

#5 2025-10-21 21:11:28

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,692

Re: [SOLVED] How to change cursor theme for only one application?

https://wiki.archlinux.org/title/Cursor … tion_files
https://gitlab.freedesktop.org/xorg/lib … type=heads
Temporarily changing the X11 server resources will impact everything (temporarily), but see https://man.archlinux.org/man/xrdb.1

The somewhat twisted hack-a-proach would be to have the different themes with the same name in different locations and bend XCURSOR_PATH to pick the correct one…

Offline

#6 2025-10-21 22:08:55

archaea
Member
Registered: 2025-10-20
Posts: 20

Re: [SOLVED] How to change cursor theme for only one application?

Ok, researching this as a toolkit-specific thing found the story with XCURSOR_THEME.

In X11: XCURSOR_THEME works in Qt5 apps like qt5ct and sqlitebrowser because Qt5 loads cursors via libXcursor, and libXcursor supports XCURSOR_THEME.  Qt6 however uses xcb_cursor_load_cursor which only supports reading the cursor theme as set in Xcursor.theme field of RESOURCE_MANAGER property of xprop -root output.

In the Weston window however XCURSOR_THEME actually does work in gnuplot, no need to set the cursor theme in ~/.config/weston.ini.  Wasn't able to definitively find out where this XCURSOR_THEME support is coming from, but my best guess is this support is coming from Weston.

seth wrote:

The somewhat twisted hack-a-proach would be to have the different themes with the same name in different locations and bend XCURSOR_PATH to pick the correct one…

Bingo!  Works perfectly.  Thanks seth!

Offline

Board footer

Powered by FluxBB