You are not logged in.

#1 2017-05-16 04:20:59

axelf
Member
From: USA / Germany
Registered: 2017-05-16
Posts: 2
Website

[SOLVED] Rofi is not respecting Xresources settings

Hello,

Rofi does not respect the color settings I defined in the Xresources file.

Expected behavior: Rofi will use the color settings defined in the Xresources file.
Actual behavior: Rofi uses its default settings.

The settings were created using the Rofi Theme Generator and stored in ~/.config/x11/xresources:

! Rofi settings ----------------------------------------------------------------
rofi.color-enabled: true
rofi.color-window: argb:f22d303b, #7c8389, #1d1f21
rofi.color-normal: argb:3000000, #c4cbd4, argb:96404552, #4084d6, #f9f9f9
rofi.color-active: argb:2000000, #b5bd68, argb:e42d303b, #8c9440, #f9f9f9
rofi.color-urgent: argb:2000000, #cc6666, argb:e52d303b, #a54242, #f9f9f9

The settings are loaded correctly:

$ xrdb -load ~/.config/x11/xresources
$ xrdb -query
rofi.color-enabled:	true
rofi.color-window:	argb:f22d303b, #7c8389, #1d1f21
rofi.color-normal:	argb:3000000, #c4cbd4, argb:96404552, #4084d6, #f9f9f9
rofi.color-active:	argb:2000000, #b5bd68, argb:e42d303b, #8c9440, #f9f9f9
rofi.color-urgent:	argb:2000000, #cc6666, argb:e52d303b, #a54242, #f9f9f9

Starting Rofi from the terminal with the only arguments being "-show run" results in Rofi using its default color settings. However, launching Rofi using

rofi -show run -color-window "argb:f22d303b, #7c8389, #1d1f21" -color-normal "argb:3000000, #c4cbd4, argb:96404552, #4084d6, #f9f9f9" -color-active "argb:2000000, #b5bd68, argb:e42d303b, #8c9440, #f9f9f9" -color-urgent "argb:2000000, #cc6666, argb:e52d303b, #a54242, #f9f9f9"

results in the expected behavior. According to the Rofi Theme Generator the Xresources settings should result in the same color settings as the command line above. Additionally, setting "-dump-xresources" for the command line above results in the same Xresources settings, therefore I do not think there is a syntactical error.

Am I missing something?

Last edited by axelf (2017-05-16 16:02:13)

Offline

#2 2017-05-16 08:49:00

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [SOLVED] Rofi is not respecting Xresources settings

It works for me, only difference is I have ".Xresources" file in my home folder.

Offline

#3 2017-05-16 10:28:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: [SOLVED] Rofi is not respecting Xresources settings

axelf wrote:

Additionally, setting "-dump-xresources" for the command line above...

Can you clarify this.  Specifically, if you run rofi with only the -dump-xresources parameter does is output your desired settings, or does it only do so with that command line that explicitly sets those options?

I don't use rofi, but I'm taking a look at the code now.  It is possible for X programs to use an X resource database from a file (e.g. ~/.Xresources) without also using the settings resident in the server (from xrdb commands).

EDIT: it seems rofi does read settings from the server (e.g. what you've specified with xrdb) however it also unconditionally loads settings from $XDG_CONFIG_HOME/rofi/config after that so they could override xrdb settings.  Do you have a file at ~/.config/rofi/config?  If so, what is in it?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2017-05-16 16:01:49

axelf
Member
From: USA / Germany
Registered: 2017-05-16
Posts: 2
Website

Re: [SOLVED] Rofi is not respecting Xresources settings

Thank you very much for your replies!

Trilby wrote:

EDIT: it seems rofi does read settings from the server (e.g. what you've specified with xrdb) however it also unconditionally loads settings from $XDG_CONFIG_HOME/rofi/config after that so they could override xrdb settings.  Do you have a file at ~/.config/rofi/config?  If so, what is in it?

I thought I moved this configuration file but I did not. Additionally, my settings were so close to Rofi's defaults that I did not notice that my old configuration file was still loaded and overwriting the settings in the Xresources. After removing ~/.config/rofi/config everything works as expected.

Thank you for even looking at Rofi's code to solve this problem. I will learn from this and apply the same procedure when I run into a problem like that again.

Edit: Removed typos.

Last edited by axelf (2017-05-16 16:04:29)

Offline

Board footer

Powered by FluxBB