Gnome On Wayland 配置多功能鼠标侧键

参考1:wayland-mouse-mapper

安装libinput、evemu,并下载mousemapper.sh和mousemapper.service。

sudo pacman -S libinput evemu
wget https://github.com/mathportillo/wayland-mouse-mapper/raw/master/mousemapper.sh
wget https://raw.githubusercontent.com/mathportillo/wayland-mouse-mapper/master/mousemapper.service

修改mousemapper.sh默认配置,将鼠标侧键功能改为PAGEUP、PAGEDOWN:

# COMMANDS MAP
# BTN_EXTRA=(KEY_LEFTMETA KEY_PAGEUP)
# BTN_SIDE=(KEY_LEFTMETA KEY_PAGEDOWN)
BTN_EXTRA=(KEY_PAGEUP)
BTN_SIDE=(KEY_PAGEDOWN)

用root权限启动:

chmod +x mousemapper.sh
sudo ./mousemapper.sh

测试发现,按鼠标侧键时,可上下翻页,但浏览器中的网页会切换到上一页或下一页。

参考2:ubuntu 14.04配置多功能鼠标

安装xinput、xev

sudo pacman -S xorg-xinput xorg-xev

然后找到鼠标设备id:

$ xinput list | grep 'id='
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
 ⎡ Virtual core pointer                        id=2    [master pointer  (3)]
 ⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
 ⎜   ↳ xwayland-pointer:17                         id=6    [slave  pointer  (2)]
 ⎜   ↳ xwayland-relative-pointer:17                id=7    [slave  pointer  (2)]
 ⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
     ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
     ↳ xwayland-keyboard:17                        id=8    [slave  keyboard (3)]

猜测鼠标设备id=6。获取其button-map:

$ xinput get-button-map 6
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
1 2 3 4 5 6 7 8 9 10

获取鼠标侧键的键值:

$ xev |grep button
    state 0x0, button 9, same_screen YES
    state 0x0, button 9, same_screen YES
    state 0x0, button 8, same_screen YES
    state 0x0, button 8, same_screen YES

确定两个侧键键值为:上=9,下=8。

设置button-map,屏蔽8和9两个键,避免浏览器前后翻页:

$ xinput set-button-map 6 1 2 3 4 5 6 7 0 0 10

再次测试,功能正常。

最后按mousemapper主页,将其转为service:

sudo cp mousemapper.sh /usr/bin/mousemapper
sudo cp mousemapper.service /usr/lib/systemd/system/
sudo systemctl enable mousemapper.service
sudo systemctl start mousemapper.service

DONE !

How to Enable Fractional Scaling in Ubuntu 19.10 Eoan

This quick tutorial shows how to enable the fractional scaling in Ubuntu 19.10 for both default X and wayland sessions.

The Display settings only offer two scaling values (100% and 200%) by default. For HiDPI displays, you may want fractional scaling values, like 125% or 150%, and here’s how to do the job.

Continue reading “How to Enable Fractional Scaling in Ubuntu 19.10 Eoan”

Ubuntu 11.04 换装 Gnome3 的二三事

Gnome3在月初就正式发布了,当时看着unity不爽,于是乎就开始捣鼓怎么换装Gnome3。

首先是装Gnome3,需要开启PPA源:

sudo add-apt-repository ppa:gnome3-team/gnome3

sudo apt-get update

sudo apt-get install gnome-shell

装好后重启,在GDM登陆窗口选择 gnome-shell 即可进入Gnome3桌面,不过这样做会破坏unity,慎行。

装完进入系统以后,我的桌面主题惨烈的牺牲了,窗体及其丑陋……后来发现Gnome3的默认主题居然没有安装……真是郁闷……放狗找了找,于是有了以下的解决方案:

sudo apt-get remove gnome-accessibility-themes

sudo apt-get install gnome-themes-standard

然后把主题都设成 Adwaita(做这一步是因为我之前改过主题,不过当时没什么效果就是了):

gsettings set org.gnome.desktop.interface gtk-theme Adwaita

gsettings set org.gnome.desktop.interface cursor-theme Adwaita

gsettings set org.gnome.desktop.interface icon-theme Adwaita

于是乎就很美好了。现在用下来发现了一些问题,比如说gnome-shell自带的文本输入框在使用ibus输入中文时不显示选字窗……

[http://wide4.btlogs.com/index.php/archives/407]