前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >打造前端 Deepin Linux 工作环境——调节鼠标滚轮速度

打造前端 Deepin Linux 工作环境——调节鼠标滚轮速度

作者头像
FungLeo
发布2018-01-08 14:40:30
2.3K0
发布2018-01-08 14:40:30
举报

打造前端 Deepin Linux 工作环境——调节鼠标滚轮速度

deepin 的系统设置里面,没有找到鼠标滚轮速度调节的选项。但是默认情况下,其滚轮的速度又特别的慢。经过一番搜索,终于解决了这个问题。

安装 imwheel

首先执行

代码语言:javascript
复制
sudo apt-get install imwheel -y

安装 imwheel 软件。

创建调整脚本

代码语言:javascript
复制
# 创建自定义脚本目录
mkdir ~/.bin/
# 创建并编辑我们的脚本文件
vim ~/.bin/setwheel

然后在文件中粘贴进去以下代码:

代码语言:javascript
复制
#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
#
### see if imwheel config exists, if not create it ###
if [ ! -f ~/.imwheelrc ]
then

cat >~/.imwheelrc<<EOF
".*"
None,      Up,   Button4, 1
None,      Down, Button5, 1
Control_L, Up,   Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L,   Up,   Shift_L|Button4
Shift_L,   Down, Shift_L|Button5
EOF

fi
##########################################################

CURRENT_VALUE=$(awk -F 'Button4,' '{print $2}' ~/.imwheelrc)

NEW_VALUE=$(zenity --scale --window-icon=info --ok-label=Apply --title="Wheelies" --text "Mouse wheel speed:" --min-value=1 --max-value=100 --value="$CURRENT_VALUE" --step 1)

if [ "$NEW_VALUE" == "" ];
then exit 0
fi

sed -i "s/\($TARGET_KEY *Button4, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button4, and write new value.
sed -i "s/\($TARGET_KEY *Button5, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button5, and write new value.

cat ~/.imwheelrc
imwheel -kill

# END OF SCRIPT FILE

粘贴进去以上代码之后,再运行下面的命令:

代码语言:javascript
复制
# 给运行权限
chmod +x ~/.bin/setwheel
# 将 ~/.bin/ 目录加入系统程序执行目录并立即生效
echo 'export PATH="$PATH:~/.bin"' >> ~/.bash_profile && . ~/.bash_profile
# 运行脚本
setwheel

然后就会打开如下图的设置面板

setwheel
setwheel

我设置到3,你可以根据自己的情况进行设置。

参考资料:http://www.nicknorton.net/

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017-11-05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 打造前端 Deepin Linux 工作环境——调节鼠标滚轮速度
    • 安装 imwheel
      • 创建调整脚本
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档