使用 super + space 切换语言时 Numlock 灯会熄灭

使用 super + space 切换语言时 Numlock 灯会熄灭

每当我将语言从英语切换到另一种语言时,我的 Num Lock 灯就会熄灭,但我仍然可以使用它。我知道这是 Ubuntu 14.04 LTS 的一个错误。但是有补丁吗?

答案1

错误报告是这里。 Egmont Koblinger 写了一篇修补(请参阅错误报告的评论 #22)。我不切换语言,所以没有测试它,但其他用户报告说它可以工作。

下载它并使用以下步骤重建 xorg-server(正如 Egmont 在他的评论中所概述的那样):

sudo apt-get install build-essential fakeroot dpkg-dev
mkdir build
cd build
apt-get source xorg-server
sudo apt-get build-dep xorg-server
cd xorg-server-1.15.1
cp ~/Downloads/xorg-server-xkb-numlock.patch debian/patches/ # replace Downloads appropriately
echo xorg-server-xkb-numlock.patch >> debian/patches/series
dpkg-buildpackage -rfakeroot -b
cd ..
sudo dpkg -i xserver-common_1.15.1-0ubuntu2_all.deb xserver-xorg-core_1.15.1-0ubuntu2_amd64.deb

另请参阅 dimitronic 在该报告中的第 27 条评论,了解替代方法,尽管它是一个脚本,而不是您要求的补丁。我已将其复制到下面:

1)mkdir ~/keyfix ; cd ~/keyfix

2)open a file show_layout.sh and copy and paste this: " setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}' " (without the first and the last ")

3)open a file keyfix.sh and copy and paste this:
s=0
s1=0
while test "1" == "1"
do

s=`$HOME/keyfix/show_layout.sh`

sleep 0.001s

if test "$s" != "$s1"
then

numlockx off
numlockx on

#if test "$s" == "alt_layout"
#then
#xset led named "Scroll Lock"
#else
#xset -led named "Scroll Lock"
#fi

fi

s1=`$HOME/keyfix/show_layout.sh`

if test "$s" != "$s1"
then

numlockx off
numlockx on

#if test "$s" == "alt_layout"
#then
#xset led named "Scroll Lock"
#else
#xset -led named "Scroll Lock"
#fi

fi
sleep 0.01s

done
********************
if you want to turn on scroll lock when you use alternative layout, remove the #'s and change alt_layout to your alternative layout i.e. "gr" or "us"
**************************

3)open a file disown_easy.sh and copy and paste this:
#!/bin/bash
$1 &
P=`which $1`
disown `pidof ${P}`

4)open a file run-keyfix and copy and paste this:
$HOME/keyfix/disown_easy.sh $HOME/keyfix/keyfix.sh

5) open a terminal and type:
 chmod +x ~/keyfix/* ; sudo cp ~/keyfix/run-keyfix /usr/bin/

6)make the script run-keyfix to run on startup! (go to startup applications and add it)

THIS IS NOT A SOLUTION! THIS IS A STUPID FIX!

*don't use these scripts to make weapons!

相关内容