1
0
Fork 0

added open tablet driver setup to osu!lazer setup

This commit is contained in:
Kim, Jimin 2022-05-21 14:29:53 +09:00
parent 5c4eb2b870
commit e9bc91147d
2 changed files with 102 additions and 1 deletions

View file

@ -0,0 +1,61 @@
{
"Profiles": [
{
"Tablet": "Wacom CTL-472",
"OutputMode": {
"Path": "OpenTabletDriver.Desktop.Output.LinuxArtistMode",
"Settings": [],
"Enable": true
},
"Filters": [],
"AbsoluteModeSettings": {
"Display": {
"Width": 1920.0,
"Height": 1080.0,
"X": 960.0,
"Y": 540.0,
"Rotation": 0.0
},
"Tablet": {
"Width": 75.0,
"Height": 42,
"X": 21.0,
"Y": 58.0,
"Rotation": 270.0
},
"EnableClipping": true,
"EnableAreaLimiting": false,
"LockAspectRatio": true
},
"RelativeModeSettings": {
"XSensitivity": 10.0,
"YSensitivity": 10.0,
"RelativeRotation": 0.0,
"RelativeResetDelay": "00:00:00.1000000"
},
"Bindings": {
"TipActivationThreshold": 0.0,
"TipButton": {
"Path": "OpenTabletDriver.Desktop.Binding.MouseBinding",
"Settings": [
{
"Property": "Button",
"Value": "Left"
}
],
"Enable": true
},
"EraserActivationThreshold": 0.0,
"EraserButton": null,
"PenButtons": [null, null],
"AuxButtons": [],
"MouseButtons": [],
"MouseScrollUp": null,
"MouseScrollDown": null
}
}
],
"LockUsableAreaDisplay": true,
"LockUsableAreaTablet": true,
"Tools": []
}

View file

@ -1,6 +1,8 @@
from os.path import exists
from os import system
from src.util import flatpak_install, paru_install
from src.constants import content_dir, home_dir
from src.util import flatpak_install, paru_install, copy_file, silent_system
from src.setup.system import system76_scheduler
name = "osu!lazer"
@ -11,5 +13,43 @@ def setup():
A circle-clicking rhythm game.
"""
# install the game
flatpak_install("sh.ppy.osu")
# give CPU scheduler priority
system76_scheduler.setup()
#
# set up tablet driver
#
paru_install("opentabletdriver-git")
# apply settings
copy_file(
f"{content_dir}{home_dir}/.config/OpenTabletDriver/settings.json",
"~/.config/OpenTabletDriver/settings.json",
)
# disable built-in kernel modules
modules_to_disable = [
"wacom",
"wacom_i2c",
"wacom_w8001",
"hid_uclogic",
]
for name in modules_to_disable:
# Add blacklist rule if it does not exist
silent_system(
f'sudo grep -qxF "blacklist {name}" /etc/modprobe.d/blacklist.conf || echo "blacklist {name}" | sudo tee -a /etc/modprobe.d/blacklist.conf'
)
# remove module from kernel if it's loaded
silent_system(f"sudo rmmod {name}")
# Reload the systemd user unit daemon
system("systemctl --user daemon-reload")
# Enable and start the user service
system("systemctl --user enable opentabletdriver --now")