cspeterson / splatmoji

Quickly look up and input emoji and/or emoticons/kaomoji on your GNU/Linux desktop via pop-up menu.
MIT License
212 stars 19 forks source link

Font size cannot be changed, too small on high-dpi displays #37

Open zorael opened 3 years ago

zorael commented 3 years ago

Manjaro/Arch x86_64, splatmoji-git is r92.b8d14b4-1.

splatmoji text is small and difficult to read on laptop screens with very high resolutions. On my laptop I use a desktop environment-wide scaling of 2.0x and a font DPI of 192.

Example

Is there any chance of getting a --fontsize command-line flag? Or maybe code to obey the desktop environment's settings? (I believe KDE uses QT_SCREEN_SCALE_FACTOR. GTK seems to read GDK_SCALE.)

Or failing that, instructinos on how to modify the source to hardcode a larger font size.

cspeterson commented 3 years ago

Splatmoji uses rofi for the pop-up menu, and in my testing rofi does not behave any differently no matter my X DPI. But it is possible to explicitly pass the -dpi flag to rofi in your splatmoji.config!

Here is the relevant default line for splatmoji.config, but with an extra flag for DPI 90:

# ~/.config/splatmoji/splatmoji.config
rofi_command=rofi -dmenu -p '' -i -monitor -2 -dpi 90

It is also possible to use a subshell to derive that value dynamically, if that's easier:

# ~/.config/splatmoji/splatmoji.config
rofi_command=rofi -dmenu -p '' -i -monitor -2 -dpi $(/some/command/to get dpi)

Does that work for you?

I will add something like this to the README/help output/whatev. Thanks for bringing the need to my attention! ◦°˚\(*❛‿❛)/˚°◦

cspeterson commented 3 years ago

Learned more at https://github.com/davatorium/rofi/issues/254

Rofi actually does look at the following X Resources rule

rofi.dpi: 90

My version of rofi still doesn't seem to honor other dpi rules though

So now you have that more X-centric option than providing an override in the config, if that suits you 🙂

cspeterson commented 3 years ago

For example, paraphrased from my ~/.Xresources:

! I set DPI in a conditional block to only apply to my hidpi laptop
#define DPI 90
Xft.dpi: DPI
rofi.dpi: DPI