This repository has been archived on 2022-06-01. You can view files and clone it, but cannot push or open issues or pull requests.
gnome-fs-duplicate-cursor-fix/README.md

83 lines
3.2 KiB
Markdown
Raw Permalink Normal View History

2020-10-18 17:41:43 +02:00
# GNOME Fractional Scaling duplicate cursor fix
2022-05-31 00:09:31 +02:00
Fix Ubuntu/GNOME's "duplicate cursor" fractional scaling bug.
**Warning**: this tool is no longer maintained. I have moved to another distro and have no time to track GNOME's upstream neglected bugs.
2020-10-18 17:41:43 +02:00
# How to install
1. **Enable X11 fractional scaling:**
```
gsettings set org.gnome.mutter experimental-features "['x11-randr-fractional-scaling']"
```
2. **Configure your monitors accordingly:**
- Go to "System Settings" -> "Monitors" and move/scale them to your preference.
3. **Install Java:**
```
sudo apt install default-jre
```
4. **Download latest version of .JAR file from releases:**
2020-10-18 17:59:14 +02:00
```
wget -O ~/ScreenScalingFixer.jar https://github.com/mind-overflow/gnome-fs-duplicate-cursor-fix/releases/download/v1.0/ScreenScalingFixer-1.0-SNAPSHOT.jar
```
2020-10-18 17:41:43 +02:00
5. **Create a directory in your home folder and put the JAR file inside of it:**
```
mkdir ~/screen-scaling-fixer/
2020-10-18 17:59:14 +02:00
mv ~/ScreenScalingFixer.jar ~/screen-scaling-fixer/ScreenScalingFixer.jar
2020-10-18 17:41:43 +02:00
```
6. **Create a startup script:**
```
2020-10-18 17:46:41 +02:00
echo "sh -c \"cd ~/screen-scaling-fixer/ && java -jar ~/screen-scaling-fixer/ScreenScalingFixer.jar\"" > ~/screen-scaling-fixer/start.sh
2020-10-18 17:41:43 +02:00
chmod +x ~/screen-scaling-fixer/start.sh
```
7. **Enable the startup script:**
```
2020-10-18 17:51:27 +02:00
printf \
2020-10-18 17:50:14 +02:00
"[Desktop Entry]\n\
Name=fs-fixer\n\
GenericName=fs-fixer\n\
Comment=fix gnome scaling duplicate cursor\n\
Exec=sh -c ~/screen-scaling-fixer/start.sh\n\
Terminal=false\n\
Type=Application\n\
X-GNOME-Autostart-enabled=true\n\
X-GNOME-Autostart-Delay=1\n" > ~/.config/autostart/fractional-scaling-fix.desktop
2020-10-18 17:41:43 +02:00
chmod +x ~/.config/autostart/fractional-scaling-fix.desktop
```
8. **Run the JAR file and let config.yml generate:**
```
cd ~/screen-scaling-fixer
./start.sh
```
9. **Edit config.yml accordingly:**
```yaml
2020-10-18 18:06:12 +02:00
enable: false # set this to true, or the script won't run!
2020-10-18 17:41:43 +02:00
delay: 2000 # chose how long to wait after login before restarting GNOME.
monitor-connector: 'DisplayPort-1' # chose ONE monitor that requires fractional scaling to be enabled. Don't worry if you have multiple ones.
scale: 1.5 # set the desired fractional scale.
```
*Explanation:*
- `delay`: this is mandatory, because if you try restarting GNOME without any delay after login, it will not be restarted. Waiting a few seconds (~2) should be enough.
- `monitor-connector`: this is a monitor that requires fractional scaling. You should be able to gather its connector name by using command `xrandr`.
- `scale`: the scale of the chosen monitor. if you have multiple monitors, just chose one, as we only need to apply those changes to a single one to fix it for everyone else.
10. **Final step: log out and log back in.**
# How this works
The concept behind this fix is simple.
2020-10-18 18:04:24 +02:00
If you enabled the experimental fractional-scaling feature in eg. Ubuntu 20.04, you probably noticed that, upon login, a dead cursor gets stuck on screen, and a second bigger one appears.
2020-10-18 17:41:43 +02:00
This problem is fixed, however, if you switch back to 1.0x scale, apply, and then get back to your desired one.
2022-05-31 00:09:31 +02:00
To automate this process, I developed a small Java tool that automatically does it after logging in.
2020-10-18 17:41:43 +02:00
You simply have to input your screen settings in config.yml, logout, re-login and you should notice your screen flashing twice.
The dead cursor should disappear.