Last active
August 29, 2015 14:02
-
-
Save anroots/259cdb7c6e28b36ca711 to your computer and use it in GitHub Desktop.
razercfg udev rule to automatically set DPI when the mouse is connected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# UDEV rules for razer devices | |
# Change script path! | |
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0015", RUN+="/home/david/bin/razer-connect.sh" | |
ACTION=="remove", SUBSYSTEM=="usb", RUN+="/usr/local/bin/razercfg -B -S1 -s" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is run by udev when Razer Naga mouse is connected. | |
# Sets the DPI and displays a message on notify-send | |
export DISPLAY=:0 | |
# Scan resolution (*1000) | |
RES=30 | |
# Show a message via notify-send, including icon | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
notify-send 'Razer Naga Connected' "Resolution set to $RES DPI" -i "$DIR/razer-connect.ico" | |
# Set scan resolution | |
razercfg -r "1:$RES" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment