OK so these are what I did on the weekend.
1. Changing config with autocomplete config file name script:
Simple create a .sh (ex: change_config.sh) file and set permission for it to 755.
Code: Select all
#!/bin/bash
echo -n "Enter config file name: "
cd .gimx/config/
read -e filename
sudo cp /root/.gimx/config/$filename /root/.gimx/config/active.xml
sudo systemctl stop gimx
sudo systemctl start gimx
Run command:
When RPi ask for input config name, you can input first characters then press TAB for autocomplete whole file name if its name was too long. You can also press TAB 2 times to see all configs.
2. Quick modify mouse DPI and sensitivy:
You need to create 2 files: 1 bash script and 1 python script. For ex: run_config_mouse.sh and config_mouse.py, remember to set permission to 755 both
run_config_mouse.sh
Code: Select all
#!/bin/bash
sudo systemctl stop gimx
python config_mouse.py
sudo systemctl start gimx
config_mouse.py
Code: Select all
#!/usr/bin/python
import xml.etree.ElementTree as ET
tree = ET.parse('.gimx/config/active.xml')
root = tree.getroot()
print "\n\n\n========================================================================="
print "============= QUICK MOFIDY MOUSE DPI AND SENSITIVITY TOOL ==============="
print "========================================================================="
for controller in root.findall('controller[@id="1"]'):
controllervalue = controller.get('dpi')
print "\nCurrent DPI value: ",controllervalue
while True:
try:
dpivl = int(raw_input("Enter new DPI value: "))
except ValueError:
print("\nInvalid value! Must be number. Please re-enter new DPI value: ")
else:
controller.set('dpi',str(dpivl))
break
for eventy in root.findall('./controller[@id="1"]/configuration[@id="1"]/axis_map/axis[@label="Aiming - y axis"]/event'):
sensy = eventy.get('multiplier')
print "\nCurrent sensitivity value (Hip Fire): ",sensy
while True:
try:
sensvl = float(raw_input("Enter new sensitivity value (Hip Fire): "))
except ValueError:
print("\nInvalid value! Must be number. Please re-enter new sensitivity value: ")
else:
eventy.set('multiplier',str(sensvl))
break
for eventx in root.findall('./controller[@id="1"]/configuration[@id="1"]/axis_map/axis[@label="Aiming - x axis"]/event'):
eventx.set('multiplier',str(sensvl))
for eventy2 in root.findall('./controller[@id="1"]/configuration[@id="2"]/axis_map/axis[@label="Aiming - y axis"]/event'):
sensy2 = eventy2.get('multiplier')
print "\nCurrent sensitivity value (ADS): ",sensy2
while True:
try:
sensvl2 = float(raw_input("Enter new sensitivity value (ADS): "))
except ValueError:
print("\nInvalid value! Must be number. Please re-enter new sensitivity value: ")
else:
eventy2.set('multiplier',str(sensvl2))
break
for eventx2 in root.findall('./controller[@id="1"]/configuration[@id="2"]/axis_map/axis[@label="Aiming - x axis"]/event'):
eventx2.set('multiplier',str(sensvl2))
print "\nConfig has been saved!!"
#=====================Write value back into config=====================
tree.write('.gimx/config/active.xml', encoding="UTF-8")
Run command:
RPi will show prev DPI and sensitivty, you only need to input new values. RPi will also restart gimx service after that.
Now what you need is just a smartphone with any ssh application to control Pi from there.
Have fun