Synapict and gparted – cannot open display

When I try to open synaptic or gparted in Ubuntu 17.10, I run into problems. The error looks like this

No protocol specified
Unable to init server: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt

(synaptic:8832): Gtk-WARNING **: cannot open display: :0

To solve the problem, simple use the following command

xhost +SI:localuser:root

Thanks to https://askubuntu.com/questions/961967/why-dont-gksu-gksudo-or-launching-a-graphical-application-with-sudo-work-with-w

URL link in linux

It is possible to create URL links in linux (well, I only have tested in in nautilus) to open in in browser by clicking.

This goes rather easily, but needs the right contents (link only is not sufficient). One can open a text editor and create a .desktop file. (i named it ethz-link.destkop). Important is the URL parameter

Now step by step

  • Open a text editor, for example gedit
  • Put the following content in the file

[Desktop Entry]
Encoding=UTF-8
Name=ETH Homepage
Type=Link
URL=https://www.ethz.ch
Icon=text-html

  • Change the URL parameter and the Name according to your purpose
  • Save it with the a .desktop extension, for example ethz-link.desktop

Deactivate avahi daemon

I have updated my Ubuntu Gnome to version 16.10. Since then I get annoyed by the “printer detection system”. In the notification bar, a notification appeared about a newly detected printer. It even was added to the Printer list and couldn’t be removed in the CUPS administration menu (http://localhost:631)

After some search, I’ve found that the responsible service is the avahi-daemon (which also crashed periodically). The avahi daemon gets started on boot time and is hard to stop. On my machine (Ubuntu Gnome 16.10, Kernel 4.8.0-26-generic), the following command worked out well:

sudo systemctl disable avahi-daemon.service

Since then, I haven’t seen any notification about new printer nor seen any side effects.

Thanks to Stackexchange, http://unix.stackexchange.com/questions/255197/how-to-disable-avahi-daemon-without-uninstalling-it.

More infos about the SystemD and the old SysV system are found on http://blog.jorgenschaefer.de/2014/07/why-systemd.html.

Bluetooth Headset

I have bought a nice bluetooth headset, the Philips SHB 3060.
I installed it on Fedora 23 and it worked like a charm.
However, on Ubuntu Gnome 15.10, I was getting frustrated. In the settings Audio -> Test i only could had the option Mono. Listening to music sounded horrible.

So, somehow there was either e problem on Gnome 3.16 or in the configuration of Debian/Ubuntu.
Lukely, I found a link and I did what was descripted in the troubleshooting section*

I copy the part, in case the page no longer exists ( (c) to debian.org). Small adaptions are made to match to my configuration

Troubleshooting

Bluetooth headset is connected, but ALSA/PulseAudio fails to pick up the connected device or there’s no device to pick. This happens because GDM captures A2DP sink on session start, as GDM needs pulseaudio in the gdm session for accessibility. For example, the screen reader requires it.

In order to prevent GDM from capturing the A2DP sink on session start, edit /var/lib/gdm/.config/pulse/client.conf (or create it, if it doesn’t exist):

autospawn = no
daemon-binary = /bin/true

After that you have to grant access to this file to Debian-gdm user:

# chown gdm:gdm /var/lib/gdm/.config/pulse/client.conf

In order to auto-connect a2dp for some devices, add this to /etc/pulse/default.pa:

load-module module-switch-on-connect

Reboot.

Continue reading “Bluetooth Headset”

Customize mouse M560 on linux

I bought a new Logitech mouse, the M560 wireless. What I wanted was that two keys of my mouse are ”History Forward” and ”History backward” action in my browser. Unfortunately, Logitech Inc. does not provide a sufficient linxu driver. Therefore, I had to customize the ouse on my onw, which tooks a bit of research.

Needed packages

  • xbindkeys
  • xautomation

Install these tools eihter with (Fedora) dnf install xbindkeys xautomation or (Debian)
apt-get install xbindkeys xautomation

Configurate xbindkeys

  1. To find out which keys on the mouse are the forward and backwards buttons. The programm xev does this job.. Execute xev | grep button and click in the opened window. The number after the word button is the button number.xev output
  2. Configure the xbindkeys configuration. To do so, execute
    xbindkeys --defaults ~/.xbindkeysrc
  3. Open the file .xbindkeysrc. The History forward and backward action can be achieved with the keyboard combination Alt + Right and Alt + Left. So a click on the mouse button (in my case number 10 and 11) should send this signal. Thats were the programm xte comes into play. In the opened file, the following lines have to be added:
    "xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'"
    b:11
    "xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'"
    b:10
    The first two lines associate the button nr 11 to the history back action. The second line thas the sam ewith the history forward action.
    Save the file.
  4. To test the configuration, execute xbindkeys -n -v
  5. . This will start xbindkeys non-daemonized with a verbose output. To start xbindkeys normally, execute xbindkeys

  6. Set xbindkeys to the autostart. One possibility is to add a desktop-file in ~/.config/autostart/.
    [Desktop Entry]
    Name=xbindkeys
    GenericName=xbindkeys
    Comment=Start xbindkeys at login
    Exec=/usr/bin/xbindkeys
    Terminal=False
    Type=Application
    X-GNOME-Autostart-enabled=true

 

 

Links

A lot of information are gained through the following links

  • https://wiki.ubuntuusers.de/xbindkeys
  • https://ask.fedoraproject.org/en/question/59485/fedora-21-doesnt-come-with-gnome-session-properties/