First, I also find it annoying that these warnings show up on an out-of-the-box Ubuntu, with no "proper" method to disable them which I could find (it seems that the most common "solution" is either to install gir1.2-gtksource-3.0
which doesn't seem to work since it's already installed, or to ignore them - but I want to suppress them completely since they just make my terminal noisy).
I came up with the following code which so far seems to behave exactly how I'd expect it to, and is based on the answer by TuKsn, but enhances it a bit to:
- Work by default (
gedit ...
) without needing to use F12 or some other shortcut (to invoke unfiltered use /usr/bin/gedit ...
).
- Displays the entered command name when it terminates as a background task.
Can still be generalized a bit, but for now, if you need the same treatment for other commands, duplicate the gedit()
function for each other command name which needs the same filter.
# solution adapted from: http://askubuntu.com/questions/505594
# TODO: use a list of warnings instead of cramming all of them to a single grep.
# TODO: generalize gedit() to allow the same treatment for several commands
# without duplicating the function with only a different name
# output filter. takes: name_for_history some_command [arguments]
# the first argument is required both for history, but also when invoking to bg
# such that it shows Done <name> ... instead of e.g. Done /usr/bin/gedit ...
suppress-gnome-warnings() {
# $1 is the name which should appear on history but is otherwise unused.
historyName=$1
shift
if [ -n "$*" ]; then
# write the real command to history without the prefix
# syntax adapted from http://stackoverflow.com/questions/4827690
history -s "$historyName ${@:2}"
# catch the command output
errorMsg=$( $* 2>&1 )
# check if the command output contains not a (one of two) GTK-Warnings
if ! $(echo $errorMsg | grep -q 'Gtk-WARNING\|connect to accessibility bus'); then
echo $errorMsg
fi
fi
}
gedit() {
suppress-gnome-warnings $FUNCNAME $(which $FUNCNAME) $@
}
And a better version (way smaller, fully generic, no need to rewrite history since invoked as is, and better for filtering per line rather than the whole output):
# generates a function named $1 which:
# - executes $(which $1) [with args]
# - suppresses output lines which match $2
# e.g. adding: _supress echo "hello\|world"
# will generate this function:
# echo() { $(which echo) "$@" 2>&1 | tr -d '\r' | grep -v "hello\|world"; }
# and from now on, using echo will work normally except that lines with
# hello or world will not show at the output
# to see the generated functions, replace eval with echo below
# the 'tr' filter makes sure no spurious empty lines pass from some commands
_supress() {
eval "$1() { \$(which $1) \"\$@\" 2>&1 | tr -d '\r' | grep -v \"$2\"; }"
}
_supress gedit "Gtk-WARNING\|connect to accessibility bus"
_supress gnome-terminal "accessibility bus\|stop working with a future version"
_supress firefox "g_slice_set_config"
I recently purchased an X1 Carbon 3rd generation. I fought the issues you mention plus a few more. I kept a text log of all of the fixes and post as follows -
TrackPad Buttons:
vertical and horizontal scrolling
http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint#Configuration_using_xinput
create /usr/share/xsessions/mouse.sh
(sudo chmod +x mouse.sh
) with the following content:
xinput set-prop "PS/2 Synaptics TouchPad" "Evdev Wheel Emulation" 1
xinput set-prop "PS/2 Synaptics TouchPad" "Evdev Wheel Emulation Button" 2
xinput set-prop "PS/2 Synaptics TouchPad" "Evdev Wheel Emulation Timeout" 200
xinput set-prop "PS/2 Synaptics TouchPad" "Evdev Wheel Emulation Axes" 6 7 4 5
Backlight Brightness
http://ppa.launchpad.net/indicator-brightness/ppa/ubuntu/pool/main/i/indicator-brightness/
fingerprint reader
http://www.saltycrane.com/blog/2014/12/setting-lenovo-thinkpad-x1-carbon-2nd-gen-fingerprint-reader-ubuntu-1404/
$ sudo apt-get install libmagickcore-dev
$ sudo apt-get install libusb-1.0.0-dev libnss3-dev libglib2.0-dev
$ sudo apt-get install libxv-dev
$ sudo apt-get install libtool
$ sudo apt-get install fprintd
$ sudo apt-get install automake
$ cd ~/Downloads
$ unzip fprint_vfs5011-faa090818200ca3ea6bfac8bb510e5e01a246c34.zip
$ cd fprint_vfs5011-faa090818200ca3ea6bfac8bb510e5e01a246c34
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ sudo cp /lib/udev/rules.d/40-libfprint0.rules /etc/udev/rules.d/
$ sudo vi /etc/udev/rules.d/40-libfprint0.rules
# Validity VFS5011
SUBSYSTEM=="usb", ATTRS{idVendor}=="138a", ATTRS{idProduct}=="0017", ATTRS{dev}=="*", ATTR{power/control}="auto", MODE="0664", GROUP="plugdev"
$ sudo apt-add-repository ppa:fingerprint/fingerprint-gui
$ sudo apt-get update
$ sudo apt-get install libbsapi policykit-1-fingerprint-gui fingerprint-gui
$ fingerprint-gui
wifi disable 11N
Best Answer
It seems a lot of issues have been raised regarding input problems lately: ibus issue
Try going to
This is a workaround until a definitive fix is released.
Cheers