Closed tcharchar closed 6 months ago
maybe adjust overview scale in user config?
maybe adjust overview scale in user config?
Looks better, but the issue of apps not properly filling up the preview is still present.
You can reduce the number of workspaces shown from 10 to 8, that's how I fixed mine. I currently don't have access to my laptop, will update this reply shortly.
Edit: @tcharchar add the below code inside .config/ags/user_options.js
'overview': {
'numOfCols': 4,
},
so it looks something like this
const userConfigOptions = {
'overview': {
'numOfCols': 4,
},
}
export default userConfigOptions;
Changing the number of columms from 10 to 8 makes it now fit without changing the scale from its base 0.18 value, but it still has the issue of not properly filling up a workspace preview.
What I have done in the past, is to divide the width / height by the current scale in variables.js
:
export const SCREEN_WIDTH = Number(exec(`bash -c "hyprctl monitors -j | gojq '.[].width / .[].scale' | awk '{print int($1+0.5)}'"`));
export const SCREEN_HEIGHT = Number(exec(`bash -c "hyprctl monitors -j | gojq '.[].height / .[].scale' | awk '{print int($1+0.5)}'"`));
However, this approach has some flaws. This approach only works with Hyprland and does not work with multiple monitors. In order to solve this problem, I think there has to be a screen width and a screen height per monitor and the actual screen size after scaling has to be determined.
@DiXN This actually fixes a multitude of problems, including #417 too.
Edit: Thanks a lot by the way, this works great on my setup as I only use one monitor (my laptop's display).
With the following snippet, I can get the screen width and screen height after scaling for each monitor.
const SCREEN_GEOMETRY = {}
range(Gdk.Display.get_default()?.get_n_monitors() || 1, 0).forEach(id => {
const display = Gdk.Display.get_default()
const monitor = display.get_monitor(id)
const monitor_geometry = monitor.get_geometry()
let monitor_obj = {}
monitor_obj[id] = {
width: monitor_geometry.width,
height: monitor_geometry.height,
}
Object.assign(SCREEN_GEOMETRY, monitor_obj)
});
The idea would be to export SCREEN_GEOMETRY
and to get the screen geometry of the monitor by indexing SCREEN_GEOMETRY
with the monitor's id like so SCREEN_GEOMETRY[id]
.
For now, I am not sure how, for example, the overview is created per monitor, and therefore I set the screen width and height like this:
// Screen size
export const SCREEN_WIDTH = SCREEN_GEOMETRY[0].width;
export const SCREEN_HEIGHT = SCREEN_GEOMETRY[0].height;
This, of course, only works with one monitor. @end-4 would this concept help to set the size of the overview per monitor?
I don't think end-4 uses a secondary monitor, and would be difficult to fix these kinds to issues at their end. I guess at this point we all should sponsor a monitor to end-4 🤓.
I guess at this point we all should sponsor a monitor to end-4 🤓.
Considering about my economic status, I'm not able to help with that :/
But if @end-4 has a spare device which can run a VNC client, the following steps may provide a second "monitor":
tigervnc
, e.g. sudo pacman -S tigervnc
. Other VNC client may work too.hyprctl output create headless
hyprctl monitors
to see the created output, normally HEADLESS-<n>
.hyprctl keyword monitor HEADLESS-<n>,<height>x<width>@60,<horizontal position>x<vertical position>,1
to modify the geometry.wayvnc -o=HEADLESS-<n> --log-level=trace 0.0.0.0:5900
ip a
on the host to show its IP) and port as 5900
. Usually The devices need to be under the same network.What I have done in the past, is to divide the width / height by the current scale in
variables.js
:export const SCREEN_WIDTH = Number(exec(`bash -c "hyprctl monitors -j | gojq '.[].width / .[].scale' | awk '{print int($1+0.5)}'"`)); export const SCREEN_HEIGHT = Number(exec(`bash -c "hyprctl monitors -j | gojq '.[].height / .[].scale' | awk '{print int($1+0.5)}'"`));
However, this approach has some flaws. This approach only works with Hyprland and does not work with multiple monitors. In order to solve this problem, I think there has to be a screen width and a screen height per monitor and the actual screen size after scaling has to be determined.
Thanks a lot!!! This solved my problem as well!
Sorry guys I've been gaming xd
So the issue lies in how when there's non-1 scaling, monitor size is reported as is, but window sizes are scaled. The above commit divides monitor dimensions by its scale (in a non-bash way that's more readable for me), which should solve this
Test please? : )
This unfortunately does not work as well as #436 does for me because Hyprland requires to have a clean divisor for scaling. In my case this is 1.066667 for the resolution 3440x1440. hyprctl monitors -j
reports the rounded scale, which in my case is 1.07. 3440 / 1.07 = 3214.95 when it should be 3440 / 1.066667 = 3225. Because of the wrong calculation, there is now a gap on the side when the session menu is open. GDK
uses the proper scale for the division. Maybe there is also a way to achieve this with hyprctl
. I realize this is a special case, but it would still be nice if it could be solved.
On another note, I can see from the commit log of https://github.com/end-4/dots-hyprland/commit/18de9e2fea19f919dce04c1a6dafa7b49903716a that there have been multiple adjustments made, to set the size of the elements according to the individual monitor, however when testing on a setup with two monitors with different resolutions, it still seems to use the resolution of the first monitor.
So Gdk reports the scaled monitor size? I'll see
okay
I've recently done a full clean install of arch and this install script, and I can confirm scaling works out of the box now. Should've closed this sooner, my apologies!
@DiXN since Gdk doesn't reliably report the scaled monitor size in all cases (causing #537), I made it so that by default manual division is used to get that data
if you ever update, for your case, set userOptions.monitors.scaleMethod
to "gdk"
The issue
EDIT: Forgot to mention, but I'm using
wlr-randr --scale 1.25
As title mentions, for some reason havingxwayland{ force_zero_scaling = true }
messes up with the overview widget, specifically the workspace preview. See image below: