解决ubuntu鼠标滚轮速度过快慢(修改鼠标滚轮速度)

it2025-02-05  9

文章目录

方法图示安装imwheel运行脚本直接粘贴到命令行保存为文件 参考

方法图示

#mermaid-svg-icp2JljtGWyp8VSn .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-icp2JljtGWyp8VSn .label text{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn .node rect,#mermaid-svg-icp2JljtGWyp8VSn .node circle,#mermaid-svg-icp2JljtGWyp8VSn .node ellipse,#mermaid-svg-icp2JljtGWyp8VSn .node polygon,#mermaid-svg-icp2JljtGWyp8VSn .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-icp2JljtGWyp8VSn .node .label{text-align:center;fill:#333}#mermaid-svg-icp2JljtGWyp8VSn .node.clickable{cursor:pointer}#mermaid-svg-icp2JljtGWyp8VSn .arrowheadPath{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-icp2JljtGWyp8VSn .flowchart-link{stroke:#333;fill:none}#mermaid-svg-icp2JljtGWyp8VSn .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-icp2JljtGWyp8VSn .edgeLabel rect{opacity:0.9}#mermaid-svg-icp2JljtGWyp8VSn .edgeLabel span{color:#333}#mermaid-svg-icp2JljtGWyp8VSn .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-icp2JljtGWyp8VSn .cluster text{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-icp2JljtGWyp8VSn .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-icp2JljtGWyp8VSn text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-icp2JljtGWyp8VSn .actor-line{stroke:grey}#mermaid-svg-icp2JljtGWyp8VSn .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-icp2JljtGWyp8VSn .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-icp2JljtGWyp8VSn #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-icp2JljtGWyp8VSn .sequenceNumber{fill:#fff}#mermaid-svg-icp2JljtGWyp8VSn #sequencenumber{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn #crosshead path{fill:#333;stroke:#333}#mermaid-svg-icp2JljtGWyp8VSn .messageText{fill:#333;stroke:#333}#mermaid-svg-icp2JljtGWyp8VSn .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-icp2JljtGWyp8VSn .labelText,#mermaid-svg-icp2JljtGWyp8VSn .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-icp2JljtGWyp8VSn .loopText,#mermaid-svg-icp2JljtGWyp8VSn .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-icp2JljtGWyp8VSn .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-icp2JljtGWyp8VSn .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-icp2JljtGWyp8VSn .noteText,#mermaid-svg-icp2JljtGWyp8VSn .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-icp2JljtGWyp8VSn .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-icp2JljtGWyp8VSn .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-icp2JljtGWyp8VSn .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-icp2JljtGWyp8VSn .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn .section{stroke:none;opacity:0.2}#mermaid-svg-icp2JljtGWyp8VSn .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-icp2JljtGWyp8VSn .section2{fill:#fff400}#mermaid-svg-icp2JljtGWyp8VSn .section1,#mermaid-svg-icp2JljtGWyp8VSn .section3{fill:#fff;opacity:0.2}#mermaid-svg-icp2JljtGWyp8VSn .sectionTitle0{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn .sectionTitle1{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn .sectionTitle2{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn .sectionTitle3{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-icp2JljtGWyp8VSn .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn .grid path{stroke-width:0}#mermaid-svg-icp2JljtGWyp8VSn .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-icp2JljtGWyp8VSn .task{stroke-width:2}#mermaid-svg-icp2JljtGWyp8VSn .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn .taskText:not([font-size]){font-size:11px}#mermaid-svg-icp2JljtGWyp8VSn .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-icp2JljtGWyp8VSn .task.clickable{cursor:pointer}#mermaid-svg-icp2JljtGWyp8VSn .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-icp2JljtGWyp8VSn .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-icp2JljtGWyp8VSn .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-icp2JljtGWyp8VSn .taskText0,#mermaid-svg-icp2JljtGWyp8VSn .taskText1,#mermaid-svg-icp2JljtGWyp8VSn .taskText2,#mermaid-svg-icp2JljtGWyp8VSn .taskText3{fill:#fff}#mermaid-svg-icp2JljtGWyp8VSn .task0,#mermaid-svg-icp2JljtGWyp8VSn .task1,#mermaid-svg-icp2JljtGWyp8VSn .task2,#mermaid-svg-icp2JljtGWyp8VSn .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-icp2JljtGWyp8VSn .taskTextOutside0,#mermaid-svg-icp2JljtGWyp8VSn .taskTextOutside2{fill:#000}#mermaid-svg-icp2JljtGWyp8VSn .taskTextOutside1,#mermaid-svg-icp2JljtGWyp8VSn .taskTextOutside3{fill:#000}#mermaid-svg-icp2JljtGWyp8VSn .active0,#mermaid-svg-icp2JljtGWyp8VSn .active1,#mermaid-svg-icp2JljtGWyp8VSn .active2,#mermaid-svg-icp2JljtGWyp8VSn .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-icp2JljtGWyp8VSn .activeText0,#mermaid-svg-icp2JljtGWyp8VSn .activeText1,#mermaid-svg-icp2JljtGWyp8VSn .activeText2,#mermaid-svg-icp2JljtGWyp8VSn .activeText3{fill:#000 !important}#mermaid-svg-icp2JljtGWyp8VSn .done0,#mermaid-svg-icp2JljtGWyp8VSn .done1,#mermaid-svg-icp2JljtGWyp8VSn .done2,#mermaid-svg-icp2JljtGWyp8VSn .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-icp2JljtGWyp8VSn .doneText0,#mermaid-svg-icp2JljtGWyp8VSn .doneText1,#mermaid-svg-icp2JljtGWyp8VSn .doneText2,#mermaid-svg-icp2JljtGWyp8VSn .doneText3{fill:#000 !important}#mermaid-svg-icp2JljtGWyp8VSn .crit0,#mermaid-svg-icp2JljtGWyp8VSn .crit1,#mermaid-svg-icp2JljtGWyp8VSn .crit2,#mermaid-svg-icp2JljtGWyp8VSn .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-icp2JljtGWyp8VSn .activeCrit0,#mermaid-svg-icp2JljtGWyp8VSn .activeCrit1,#mermaid-svg-icp2JljtGWyp8VSn .activeCrit2,#mermaid-svg-icp2JljtGWyp8VSn .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-icp2JljtGWyp8VSn .doneCrit0,#mermaid-svg-icp2JljtGWyp8VSn .doneCrit1,#mermaid-svg-icp2JljtGWyp8VSn .doneCrit2,#mermaid-svg-icp2JljtGWyp8VSn .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-icp2JljtGWyp8VSn .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-icp2JljtGWyp8VSn .milestoneText{font-style:italic}#mermaid-svg-icp2JljtGWyp8VSn .doneCritText0,#mermaid-svg-icp2JljtGWyp8VSn .doneCritText1,#mermaid-svg-icp2JljtGWyp8VSn .doneCritText2,#mermaid-svg-icp2JljtGWyp8VSn .doneCritText3{fill:#000 !important}#mermaid-svg-icp2JljtGWyp8VSn .activeCritText0,#mermaid-svg-icp2JljtGWyp8VSn .activeCritText1,#mermaid-svg-icp2JljtGWyp8VSn .activeCritText2,#mermaid-svg-icp2JljtGWyp8VSn .activeCritText3{fill:#000 !important}#mermaid-svg-icp2JljtGWyp8VSn .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-icp2JljtGWyp8VSn g.classGroup text .title{font-weight:bolder}#mermaid-svg-icp2JljtGWyp8VSn g.clickable{cursor:pointer}#mermaid-svg-icp2JljtGWyp8VSn g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-icp2JljtGWyp8VSn g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-icp2JljtGWyp8VSn .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-icp2JljtGWyp8VSn .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-icp2JljtGWyp8VSn .dashed-line{stroke-dasharray:3}#mermaid-svg-icp2JljtGWyp8VSn #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn .commit-id,#mermaid-svg-icp2JljtGWyp8VSn .commit-msg,#mermaid-svg-icp2JljtGWyp8VSn .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-icp2JljtGWyp8VSn g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-icp2JljtGWyp8VSn g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-icp2JljtGWyp8VSn g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-icp2JljtGWyp8VSn .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-icp2JljtGWyp8VSn .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-icp2JljtGWyp8VSn .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-icp2JljtGWyp8VSn .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-icp2JljtGWyp8VSn .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-icp2JljtGWyp8VSn .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-icp2JljtGWyp8VSn .edgeLabel text{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-icp2JljtGWyp8VSn .node circle.state-start{fill:black;stroke:black}#mermaid-svg-icp2JljtGWyp8VSn .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-icp2JljtGWyp8VSn #statediagram-barbEnd{fill:#9370db}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-state .divider{stroke:#9370db}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-icp2JljtGWyp8VSn .note-edge{stroke-dasharray:5}#mermaid-svg-icp2JljtGWyp8VSn .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-icp2JljtGWyp8VSn .error-icon{fill:#522}#mermaid-svg-icp2JljtGWyp8VSn .error-text{fill:#522;stroke:#522}#mermaid-svg-icp2JljtGWyp8VSn .edge-thickness-normal{stroke-width:2px}#mermaid-svg-icp2JljtGWyp8VSn .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-icp2JljtGWyp8VSn .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-icp2JljtGWyp8VSn .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-icp2JljtGWyp8VSn .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-icp2JljtGWyp8VSn .marker{fill:#333}#mermaid-svg-icp2JljtGWyp8VSn .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-icp2JljtGWyp8VSn { color: rgba(0, 0, 0, 0.75); font: ; } 安装imwhell 运行脚本 点击修改 修改结束

安装imwheel

```bash sudo apt install imwheel

运行脚本

两种方法

直接粘贴到命令行

将下面代码粘贴到命令行运行,会出现一个修改鼠标滚轮速度的按钮,修改以下即可。博主速度为7,注意这里点了按钮后还需要将imwheel -kill敲进去才算修改完成。

#!/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

保存为文件

将上面一小节的代码保存到文件中,然后给文件可运行权限(change mode to,并在终端中运行。 如保存为change_mouse_wheel.run, 然后在保存的目录中修改权限

sudo chmod +x /your/path/to/file/change_mouse_wheel.run

最后命令行运行

/your/path/to/file/change_mouse_wheel.run

需要注意的是即便在当前目录下也需要写明./change_mouse_wheel.run

参考

https://dev.to/bbavouzet/ubuntu-20-04-mouse-scroll-wheel-speed-536o

最新回复(0)