最后活跃于 1710225480

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

修订 0ff854d7e5181a10fdcff837aa5095f22865db4e

trackpoint-toggle.sh 原始文件
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" != "'flat'" ]]; 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
13else
14 dconf write /org/gnome/desktop/peripherals/mouse/accel-profile "'default'"
15 dconf write /org/gnome/desktop/peripherals/mouse/speed 0
16fi
17
18cur_prof=$(dconf read /org/gnome/desktop/peripherals/mouse/accel-profile)
19cur_speed=$(dconf read /org/gnome/desktop/peripherals/mouse/speed)
20
21notify-send --transient "trackpoint-toggle.sh" "Mouse speed settings changed to $cur_speed, profile $cur_prof"