最后活跃于 1710225480

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

修订 61129669361633234d9db19d0cc4aeab5de736d1

trackpoint-toggle.sh 原始文件
1#!/bin/bash
2
3speed="-0.5"
4
5trackp_enabled=$(dconf read /org/gnome/desktop/peripherals/mouse/trackpoint-toggle-on)
6#cur_speed=$(dconf read /org/gnome/desktop/peripherals/mouse/speed)
7
8if [[ "$trackp_enabled" != "'true'" ]]; then
9 dconf write /org/gnome/desktop/peripherals/mouse/accel-profile "'flat'"
10 if [[ "$cur_speed" != "$speed" ]]; then
11 dconf write /org/gnome/desktop/peripherals/mouse/speed -0.5
12 fi
13 dconf write /org/gnome/desktop/peripherals/mouse/trackpoint-toggle-on "'true'"
14else
15 dconf write /org/gnome/desktop/peripherals/mouse/accel-profile "'default'"
16 dconf write /org/gnome/desktop/peripherals/mouse/speed 0
17 dconf reset /org/gnome/desktop/peripherals/mouse/trackpoint-toggle-on
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"