Last active 1710225480

Quick script to toggle between a profile suitable for trackpoint and a regular mouse in GNOME

Revision 7669701ba5055eb3f643f7bcb284d8465bad0284

trackpoint-toggle.sh Raw
1#!/bin/bash
2
3speed="-0.5"
4
5cur_prof=$(dconf read /org/gnome/desktop/peripherals/mouse/accel-profile)
6cur_speed=$(dconf read /org/gnome/desktop/peripherals/mouse/speed)
7
8if [[ "$cur_prof" == "'default'" ]]; then
9 dconf write /org/gnome/desktop/peripherals/mouse/accel-profile "'flat'"
10else
11 dconf write /org/gnome/desktop/peripherals/mouse/accel-profile "'default'"
12fi
13
14if [[ "$cur_speed" != "$speed" ]]; then
15 dconf write /org/gnome/desktop/peripherals/mouse/speed -0.5
16else
17 dconf write /org/gnome/desktop/peripherals/mouse/speed 0
18fi
19
20cur_prof=$(dconf read /org/gnome/desktop/peripherals/mouse/accel-profile)
21cur_speed=$(dconf read /org/gnome/desktop/peripherals/mouse/speed)
22
23notify-send --transient "trackpoint-toggle.sh" "Mouse speed settings changed to $cur_speed, profile $cur_prof"