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