📜 ⬆️ ⬇️

Linux for tablet

image

In this article, I will show you on my own experience that GNU / Linux and graphical shells for it have already matured to the level of tablets and you do not need to be afraid to buy a transformer \ tablet just because you are a dedicated Linux user. It describes the comparison and selection of the optimal desktop environment (hereinafter DE) for a tablet or a transformer, its installation and refinement for touch control.

A little background


Being the owner of a small (by modern standards) phone, a 7 "tablet and laptop, the thought of replacing devices came. After some thought, I came to the conclusion:

The conclusion was the same: the transformer is ideal.

Next came the choice of a transformer: I would like not just a tablet with a Bluetooth-connected keyboard, but a full-fledged powerful laptop with a detachable screen and additional ports in the docking station. My long choice fell on one of the HP models. I will not tell about it, since the article is not about it (and generally it will be an advertisement). Let me just say that I really liked the concept of modularity: you have in your hands a powerful and lightweight (900g) tablet that, when connected to the docking station, acquires a real keyboard, an additional hard drive and becomes a laptop that can work for 12 hours from 2 batteries. In parallel with me, my girlfriend needed a laptop to study, she wanted a small and light one, with a flip form factor (loops can be rotated 360 °, tilting the keyboard by the cover and turning the laptop into a tablet). She chose a Dell production model.
')
So, I had on my hands 2 devices of the same purpose, but of completely different performance. HP was originally Windows 8, on Dell - 8.1. Both systems have been removed after working in the store.

The choice of distribution and DE


Everything should be designed to control this, the interface should be the same for a laptop and for a tablet - I set such concepts before me. Having read on the Internet about the support of the touchscreen different DE, I decided to put Ubuntu because of gestures. The gestures turned out to be really convenient, there is a finger scrolling, also the wide Unity panel is very convenient for the tach (it is convenient to flip through and open applications). At this convenience is over. Small buttons for closing and minimizing the window (you can expand with a gesture), the impossibility of scrolling through the main menu, inconvenient hiding of the panel (in portrait orientation, it takes up a lot of space, and you can only open it with four fingers). That didn't suit me, and besides, I dislike Ubuntu. Since I dropped Ubuntu with Unity, and the rest of the well-known DE, with at least some gesture support, you can install almost any distribution, ArchLinux was chosen because of past experience (it stands on all my devices).

KDE4, XFCE and Gnome 3 were installed.

The touchscreen worked in all DEs out of the box, since it is controlled by the X server (the xf86-input-evdev driver is installed along with Xorg as a dependency in ArchLinux)

KDE:
pros:

minuses:


XFCE:
pros:

minuses:

However, there is nothing to blame XFCE for, as the developers position it as primarily as a lightweight system for netbooks, with which XFCE copes perfectly.

Gnome 3:
pros:

Minuses:


So, take Archlinux with Gnome 3 as the basis and refine it.

Installation


Installation will not describe, everything is on the link . If you want to speed up the installation, do this:

pacstrap /mnt grep sed filesystem shadow pacman screen nano mkinitcpio #       genfstab -pU /mnt >> /mnt/etc/fstab #  fstab arch-chroot /mnt #      screen -dm pacman -S —noconfirm base #      .    ,       

Then do everything that is indicated in the article on the Wiki after the item “Change root into the new system”.

After the basic system setup, install Gnome 3:

 pacman -Sy gnome systemctl enable gdm systemctl start gdm 

Customization


Let's start, in fact, adaptation for the tablet:

  1. Turn on the right click on the long press (with the mouse will also work):

     gsettings set org.gnome.desktop.a11y.mouse secondary-click-enabled "true" gsettings set org.gnome.desktop.a11y.mouse secondary-click-time "0.6" 

    Instead of 0.6, you can substitute a comfortable time for you, after which a right mouse click will be made. The downside is that you need to keep your finger ideally exactly all those 0.6 seconds, so this trick is obtained only from 2-3 times. Need an alternative.
  2. Most tablets have a Windows button (usually under the screen). It would be logical when you click on it to open the "review", but it is already conveniently opened with gestures, so we will right click on this button:
    Install xdotool and xbindkeys:

     pacman -S xdotool xbindkeys 

    To find out how your subscreen button is determined, run:

     touch ~/.xbindkeysrc xbindkeys -k 

    Let's write down the xbindkeys configuration and add it to autoload (substitute your button ID, obtained from the previous command instead of Super_r):

     echo "\"env DISPLAY=:0 xdotool click 3\" Super_R" > ~/.xbindkeysrc echo "[Desktop Entry] Name=Xbindkeys Exec=xbindkeys Type=Application Terminal=false" > /etc/xdg/autostart/xbindkeys.desktop 
  3. Let's make the sliders of brightness and volume wider. To do this, download the patch and apply it:

     curl http://pastebin.com/raw.php?i=F2WJiEUC > /tmp/theme.patch patch /usr/share/gnome-shell/theme/gnome-shell.css < /tmp/theme.patch 

    It turns out like this:

    image
  4. If you lead the tablet to sleep, after waking up you will notice that the touch doesn’t actually work. Gnome for some reason disables it as an input device in the X server. A simple “xinput enable“ ELAN Touchscreen ”will correct the situation after sleep. Let's make a systemd daemon that will execute this command right after sleep:

     echo "[Unit] Description=Fix touchscreen after resume After=suspend.target [Service] Type=simple ExecStart=env DISPLAY=:0 xinput enable 'ELAN Touchscreen' [Install] WantedBy=suspend.target" > /usr/lib/systemd/system/touchscreen-fix.service systemctl enable touchscreen-fix 
  5. Autoturn ... I did not think that everything would be so easy. The driver for the accelerometer was not required on both laptops, lsusb recognized it as “0483: 91d1 STMicroelectronics”. A python script for auto fix-off was quickly written. You need to put python2 and set the script to autoload:

     pacman -S python2 xorg-xrandr curl http://pastebin.com/raw.php?i=nnecb7iA > /usr/bin/autorotate chmod +x /usr/bin/autorotate echo "[Desktop Entry] Name=Autorotate Exec=python2 /usr/bin/autorotate Type=Application Terminal=false" > /etc/xdg/autostart/autorotate.desktop 
  6. Disable the auto-display of the standard on-screen keyboard:

     sed -i 's/^Exec/#Exec/g' /usr/share/dbus-1/services/org.gnome.Caribou.Daemon.service /usr/share/dbus-1/services/org.gnome.Caribou.Antler.service 
  7. Install and configure Onboard (a great on-screen keyboard for the tablet):

     pacman -S onboard gsettings set org.onboard.auto-show enabled "true" #        gsettings set org.onboard.keyboard touch-feedback-enabled "true" #     gsettings set org.onboard.window docking-enabled "true" #      gsettings set org.onboard.window enable-inactive-transparency "true" #     gsettings set org.onboard.window force-to-top "true" #     gsettings set org.onboard.window inactive-transparency "60.0" #    gsettings set org.onboard.window transparency "20.0" #   gsettings set org.onboard.window transparent-background "true" #   gsettings set org.onboard.window window-decoration "false" #    (  , , etc.) gsettings set org.onboard layout "/usr/share/onboard/layouts/Compact.onboard" #  gsettings set org.onboard show-status-icon "true" #     gsettings set org.onboard start-minimized "true" #   echo "[Desktop Entry] Name=Onboard-autostart Exec=onboard Type=Application Terminal=false" > /etc/xdg/autostart/onboard.desktop 

    Now the keyboard will appear after the click in the place of entry. It even works with the mouse and touchpad, so if this means using the tablet is meant, do:

     gsettings set org.onboard.auto-show enabled "false" 

    To manually open the keyboard, just swipe up from the bottom edge of the screen and click on the Onboard icon.
  8. If you use the OS selection menu in Grub without a keyboard, you can hide it. To do this, put the package from AUR:

     curl -O https://aur.archlinux.org/packages/gr/grub-holdshift/grub-holdshift.tar.gz tar -xf grub-holdshift.tar.gz cd grub-holdshift makepkg -si grub-mkconfig -o /boot/grub/grub.cfg 
  9. If in your tablet SSD, I advise you also to read this article.
  10. Even greater functionality of gestures (for example, maximizing the window to the full screen with three fingers upwards, folding downwards) will be able to give touchegg . However, standard multitouch gestures in Gnome are sufficient.


Now the system is ready for use with touchscreen only. Everything is convenient, and most importantly, perfectly adapted to the format of the tablet, while at the same time working in the tablet + docking mode, you hardly notice any differences from the usual Gnome 3.

Conclusion


If you are a Linux user and you don’t buy a tablet / transformer just because you have to give up Linux, nothing like that. It is much more convenient to work than in Windows because of, at least, gesture support in Gnome 3.

UPD And so after more than half a year:
After updating 3.16 in Gnome, the tray design was changed; now this is not a panel that extends from the bottom of the screen
image (how convenient it was on the touchscreen), and a small panel on the bottom left, which contains only icons image . By the way, it is also impossible to use it on the tablet (I have already fixed the bug for a long time).

As a result, it became difficult to use the keyboard, sometimes even turned on the “floating icon when the Onboard is collapsed” in the settings. This is solved by an extension that allows you to open the keyboard with a swipe up from the bottom of the screen.
Also, paragraph 6 has lost its relevance, now it is also solved by the extension . If you still prefer the stock keyboard and you do not like that it is superimposed on top of the windows, you can use this .
You can also make life a little easier in portrait mode (at 1366x768 most window titles do not fit there) by putting this and that .

Source: https://habr.com/ru/post/377181/


All Articles