Skip to content

Instantly share code, notes, and snippets.

@Panoptik
Created February 23, 2018 15:24
Show Gist options
  • Save Panoptik/49d5c4fd90ce9e48811c59e2c37c73ee to your computer and use it in GitHub Desktop.
Save Panoptik/49d5c4fd90ce9e48811c59e2c37c73ee to your computer and use it in GitHub Desktop.
Ubuntu patch xorg for hotkey to be applied on keypress instead of keydown
#!/bin/bash
# Bug https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1683383
# Original article https://habrahabr.ru/post/87408/
# create directory
mkdir xorg-server
cd xorg-server
# get sources of required package
# may be need to uncomment 'deb-src' lines in sources.list before
apt-get source xserver-xorg-core-hwe-16.04
# install dependencies required for building
sudo apt-get build-dep xserver-xorg-core-hwe-16.04
# download patch
wget https://bugs.freedesktop.org/attachment.cgi?id=129861
# apply patch
patch xorg-server-hwe-16.04-1.19.5/xkb/xkbActions.c < attachment.cgi\?id\=129861
# build
cd xorg-server-hwe-16.04-1.19.5/
debuild -us -uc
cd ..
# install patched package
sudo dpkg -i ./xserver-xorg-core-hwe-16.04_1.19.5-0ubuntu2~16.04.1_amd64.deb
# pin version of this package to prevent updating later
cat <<EOF>> /etc/apt/preferences.d/xserver-xorg-core-hwe
Package: xserver-xorg-core-hwe-16.04
Pin: version 2:1.19.3-1ubuntu1~16.04.2
Pin-Priority: 700
EOF
# check that pinning works properly
apt-cache policy xserver-xorg-core-hwe-16.04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment