Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change mouse cursor size #417

Closed
savaged opened this issue May 23, 2020 · 44 comments
Closed

Unable to change mouse cursor size #417

savaged opened this issue May 23, 2020 · 44 comments
Labels
bug Something isn't working verified Problem has been reproduced by Regolith contributor

Comments

@savaged
Copy link

savaged commented May 23, 2020

Describe the bug
After raising issue #415 we decided to split that issue. This relates just to the fact the mouse cursor size cannot be changed even after selecting a different size from Settings. (The first issue raised relates to the order of the dialogs).

To Reproduce
Steps to reproduce the behavior:
Open Settings. Select Universal Access. Select Cursor Size and pick a different size. Move the Settings dialog to reveal the mouse cursor selection pop-up. Close that dialog. No change is made to the cursor size.

Expected behavior
The mouse cursor size changes.

Installation Details
OS: Ubuntu 20.04 focal
Kernel: x86_64 Linux 5.4.0-31-generic
Shell: bash 5.0.16
Resolution: 3286x1080
DE: GNOME 3.36.2
WM: i3
GTK Theme: Ayu-Mirage-Dark [GTK2/3]
Icon Theme: Moka
Font: Cantarell 11

Additional context
Fresh full install of Regolith OS

@moritzheiber
Copy link
Contributor

As Alberts mentioned in the other issue, the settings dialog in GNOME Settings generally only applies to Metacity/gnome-shell, however, it also changes Xcursor.size, which should be respected by "anything", since it's a general Xresources value. Right now, setting Xcursor.size to anything doesn't have an effect on the currently running session or new sessions.

@moritzheiber moritzheiber added bug Something isn't working verified Problem has been reproduced by Regolith contributor labels May 23, 2020
@muktupavels
Copy link

GNOME Settings only changes GSettings value. You can do same from dconf-editor or by using gsettings. For example gsettings set org.gnome.desktop.interface cursor-size 96.

XSettings plugin from GNOME Settings Daemon exports cursor size as Xcursor.size X resource and as Gtk/CursorThemeSize X setting (https://specifications.freedesktop.org/xsettings-spec/0.5/).

Metacity uses XSettings. Compiz use X resources.

@savaged
Copy link
Author

savaged commented May 24, 2020

All sounds great, however, I had the impression Regolith was aiming to be user friendly. If a user is expecting to dig around in config they would already be using Arch and DWM. There must be a fix albeit not the highest priority.

@moritzheiber
Copy link
Contributor

Oh, I agree, it should definitely respect the Xresources value, which it doesn't right now. This needs further testing/investigation.

@kgilmer
Copy link
Member

kgilmer commented May 24, 2020

@savaged , yes Regolith aims to be user friendly. You've just hit a region that we haven't had a chance to get to yet.

@kgilmer
Copy link
Member

kgilmer commented Sep 5, 2020

I've noticed that the cursor size does change, but only when specific apps are selected. For example gnome-terminal and the Slack client both render the cursor correctly, but Chrome and VSCode do not. Unsure of why this is, but guessing it's related to GNOME.

@kgilmer
Copy link
Member

kgilmer commented Sep 5, 2020

Example:
image

@yssoe
Copy link

yssoe commented Sep 14, 2020

@kgilmer @savaged is there an update please

I use a hidpi monitor and the mouse pointer is really, really REALLY small

could this be a trick to use the keyboard more? thanks!ff

@kgilmer
Copy link
Member

kgilmer commented Sep 17, 2020

@yssoe try running this, then logging back in our refreshing your session:

$ echo "Xcursor.size: 48" >> ~/.config/regolith/Xresources

@atebyagrue
Copy link

@yssoe try running this, then logging back in our refreshing your session:

$ echo "Xcursor.size: 48" >> ~/.config/regolith/Xresources

File created, no change to the environment on log out/in on a 2020 Dell XPS 13 with 4k screen. The following commands work persisted through reboot for backgrounds:
gsettings set org.gnome.desktop.background picture-options 'none'
gsettings set org.gnome.desktop.background primary-color '#1F1F1F'
but the suggested command
gsettings set org.gnome.desktop.interface cursor-size 96
does not change the cursor, even though the gsettings set can be verified with gsettings get after log out/in
I'll help out any way I can, this is an almost perfect distro out of the box for me, minus this one small issue.

@EricPJobe
Copy link

I'm having this problem on a fresh install on a Dell XPS 15 9500. I have tried setting the cursor size via setting an override ~/.Xresources and by using the gsettings above, and neither work

@kgilmer
Copy link
Member

kgilmer commented Oct 27, 2020

These steps I just performed worked for me without issue:

$ echo "Xcursor.size: 48" >> ~/.config/regolith/Xresources
$ gsettings set org.gnome.desktop.interface cursor-size 48

And then reboot.

The result:
image

@kgilmer
Copy link
Member

kgilmer commented Oct 27, 2020

If this does not work for you, nothing comes to mind as to what could be different to be causing the regression. I do not have an XPS or other high density device to test with, but I can clearly set the cursor to any size using the commands I just mentioned.

@kgilmer kgilmer closed this as completed Oct 27, 2020
@eduncan911
Copy link

@kgilmer This does not work on a fresh install of Pop_os 20.10 + Regolith-desktop today on a 15.5" Thinkpad P1 w/4K screen.

echo "Xcursor.size: 48" >> ~/.config/regolith/Xresources
gsettings set org.gnome.desktop.interface cursor-size 48

Gnome's hidpi mode renders differently when you actually have an hidpi screen. I was testing it on an 1080p screen earlier and nothing changed. Gnome looks for the DPI according to the display size to actually enable it.

@kgilmer
Copy link
Member

kgilmer commented Jan 22, 2021

Hmm, so you're saying that if I had a hidpi screen then my cursor would not change @eduncan911 ? @muktupavels are you aware of anything in flashback that would be doing this?

@moritzheiber
Copy link
Contributor

moritzheiber commented Jan 22, 2021

Interestingly enough, I also have a 4K screen, which is set to a 1080p resolution, and none of the methods mentioned in this thread work for me .. maybe that actually is the issue?

To be clear: I have not set any scaling factor, the display it self as running at 1920x1080, but it is capable of going all the way up to 4K

@moritzheiber
Copy link
Contributor

Short update: it does work when I'm hovering over/using a Snap app .. which is even more puzzling 😕

@eduncan911
Copy link

For the record, my 4k screen is running at 4k resolution - not 1080p.

@muktupavels
Copy link

Looks like there are problems also in GNOME Flashback session! Maybe problem is in cursor theme?

Some cursor themes I tried does not have two largest cursors. Only Yaru had all cursors sizes (tested on non-HiDPI monitor). I guess on HiDPI it is worse as it needs bigger cursors...

@eduncan911
Copy link

@muktupavels I don't believe it's the cursor theme. Adwaita has included HIDPI versions of 48 and 96 dpi for years.

And, Regolith defaults to use Adwaita:

$ xrdb -query | grep cursor
Xcursor.size:	96
Xcursor.theme:	Adwaita

But yeah, it's acting as though it doesn't exist. I was hunting for some good HiDPI cursor icons last night but kept running into the Adwaita versions (or an extension of those versions).

@muktupavels
Copy link

Then why Yaru works and Adwaita not?

https://bugzilla.gnome.org/show_bug.cgi?id=747386
This had three sizes - 24, 32, 48 (before fix)... But settings allow to choose 5 sizes - 24, 32, 48, 64 and 96.

For HiDPI icon theme needs to have 48, 64, 96, 128 and 192 icons to make it possible to use any of 5 sizes.

Arrow icon in Yaru theme has 24, 32, 48, 64 and 96 sizes. Works fine in non-HiDPI case. And on HiDPI works only first 3 sizes (default (24), medium (32) and large (48)) and larger (64) and largest (96) does not work because there is no 128 and 196px icons.

Looks like Adwaita has icons, so most likely my JHBuild session is not using Adwaita and are using something else that has no needed sizes. My main install/session does not have Adwaita icon theme...

https://linux.die.net/man/3/xcursorsetdefaultsize
The default search path it uses is ~/.icons, /usr/share/icons, /usr/share/pixmaps.

That might confirm that my JHBuild session is not using Adwaita icon theme.

Metacity uses XcursorSetTheme and XcursorSetDefaultSize. So in GNOME Flashback case problem is with icon theme because cursor theme and size change itself is working. Maybe Regolith has other problems...

@eduncan911
Copy link

eduncan911 commented Jan 23, 2021

EDIT: Ah, I was typing this long reply below before you posted the message above. I think we are on the same path. However, what i posted below DOES work now.

Solved (somewhat) for my Pop_OS! + Regolith-desktop install.

It's the Adwaita cursors that are not picked up/used by Xresources settings. I believe i3wm is the culprit here that doesn't support this custom Adwaita cursor theme that Gnome/Pop_OS! includes by default. While /usr/share/icons/Adwaita seems to include 48, 64, 72, 96, and 128 sizes, and they do work under Gnome desktop to be changed to very large cursors under 4k resolution, nothing I could do within Regolith/i3wm changed this. I even copied the theme to ~/.icons/Adwaita and nothing changed. Just the tiny cursor regardless.

I was able to get what other i3wm users complain about working: cursor is large/normal in some apps, but not most. I highly suspect it's the way i3wm/Xresources is built to fallback to the lowest cursor resolution if there is no GTK+ or some other TK override that matches Adwaita - and I suspect Gnome enforces that for every app it launches. However, i3wm does not when it launches an app. What those settings/ENV vars are, I have no clue. I just see that the cursor theme return to a default tiny 24 or 32 pixel size most of the time.

After a good bit of searching (should be much easier to find HIDPI icon themes!), I ran across the Capitaine HiDPI cursors.

https://github.com/keeferrourke/capitaine-cursors
Prebuilt binaries are here for HiDPI out of the box: https://www.pling.com/p/1148692
^- These are the ones I used, just the R4 binary download - didn't build them.

Download and extract to ~/.icons/capitaine-cursors/ so it looks like (ignore the Adwaita theme, it does NOT work with i3wm):

$ tree -L 2 ~/.icons/
/home/user/.icons/
├── Adwaita
│   ├── 16x16
│   ├── 22x22
│   ├── 24x24
│   ├── 256x256
│   ├── 32x32
│   ├── 48x48
│   ├── 512x512
│   ├── 64x64
│   ├── 8x8
│   ├── 96x96
│   ├── cursor.theme
│   ├── icon-theme.cache
│   ├── index.theme
│   ├── scalable
│   └── scalable-up-to-32
└── capitaine-cursors
    ├── cursors
    └── index.theme

And small tweak to the Xresources:

$ cat ~/.config/regolith/Xresources 
Xft.dpi: 192
Xcursor.size: 96
Xcursor.theme: capitaine-cursors
i3-wm.bar.position: top

A quick MOD+SHIFT+R restart and now I have enormous but most importantly consistent mouse icons, across GTK+, i3bar, Brave (Chromium), and Terminal!

The path forward:

I think the lowest level of effort is to add a Wiki/Document somewhere explaining that HIDPI monitors will need some changes, such as a supported HiDPI cursor theme, such as https://github.com/keeferrourke/capitaine-cursors.

The highest level of effort is to find a support Adwaita icon theme to include with Regolith-Desktop. Or, some other HiDPI-compatible icon theme like the one mentioned above. The most important part is that regolith would be using this new icon theme out of the box, under our control. So a quick Xresources tweak will Just Work(tm) without anything else done by the user.

@eduncan911
Copy link

eduncan911 commented Jan 23, 2021

Then why Yaru works and Adwaita not?

From my post above, Adwaita works fine under Gnome and can actually grow quite large in size - too large!

So it's something in the i3wm eco-system that doesn't support this Gnome-formatted icon theme that comes with Ubuntu/Pop_OS, that many many i3wm users complain about.

I just gave Yaru a shot and it does not work either.

$ cat ~/.config/regolith/Xresources 
Xft.dpi: 192
Xcursor.size: 96
Xcursor.theme: Yaru
i3-wm.bar.position: top

Only the custom icon theme I downloaded above works in HiDPI UHD 4K screen.

EDIT: ha, Pop doesn't include Yaru, so that would be why.

@eduncan911
Copy link

eduncan911 commented Jan 23, 2021

Another bit of info (sorry for the multiple comments, but this is worth noting separately): the "Accessibility" seems to only affect GTK+ apps like Brave (Chromium) and Terminal within i3wm. It does not change the cursor theme for anything else, like the Settings control panel, i3bar hover, etc.

I found the Accessibility 5 sizes only matches normal 48, 96, 128 sizes. It does not support 64, 72, nor 196.

The "middle" option matches Xcursor.size: 96 for perfection throughout all of i3wm, i3bar, Brave, Terminal, etc.

image

@muktupavels
Copy link

Adwaita in your /home/user/.icons/ does not have cursors directory!

From https://linux.die.net/man/3/xcursorsetdefaultsize:

Xcursor (mostly) follows the freedesktop.org spec for theming icons. The default search path it uses is ~/.icons, /usr/share/icons, /usr/share/pixmaps. Within each of these directories, it searches for a directory using the theme name. Within the theme directory, it looks for cursor files in the 'cursors' subdirectory. It uses the first cursor file found along the path.

If necessary, Xcursor also looks for a "index.theme" file in each theme directory to find inherited themes and searches along the path for those themes as well.

If no theme is set, or if no cursor is found for the specified theme, Xcursor checks the "default" theme. 

Looks like that is problem why my main session does not show Adwaita as icon theme. No idea why Ubuntu does not have cursors directory in Adwaita icon theme as upstream repo has it.

Adwaita did not work for me, because my JHBuild session is in custom prefix /mnt/some-disk/JHBuild/latest/install. libXcursor simply did not load theme from there and system version simply has no needed directory. Just tested by copying Adwaita icon theme from custom prefix to /home/user/.icons and Adwaita also works for me.

And here is code that search for cursor file:
https://gitlab.freedesktop.org/xorg/lib/libxcursor/-/blob/master/src/library.c#L211

If it does not find cursor in requested theme, it falls back to default theme. Ubuntu default theme inherits DMZ-White theme. And this one does not have 64px and 96px icon at least for arrow cursor.

So in GNOME Flashback problem definitely was in icon theme. In my case even if I had selected Adwaita, it was loading DMZ-White theme. Cursor theme and/or size changing works.

Accessibility does nothing with cursor. It just changed GSetting value - it changes cursor-size under org.gnome.desktop.interface schema. That setting is used by xsettings plugin in gnome-settings-daemon:
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/blob/master/plugins/xsettings/gsd-xsettings-manager.c#L695
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/blob/master/plugins/xsettings/gsd-xsettings-manager.c#L769
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/blob/master/plugins/xsettings/gsd-xsettings-manager.c#L832

How these settings are used depends on wm and/or applications. For example Metacity use Gtk/CursorThemeSize and Gtk/CursorThemeName and GTK applications do same. I don't know what or how are used Xcursor.size and Xcursor.theme but I would guess that in the end everything use libxcursor. So if settings are updated (and from what I see, changing settings works) then problem is in icon theme. It might not have needed cursor sizes. Or maybe libcursor does not find theme and is falling back to default theme.

@kgilmer
Copy link
Member

kgilmer commented Jan 24, 2021

This is some incredible deep diving by @eduncan911 and @muktupavels ! I noticed that there is another Adwaita icon theme provided by Ubuntu; adwaita-icon-theme-full which does appear to have the cursors directory. When I install this and set both Xresources and gsettings to a size of 96, I see a consistently large mouse cursor.

@eduncan911 can you check and see adwaita-icon-theme-full satisfies the requirements for a hidpi icon theme? I am unsure that my test is valid because I do not have a hidpi screen.

@kgilmer kgilmer reopened this Jan 24, 2021
@eduncan911
Copy link

eduncan911 commented Jan 24, 2021

@muktupavels Adwaita in your /home/user/.icons/ does not have cursors directory!

Well, you quoted the reason why:

Xcursor also looks for a "index.theme" file in each theme directory to find inherited themes and searches along the path for those themes as well

The index.theme located in the Adwaita folder specifies the non-cursors' location of the icons, depending on the size requested.

$ cat /usr/share/icons/Adwaita/index.theme 
# too large to paste here

So, there is no cursors directory. It must be an advanced technique that Gnome/Ubuntu follows but doesn't work within i3wm (or Xfce that I've seen related posts talk about).

@kgilmer: This is some incredible deep diving by @eduncan911 and @muktupavels

We're desperate! ;)

@kgilmer: @eduncan911 can you check and see adwaita-icon-theme-full satisfies the requirements for a hidpi icon theme?

So upon installing this package, it adds the missing cursors folder that @muktupavels mentioned above, into the existing /usr/share/icons/Adwaita folder.

I can confirm this does indeed fix everything! I can just specify the Xcursor.size, and that's it (no Xcursor.theme, since it defaults to Adwaita). Once I purged my system of ~/.icons/Adwaita, changed Tweaks back to Adwaita (default), and logged out and back in (because GTK+ apps wouldn't honor MOD+SHIFT+R), it all worked.

$ cat ~/.config/regolith/Xresources 
Xft.dpi: 192
Xcursor.size: 96
i3-wm.bar.position: top

So in summary, for HiDPI, install adwaita-icon-theme-full. Or maybe Regolith can just go ahead and install it as a normal dependency, since i3wm doesn't seem to properly use the non-full package anyways.

@eduncan911
Copy link

eduncan911 commented Jan 24, 2021

OT and quick question (instead of opening a whole another issue):

It seems the final piece to true HiDPI glory is the drun/dmenu and run dialog boxes. (CMD+SPACE and CMD+SHIFT+SPACE).

Any idea what to change for these to honor 196 dpi?

On a related note, the Help menu (MOD+SHIFT+?) scales properly, as well as the i3bar, when using Xresouces' Xfi.dpi: 192 setting.

I switch between 192 and 96 whenever I plug in my external 1080p displays (and run 1080p on my 4k screen). I now have to change the Xcursor.size from 96 to 48 when switching resolutions. A small price to pay. :)

Here's the script I wrote when switching res to 1080p when connected to external monitors (1080p looks very crisp on UHD! it's not 4k, but looks much better than just a 1080p screen):

EDIT: Updated script adding the rofi.dpi as found out later on. This script is current.

$ cat ~/bin/dpi.bash 
#!/bin/bash

# Change the DPI from standard 96 to 192, and back.
# Usage:
#   dpi.bash [4k|2k]

RES=${1}

if [[ "${RES}" == "4k" ]]; then
  sed -i "s/rofi.dpi: 96/rofi.dpi: 192/" ~/.config/regolith/Xresources
  sed -i "s/Xft.dpi: 96/Xft.dpi: 192/" ~/.config/regolith/Xresources
  sed -i "s/Xcursor.size: 32/Xcursor.size: 64/" ~/.config/regolith/Xresources
elif [[ "${RES}" == "2k" ]]; then
  sed -i "s/rofi.dpi: 192/rofi.dpi: 96/" ~/.config/regolith/Xresources
  sed -i "s/Xft.dpi: 192/Xft.dpi: 96/" ~/.config/regolith/Xresources
  sed -i "s/Xcursor.size: 64/Xcursor.size: 32/" ~/.config/regolith/Xresources
else 
  echo "Usage: ./dpi.bash [4k|2k]"
  exit 2
fi

cat ~/.config/regolith/Xresources
regolith-look refresh

I'll eventually find the time to hook into Gnome's dbus to detect the resolution change, and automatically set this.

Regolith aims to be user-friendly, without all of this custom script. Perhaps we can build in an HiDPI set of tools to automate these things?


I got to write up a blog post on all of this...

@muktupavels
Copy link

libxcursor will search for Inherits in index.theme and at least for me Adwaita file does not have that:
https://gitlab.freedesktop.org/xorg/lib/libxcursor/-/blob/master/src/library.c#L175

GNOME Settings Daemon updates RESOURCE_MANAGER property on root window: You can check if it has updated values with - xprop -root | grep RESOURCE_MANAGER. Or it looks like you can use xrdb -query to check if values is updated. Maybe you dont need to manually add/change that?

MonitorsChanged signal on org.gnome.Mutter.DisplayConfig dbus interface can be used to detect changes in monitor configuration.

@kgilmer
Copy link
Member

kgilmer commented Jan 24, 2021

Any idea what to change for these to honor 196 dpi?

I've verified that the default icon theme (moka-icon-theme) for the default Regolith look (lascaille) does not have a cursors directory. adwaita-icon-theme-full is ~22Mb vs the "light" version at ~4Mb. Nor did I have any luck in finding a "full" version of Moka with hidpi cursors. Regolith (regolith-styles) does not currently do anything for cursor themes. The ideal fix is that cursors are modeled explicitly in Xresources as other GNOME UI settings. The drastic size difference makes the decision hard to bundle the adwaita-icon-theme-full package by default. I'll have to do some more digging before making a decision.

Any idea what to change for these to honor 196 dpi?

@eduncan911 did you see: davatorium/rofi#254? Can you LMK if it works for you or not?

Regolith aims to be user-friendly, without all of this custom script. Perhaps we can build in an HiDPI set of tools to automate these things?

I'm open to it. There are certainly a lot of users that struggle w/ hidpi configurations. As I don't have a hidpi setup myself, it's hard for me to really know what would be best. Feel free to write up some design ideas in the wiki if you like @eduncan911 : https://github.com/regolith-linux/regolith-system/wiki

@muktupavels thanks as always for the help w/ troubleshooting and links to the source code when relevant. I learn something valuable every time we correspond. 😄

@eduncan911
Copy link

eduncan911 commented Jan 24, 2021

One thing to note is that I have built my 4k display all based on Gnome's built-in Scaling feature, set to 200% for me. I did this as I occasionally switch back to Gnome on my Pop_OS! install. Using scaling of 200% remains compatible with Pop_OS's custom HiDPI Daemon they have running (and actually works on Regolith as well, for the scaling parts). And I must admit, Pop_OS has some great usability improvements, especially in HiDPI detection and switching.

And Regolith-Desktop installed ontop of Pop_OS! is like a perfect match of pure Gnome (not Ubuntu's gnome) + Pop_OS/System76 power/hybrid/Optimus/AMD tweaks + Pop_OS HiDPI/LoDPI daemon and other tools + Regolith i3wm. I'm in heaven here.

Just wanted to say that at no given time did I use Tweaks to scale the fonts nor GTK/QT environment settings. That's why all these DPI settings need to be tweaked to wrap up the look-n-feel - which is working great now.

@kgilmer: I'll have to do some more digging before making a decision.
...
@kgilmer: Feel free to write up some design ideas in the wiki

From a user's perspective, I would recommend a few suggestions:

  1. Clear documentation on the main site, front and center. Perhaps starting with some initial tips within the initial Configurations section here. A new header, like:

HiDPI Displays

I'd be happy to submit a PR for documentation there if you like. It's not a lot of work for the end-user. It's just a few specific configuration items to add at this point.

If it gets long-winded, maybe a dedicated page that the above would link off to.

  1. The other suggestion is to go ahead and setup/include these items within regolith desktop itself. Well, at least the Adwaita full icon package. Perhaps I finish my script to listen on dbus for resolution changes, and include it as well. Then all that is left is for the user to specify a few dpi properties and it will just work out of the box (given, they stay using Adwaita).

This is the cleanest setup and would allow anyone to tweak a few DPI settings in the config, and be good to go. Of course, this means a coupe more dependencies and a larger install footprint - in exchange to being the first i3wm package that works out of the box with HiDPI screens.

@eduncan911 did you see: davatorium/rofi#254? Can you LMK if it works for you or not?

Last night I tried searching and found Rofi, yes. I searched their opened and closed issues for "hidpi", nada. I also searched their code for hidpi and didn't find anything. It never occurred to me to look for "dpi". Doh!

Yep, that worked to scale it (for the most part).

$ cat ~/.config/regolith/Xresources 
i3-wm.bar.position: top
rofi.dpi: 192
Xft.dpi: 192
Xcursor.size: 96

I can't take a screenshot with Rofi open to show what it looks like. While it does scale properly with 192 and is more or less perfect in scale/font/rendering, the overall window width does not scale - so only about 20-22 characters are shown in a narrow window.

Question: does Regolith have some hardcoded width override for Rofi? Because when I set rofi.width, nothing changes - rather it is 50 (default) to 100, 500, 1000, or 2000. Nothing changes the width.

That's fine as I usually only type a couple of letters anyways. I'll open an issue over there, as rofi.width has no effect when DPI is set. And besides, it should not be a px setting for width to fix this (but a character limit instead). But wanted to check with Regolith first to see if we are hardcoding the window width or something first.

@kgilmer
Copy link
Member

kgilmer commented Jan 24, 2021

I'm in heaven here.

Nice!!

Question: does Regolith have some hardcoded width override for Rofi?

Yes, it's defined in the stylesheet: https://github.com/regolith-linux/regolith-styles/blob/master/lascaille/rofi.rasi#L29 The file your system is using will vary based on what look is active. I guess ideally dimensions would be expressed in density independent units, not sure if Rofi supports that but seems like something we'll need for clean hidpi systems. Either that or another set for hidpi systems.

I'd be happy to submit a PR for documentation there if you like

PR would be great @eduncan911 . As it happens we're in the middle of a website migration to allow for better support for translations. I'm not sure if now is a good time to change the docs.. @moritzheiber should we hold off on website edits or changes are ok now?

@eduncan911
Copy link

eduncan911 commented Jan 24, 2021

The file your system is using will vary based on what look is active

Here's what I'm using at this moment:

$ xrdb -query | grep regolith.look
regolith.look:	gruvbox

That makes sense, that it's in the stylesheet. I haven't been able to find a way to take a screenshot of it yet.

@eduncan911
Copy link

eduncan911 commented Jan 24, 2021

@kgilmer I found and changed it to 30%, and it looks pretty damn good now on both 2k and 4k.

# /etc/regolith/styles/gruvbox/rofi.rasi
window {
   background-color: @background-color;
   width: 30%;
   padding: 10px;
   fullscreen: false;
   border:  2px;
   border-radius: 0px;
   border-color: @border-color;
}

Obviously this is not a preferred method (will be overwritten on next update).

I feel that's a much larger update, as you may want to convert many files to 30%, and then evaluate if anything else should be percentage. I think that's what you want to capture in regolith-linux/regolith-styles#38, correct?

@kgilmer
Copy link
Member

kgilmer commented Jan 25, 2021

Great idea to use percentage over pixel units 😄 👍

kgilmer added a commit to regolith-linux/regolith-styles that referenced this issue Jan 25, 2021
@kgilmer
Copy link
Member

kgilmer commented Jan 25, 2021

@eduncan911 yes, see the commit I associated to this issue just now. This will be available for testing in the unstable PPA tonight. Assuming no regressions, it will roll into Regolith 1.5.3.

@kgilmer
Copy link
Member

kgilmer commented Jan 25, 2021

...perhaps this is the universe's way of telling me it's ok to go ahead and buy a new thinkpad even though the one I have is perfectly fine... 🤣

@seba-i
Copy link

seba-i commented Apr 19, 2021

To summarise what worked for me from all the posts above (special thanks to eduncan911):

sudo apt-get update
sudo apt-get install adwaita-icon-them-full
$echo "Xcursor.size: 48" >> ~/.config/regolith/Xresources # only need this single line
<restart computer>

And I had done this ealier (not sure if nessesary):

gsettings set org.gnome.desktop.interface cursor-size 48

Now works across all apps. Life changer!

@eduncan911
Copy link

eduncan911 commented Apr 19, 2021

For the record, this is the current version of my script to switch back and forth between 2k and 4k:

$ cat ~/bin/dpi.bash 
#!/bin/bash

# Change the DPI from standard 96 to 192, and back.
# Usage:
#   dpi.bash [4k|2k]

RES=${1}

if [[ "${RES}" == "4k" ]]; then
  sed -i "s/rofi.dpi: 96/rofi.dpi: 192/" ~/.config/regolith/Xresources
  sed -i "s/Xft.dpi: 96/Xft.dpi: 192/" ~/.config/regolith/Xresources
  sed -i "s/Xcursor.size: 32/Xcursor.size: 64/" ~/.config/regolith/Xresources
elif [[ "${RES}" == "2k" ]]; then
  sed -i "s/rofi.dpi: 192/rofi.dpi: 96/" ~/.config/regolith/Xresources
  sed -i "s/Xft.dpi: 192/Xft.dpi: 96/" ~/.config/regolith/Xresources
  sed -i "s/Xcursor.size: 64/Xcursor.size: 32/" ~/.config/regolith/Xresources
else 
  echo "Usage: ./dpi.bash [4k|2k]"
  exit 2
fi

cat ~/.config/regolith/Xresources
regolith-look refresh

@seba-i Try adding the other two options, which will also handle the bar and menu items.

$ cat ~/.config/regolith/Xresources 
rofi.dpi: 192
Xft.dpi: 192
Xcursor.size: 96

Ps, I highly prefer reallllly big mouse cursors. I'm getting too old... Resize accordingly.

@eduncan911
Copy link

eduncan911 commented Apr 19, 2021

@moritzheiber Should I submit a PR now to add some documentation? Or, hold off a bit longer for the redesign of the website?

Ref: #417 (comment)

@kgilmer
Copy link
Member

kgilmer commented Apr 20, 2021

@eduncan911 the website is ready to go! Please add your howto here: https://github.com/regolith-linux/website/tree/v2/content/en/docs/Howtos . LMK if you have any questions :)

@kgilmer
Copy link
Member

kgilmer commented Jun 21, 2021

Since original issue is resolved, closing and creating separate ticket for docs: #584

@kgilmer kgilmer closed this as completed Jun 21, 2021
@eduncan911
Copy link

eduncan911 commented Jun 23, 2021 via email

@rvdende
Copy link

rvdende commented Jan 28, 2023

I run into this on regolith2.. I see the ~/.config/regolith folder is now ~/.config/regolith2 instead and there is a Xresources file.

So the command now is:

echo "Xcursor.size: 48" >> ~/.config/regolith2/Xresources

# and if you want to scale the bar aswell:
echo "rofi.dpi: 192" >> ~/.config/regolith2/Xresources
echo "Xft.dpi: 192" >> ~/.config/regolith2/Xresources

# load changes
regolith-look refresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verified Problem has been reproduced by Regolith contributor
Projects
None yet
Development

No branches or pull requests

10 participants