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

1. 安装xbindkeys、xdotool

sudo pacman -S xbindkeys xdotool

2. 生成默认的xbindkeys配置文件:

$ xbindkeys -d > ~/.xbindkeysrc

3. 编辑~/.xbindkeysrc,定义鼠标侧键功能。增加如下定义:

"xdotool key --clearmodifiers Page_Up"
 b:9
 "xdotool key --clearmodifiers Page_Down"
 b:8

4. 设置xbindkeys自启动。编辑~/.xprofile,内容如下:

#!/bin/bash
xbindkeys &

参考:

https://wiki.archlinux.org/index.php/Xbindkeys

http://zzss.cf/?p=5290

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”

用rm递归递归删除子目录下所有.o后缀文件

1. 递归删除文件

find . -name “*.o”  | xargs rm -f


可以通过管道命令来操作,先find出主目录 下想删除的文件,然后通过“xargs”这个构造参数列表并运行命令。

find named/ -name *.bak | xargs rm -f

2. 递归删除目录

目录的话,需要添加 -r

find . -name “Build”  | xargs rm -rf


https://blog.csdn.net/skylin19840101/article/details/75099240

HOW TO DOWNLOAD THE LATEST RELEASE FROM GITHUB

GitHub Releases are a great resource for open source projects to expand on the simple git tag concept. You can add release notes in Markdown format, and you can upload finalized assets – such as compiled executables.

As a user I had the question – how do I script “download the latest release, please?”

Continue reading “HOW TO DOWNLOAD THE LATEST RELEASE FROM GITHUB”

manjaro-xfce使用鼠标侧键

1. 安装xbindkeys和xdotool

pacman -S xbindkeys xdotool xorg-xev

2. 找到鼠标侧键键码

xev

点击两个鼠标侧键,输出为:

ButtonPress event, serial 37, synthetic NO, window 0x4600001,
     root 0x16a, subw 0x0, time 2359097, (105,76), root:(816,450),
     state 0x0, button 9, same_screen YES
 ButtonRelease event, serial 37, synthetic NO, window 0x4600001,
     root 0x16a, subw 0x0, time 2359243, (105,76), root:(816,450),
     state 0x0, button 9, same_screen YES
 ButtonPress event, serial 37, synthetic NO, window 0x4600001,
     root 0x16a, subw 0x0, time 2370571, (105,76), root:(816,450),
     state 0x0, button 8, same_screen YES
 ButtonRelease event, serial 37, synthetic NO, window 0x4600001,
     root 0x16a, subw 0x0, time 2370691, (105,76), root:(816,450),
     state 0x0, button 8, same_screen YES

其中,button 9为上键,button 8为下键。

3. 编辑.xbindkeysrc文件

xbindkeys -d > ~/.xbindkeysrc
vim ~/.xbindkeyrc

在文件中加入:

"xdotool key Page_Up"
  b:9
"xdotool key Page_Down"
  b:8

保存退出,测试:

xbindkeys -p

侧键翻页功能生效。

4. 加入自启动

编辑~/.xprofile文件,加入一行:

xbindkeys


https://forum.manjaro.org/t/how-do-i-set-up-extra-mouse-buttons/59291

GcmForMojo服务端架设

 GcmForMojo在酷安的介绍

这是一个GCM/小米/华为/魅族推送消息接受程序,需要将令牌写入服务端配合Mojo-Webqq和Mojo-Weixin一起使用。

将QQ和微信的消息通过FCM/GCM/MiPush/HwPush/MzPush推送到你的手机。

建议华为手机使用华为推送(可单独安装华为移动服务共享通道)、Miui系统使用MiPush、魅族Flyme使用MzPush时,使用写轮眼禁用其他的后台推送服务。

Continue reading “GcmForMojo服务端架设”