Score:0

Cursor doesn't respect theme when program is launched from command line

gq flag

I installed breeze-cursor-theme with apt, and changed the default cursor theme via update-alternatives. Hence, update-alternatives --get-selections | grep x-cursor-theme returns

x-cursor-theme auto /etc/X11/cursors/breeze_cursors.theme

However, when I launch some programs from the command line, e.g. sxiv, the cursor reverts to the default black cursor. When these programs are launched via dmenu or when run with sudo, the cursor theme is correct.

This is not the case for all programs; as examples, zathura and gpick do not share the problem, while picard and calibre do.

I have tried some other ways of setting the cursor theme:

  • Using lxappearance
  • Writing Xcursor.theme: breeze_cursors in ~/.Xresouces.

Neither has made a difference. I also removed all other cursor themes from /usr/share/icons/ and ~/icons/.

I also tried copying the Breeze cursors into ~/icons/, suspecting the file permissions were the issue, to no avail.

I still suspect that it might be a permissions problem, since it works when run from a TTY or ? (according to ps aux) and not when run from pts/1, pts/2, etc. To be specific, the first instance of sxiv (PID=94893) has the wrong cursors, while the other (PID=94939), called from dmenu, has the correct ones. Here is the output of ps aux | head -1 && ps aux | grep sxiv | head -n -1:

USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
username   94893  0.0  0.1  28176 21116 pts/7    S+   22:34   0:00 sxiv /home/username/a.jpg
username   94939  0.0  0.1  28172 21044 ?        S    22:34   0:00 sxiv /home/username/b.jpg

I have this problem in both Wayland and X11 in KDE, Kubuntu, and my dwm setup in Debian. It persists, whether in tmux or not.

Marco avatar
br flag
First of all, it is up to the developer to honor the theme settings. Second it depends on the library the program uses (GTK, QT, wxwidget, etc). Each library has its own theme config.
William4096 avatar
gq flag
@Marco My question is not about setting the cursor theme; I have done that successfully and every application uses the correct cursor. The question is about why the cursor theme depends on who starts an application/where it is started. Even when started from the command line, applications are still respecting the themes that I have set up - just not the cursor theme.
Marco avatar
br flag
The theme is configured in the users profile. Other users have other (cursor-)theme. Depending on the setting of your terminal, the shell inside gets the environment from the starting process or reads it completely from scratch. Environment variable might influence the profile/theme.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.