Αναζήτηση αυτού του ιστολογίου

Using Debian for TouchScreen Laptops

As already said, UbuntuGnome 3.18 provides great support for 2in1 convertible laptops.

Considering to check you sys monitor in Ubuntu Gnome you will realize that UbuntuGnome consumes about 2Gb RAM in idle condition . 

As an alternative we could use Debian + XFCE or Debian + Mate, suitable modified to match the Toshiba Radius 11 convertible laptop with ELAN TouchScreen.



Installing Debian and make it work
To ensure a good operations and make use of all the modern features (latest Desktop Environment versions, etc) you need to be running at least Debian Testing. Personally i prefer Debian Sid, undertaking the risk to break .
So far i had some breaks of limited time (i.e Caja 1.14 is not operating) but usually these breaks are corrected in a couple of days by Debian.

Full Details on how to install Debian in Toshiba Radius 11 and how to upgrade to sid are in this post.
http://monaxoss.blogspot.gr/2016/07/installing-and-testing-debian.html

Debian with Mate
Debian & Mate Sid (tested with 1.14 recently updated to 1.16) proved to be a really good alternative for touch screen laptops.

Most Mate apps DO support touch events out of the box (caja file manager, pluma text editor, etc)

As a result Debian Mate proved to be a nice alternative to UbuntuGnome, with much lower resources consumption. I got in Mate about 650MB ram in idle, compared to the 2GB of the Ubuntu Gnome.

Offcourse once you open your browser and start surfing ram consumption increase 1GB more, but this is not related to desktop enviroment.

Apps ready for Touch Screen that work great on Mate:
  • Chrome in replacement of FireFox (FF doesn't support touch like finger zoom & scroll).      Better not to use Chromium since some Chrome plugins are not supported in Chromium like native client plugin, etc. 
  • Mate Caja File Manager: Works fine with touchscreen. Thunar of XFCE is not touch-friendly. Alternative : nautilus from gnome (Caja is a port of Nautilus) equipped with nautilus auxiliary packages.
  • Mate Pluma Editor: Works fine with touchscreen. Geany & Mousepad are not supporting touch screen operations (scroll).  Alternative: gedit from gnome. Nice touch screen support.
  • XFCE App Finder: Great Tool. In my system was present due to the previous installation of XFCE but can be easily be installed as a stand alone without the requirement a full xfce system to be present. See app finder requirements here: https://packages.debian.org/sid/xfce/xfce4-appfinder
  • Mate Search Tool : Comes by default with mate, but can be installed in other DE easily.  
  • Notice that when you use apps from different distros, you most probably have to modify the .desktop file in /usr/share/applications folder. For example in case of Mate Search Tool edit desktop file (as root) and remove the line "OnlyShowIn: Mate;" Same for xfce app finder,gedit, etc. Or you can simply comment the line with #

Mate Plug ins/ extra apps:
mate-gnome-main-menu-applet:
Can be installed by apt-get . Provides a "Main Menu" that works like gnome2 .
If you put this Main Menu in the left corner of your bottom panel, you have a very familiar microsoft-like start menu , equipped with also a search box (thus you don't need XFCE app finder).

To add this main menu in your panel you have to go to the panel , right click , add to panel , scroll down for "Main Menu".

mate-dock-applet:

Can be installed by apt-get -t sid install mate-dock-applet.
You can add a "dock" in your panel, working similar to Gnome3.18 docks.
You can minimize/maximize open apps by clicking on them in dock.
The trick is that you don't add just a dock. You have to create a new panel, and select "dock" in the "Add to panel" menu.
Offcourse you can add more -not dockable-items in this panel - like xfce app finder.
You can adjust new panel properties to fit the dock (uncheck auto expand), you can make it transparent, etc.
In my installation, dock CRASH 50 times per hour.

OnBoard - all times classic Can be installed by apt-get on Debian.

Gnome Terminal and xterm Terminal: You should install them (or even just the xterm) since a lot of apps look for them in order to run.

Run Caja as Super User:
Create a launcher that will call "gksu -g caja". This requires caja-gksu package to be installed , but usually this packaged in installed by default with Caja when you install Mate.

Screen Auto Rotate:
(a) apt-get install iio-sensor-proxy
(b) Install inotify tools (apt-get install inotify-tools)
(c) Save this script in your home folder and make sure to add script in the start up .
Althought the script is extremely simple and it just uses monitor-sensor and inotify , lucks of various features like "lock rotation" = disable the script from running.
Once loaded , always running in the background . Can be killed either by kill -9 .
ps command seems to fail to detect it running but top/htop would find it.

Bugs for my Installation:
* There is no way to get a touch screen right click even if i follow all the procedures provided for customizing xinput.conf file under /etc/X11 (i.e EnableThirdButton , etc).
Even if i press for a long time the screen , xev reports this as button 1 click.

* On Board is not auto showing in log in screen, even after making sure that i have selected "start onboard at startup" and even adding onboard on the "start up apps".

* Apt autoremove: Suddenly apt-get suggests to autoremove A LOT of packages (i.e Pluma, mate-core, etc). I got suspicious about autoremove suggestions and after some googling, i found a lot of people reporting false autoremove prompts. In some cases, people who follow these autoremove suggestions (apt autoremove) lost their entire DE and left with a black screen and a dollar sign ($).
You can switch off this autoremove proposal by applying #aptitude -KEEP ALL.
This will no more suggests to autoremove anything.

Another workaround is to manual install the items that autoremove propose to remove. This seems that change the flag from "auto installed" to "manually installed". Manually installed apps have to be manually removed. Auto installed apps are somehow installed due to dependencies, and thus autoremove can mess things up.

* Log off and log on as user fails some times.

* Root Log In in the start up screen fails in some distros. Works OK in clean debian installations.
Workaround: Ctrl + Alt + F1 , login as root in tty1 CLI, then startx.
Just declare in .xinitrc who is your de (exec mate-session - google it.).
If not declared, in my case xfce is loaded, but at least i'm logged in as root in tty1!!!

Debian and XFCE
I like customizing XFCE with Debian but this DE it is not "touch screen friendly" out of the box.
Almost all of XFCE built in apps are not supporting touch events.
This means you can not scroll up/down with your fingers, or do other gestures we use to do on touchscreens.

In order to make XFCE more "touchscreen friendly" i had to install some apps and use them instead of the default XFCE apps.

* File Manager: instead of the xfce default file manager (Thunar), use Nautilus (touch screen works ok) or you could try Mate file manager (Caja)

* Text Editor: instead of default leafpad, install and use gedit which supports touch screen (requires some gnome dependencies, but this was ok for me) or you could try Mate text editor (pluma).

* Image Viewer : Once again, Gnome has a solution : eog package (eye of gnome). supports touch gestures like pinch to zoom. Also could give a try to eom package (eyr of mate).

Customize XFCE Dekstop appearance:
https://www.maketecheasier.com/customize-xfce-desktop/
Tip: To enable transparent backgrounds in various xfce elemtns, make sure that "Enable Display Composting" is checked at settings-window manager tweaks-compositor tabl.

Customize XFCE panels by command line using xfconf :
https://forum.xfce.org/viewtopic.php?id=8619
PS: /etc/xdg/xfce4/panel : Contains the default.xml file for top and bottom menus in xfce environment, you can open it with text editor.

Is looks just not safe to "modify" this xml. If you need to make CLI changes to xfce top/bottom panels better to use the xfconf guide in the post above.

Add the xfce goodies package. Nice collection of apps/aplets.
For example you can replace the default xfce applications button in the top panel with the whisker menu which is really nice and looks like gnome / mate. Works nice for me.

Customize XFCE Desktop Main Right Click (context) Menu.
No matter what is the default file manager you have applied in your XFCE (nautilus in my case), the right click menu in desktop of XFCE comes always from Thunar - the default file manager.

To customize this desktop context menu you need to customize thunar.
Open Thunar and go in Edit - Custom Actions Menu.
In this menu you can "add" with the plus symbol custom actions / commands.
I added commands:
Nautilus Root, with gksu -g nautilus %f
Root Edit , with gksu -g gedit %f.
Root Terminal , with gksu -g /usr/bin/x-terminal-emulator %f

Thunar Custom actions menu advises that you can apply %u, %f or %d after your commands , and this represents url/uri, files, folders selected.
Remember that you have to select where these custom actions will apply (files, folder, etc) in the thunar custom actions dialogue (second tab). 

You can test the new custom actions directly trhough Thunar file manager; just start browsing and right click within Thunar Environment.

These new actions are not automatically applied in the Desktop Right Click menu.
You have to log out / reboot or altrnatively you can switch off the desktop icons in the desktop settings and then re-enable them (this forces the desktop menu to restart).
Result:





















Customize Applications menu in XFCE Desktop Right Click.
On Desktop settings you can enable/disable the applications menu to be part of your desktop context menu (last option in context menu)
Customization of this menu is based on one xml file: /etc/xdg/menus/xfce-applications.menu
Also see:https://ubuntuforums.org/showthread.php?t=1105162

In the first section of this xml file (Layout) you will see some Filename entries.
You can add a new filename entry (i.e nr.desktop considering that nr.desktop exists (either installed by a programm or created by you).
You can apply exec=gksu -g nautilus %f , but in order this .desktop launcher to be appear in this menu you need to add this category in the .dekstop file : X-Xfce-Toplevel 

The problem with this menu it is that the %f has not real effect. It seems that the selected file/folder never is parsed to %f or to %d.  Everytime that you will select Nautilus Root (name value of nr.desktop file stored in /usr/share/applications) , nautilus will be opened, but will go to the home directory and not on the mouse right clicked selected directory.

As a result this is a useless hack, since with  the Thunar Custom Action tweak , everything works fine (selected files/folder do pass on the %f or %d value).

Customize the Nautilus Right Click Menu with Nautilus scripts/custom actions:
Once you have oppened nautilus, you have to deal with Nautilus Settings and menus.

Using existed plugins:
Give a check to verify what nautilus plugins are supported by your distro (i.e nautilus-open-terminal, nautilus-admin, etc).
List all plugins available: apt list *nautilus* (you can combine with | grep -v installed to exclude the installed packages).

You can install nautilus plugins like nautilus-open-terminal and nautilus-admin that will add some extra functionallity to your nautilus and give you some extra choices when you right click inside nautilus (like open terminal here or Open as Root).

Especially nautilus-admin package , provides some administrator operations when Nautilus run as user like open as rood, edit as root.

PS: Nautilus Open Terminal tries to load gnome shell. If gnome terminal is missing then a kind a uterm is loaded. For sure nautilus will not call the x-terminal which can be configured trough update-alternatives.

Using Custom Actions:
If plugins are not enough, you can further customize your nautilus right click menu using Nautilus Custom Actions (package nautilus-actions ). 
Nautilus Custom Actions has a configurator suite, usually found under /usr/share/applications.
Using custom actions you can skip the installation of plugins like nautilus-admin and nautilus-open-terminal , since you can assign custom actions for these jobs. 

Notice that custom actions applied by a specific user do not apply to other users or root account (and vice versa).

Custom actions makes usually meaning when using nautilus as normal user. 
If you are using nautilus as root, by default you are in "Root Browse / Root Edit / Root Terminal" condition and you don't need to apply such actions in context menu.

Nautilus Root Edit, Root terminal , Root Browse and New File is my favorite custom actions.

File Edit / Root Edit is not directly provided by nautilus context menu (although there is an option open with other application) and also i was surprised to see that nautilus is not providing a single option to create a new file (only create folder is provided).
In root account double click in text files will call the default editor in root mode (=root edit) by default. Editing other files (like .desktop files) is supported by nautilus by selecting open with other application.

So you can make custom actions for all the above like this:

* Root Edit Custom Action: gksu -g gedit %f
* Root Terminal Custom Action: gksu -g /usr/bin/x-terminal-emulator
* Root Nautilus Custom Action: gksu -g nautilus %f
* New File Custom Action: /path/to/script/newfile.sh
Contents of newfile.sh
#!/bin/sh
file=$(zenity --entry --text="Enter File Name" --entry-text="New File")
touch $file
#script must be executable. 
#zenity provides a nice gui to create the new file. 
#script could be enriched by text-entry blanc entry and zenity existance checks.
# you could use gksu touch, but all the new files will be created as root files even by user. 
# I prefer to use simple touch and apply this custom action in both user custom actions and root custom actions (running touch as root creates a root file by default)

Tips:
* For quick custom actions access to go in Custom Actions Suite, Settings, Runtime Preferences and deselect options "Create a root "Nautilus Actions" menu" and "Add an About Nautilus Actions" . These options are enabled by default. If remain enabled all your custom actions will appear as a kind of sub-menu in the context menu when you right click with Nautilus. 
Disabling/unchecking above options, custom actions will appear just bellow existing nautilus commands and not in a sub menu (much better!).

* Custom actions accept %f , %d, %u . Although the usage of %d looks more appropriate for some actions (like Root Nautilus) is seems that %f option always do the trick no matter if a file is selected.

* If you want above actions to appear in nautilus context menu in all cases (either when a file is selected or when just browsing a folder  withous any file selected) you have to check the appropriate options in custom actions - action menu (main screen).

Using Nautilus Scripts
You can add executable bash scripts in location ~/.local/share/nautilus/scripts/ combining with some runtime variables of nautilus like $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS, etc :
https://help.ubuntu.com/community/NautilusScriptsHowto
Scripts do not accept %f,%d,%u.
Keep in mind that scripts are always appearing in a dedicated sub-menu in nautilus context menu (menu is named scripts) and script do not appear directly on the context menu.

Example of Simple "Nautilus Edit as Root" script :
#!/bin/bash
gksu -g gedit $NAUTILUS_SCRIPT_SELECTED_URIS

More Nautilus Script examples here.

PS: You could even try nautilus-scripts-manager package (https://packages.debian.org/sid/gnome/) , which seems to be a Python3 script 

PS2: With similar way you can configure Mate Caja ; Caja accepts also scripts - not sure for custom actions suite; although it seems that a "caja-actions" package is available.

Results Using Custom Actions:

PS1: I have applied the [u] suffix to the name of each custom action in order to quickly identify that these actions are [u]ser custom actions.

PS2: Root Teminal [u] calls x-terminal-emulator, while the "Open as Administrator" nautilus (built-in) option call only gnome or uterm /xterm ignoring the settings of x-terminal-emulator (configurable through update-alternatives)










Finetune gedit to run correctly in scripts / custom actions:
In my case, gedit.desktop had an option called dbusactivatable=true that was causing problems when custom actions/scripts were calling text-editor / gedit. 

Disabling this option (either by applying false or by commenting out this line) gedit / text-editor could be called correctly from all custom actions.

XFCE Print Screen:
XFCE4 provides xfce4-screenshooter. Combine with -f to capture full screen and assign it to prtscr key for quick access (using app finder-keyboard settings).
Once pressed, screenshooter menu will appear with a thumb of the screen captured prompting for further actions like copy to clipboard or save to file. You can offcourse automate more screenshooter (run #xfce4-screenshooter --help for more options).
Alternativelly you can use the corresponding gnome-screenshoot utility , which also works great and for some reason exists in my system (maybe installed with mate de).

XFCE Preferred Applications:
You can customize default browser, mail client, default text editor and default file manager.
Does not provide options for window manager.
For more detailed finetunning you have to search for MIME Types in appfinder.
I had the situation that Pluma of Mate was keep coming as "default" editor for some files.
Alternativelly, with right click - properties on the file you want you can assign the text editor you want and then apply "set as default".
PS: gedit appears as "Text-Editor" in my applications menu and not as gedit.

XFCE and Touch Screen support
As expected, touch screen right click on xfce desktop is NOT nativelly supported.
Usuall workarounds with evdev configuration files (i.e EmulateThirdButton, etc) do not work.

The solutions is to use this Python Script which works perfect: 
https://github.com/Zyell/Python-Touchscreen-RightClick.

There is also a modified version / fork of this script that works even better, using a slightly different right click injection technique : https://github.com/gevasiliou/Python-Touchscreen-RightClick
You just need to install a couple of python dev packages to ensure the correct operation , till programmers compile a complete "executable".

XFCE and OnBoard:
As a general idea, OnBoard works great in XFCE. You may need to modify a bit the /usr/share/applications/onboard.desktop file to remove / adjust any OnlyShowIn or NotShowIn lines in order to ensure that XFCE is included in the list. 

To allow OnBoard to appear as password input on Root Launchers (using gksu - not tested with gksudo) you have to use in your launcher "gksu -g" instead of just gksu in the .desktop launcher (-g = disable device grab. By default gksu grabs and disables all input methods except physical keyboard).

To make onboard icon to appear in xfce task bar when you login, you have to select onboard to be loaded on start up (xfce menu -> Settings - Session and Startup -> Application Autostart)

Although is also suggested to put onboard launcher directly on the top panel using the panel add items options. With onboard launcher you can show onboard with a single tap.
In case of onboard status icon you need to tap once the icon for options to appear and then you need to tap again at option "Show Onboard".

A known bug of Chrome/Chromium is that OnBoard does not pop up in Chrome.
You have either to manually call onboard (by the top panel icon/launcher) or you can use a Chrome Extension for using another visual keyboard inside chrome only (both solutions work ok).
PS: On the other hand, OnBoard works fine in FireFox, but FireFox misses touch gestures.

XFCE and Auto Screen Rotation 
Handling acceleremoter sensors and providing auto rotate is a big story.
There is a package called iio-sensor-proxy that is capable to read accelerometer data and push them in the dbus and/or print them on the screen (using #monitor-sensor)
Nowdays , all major distros include this package by default. If is missing you can apt install it.

Gnome >3.18 uses by default this package and provides autorotation features out of the "gnome" box.

For other DE , till developers implement a built-in auto rotation function, you can use this global bash script that should work in any machine in which iio-sensor-proxy is operating:

A forked version of above script with more features can be found here: https://github.com/gevasiliou/PythonTests/blob/master/autorotate.sh 

I have filed a bug to XFCE bugzilla , and a guy has replied using a C code app that could do the job. Not tested yet by me.

Tips: 
* You can apply autorun in autorotate script by opening the Startup Applications program and Adding ths script. Give a friendly name for the autostart item, and as "run" command find the script file for autorotation.

* Using $monitor-sensor on terminal you will see if the iio-sensor-proxy packages identifies your accelerometer sensor and provides info about the real screen orientation. By turning the screen left/right you should see corresponding messages in the command line window (right is up, left is up, etc).

* In case that #monitor-sensor fails to get screen orientation on first boot (usuall bug but not present in my case) you could try in shell to stop and restart the sensor proxy service:
systemctl stop iio-sensor-proxy.service && systemctl start iio-sensor-proxy.service
modprobe -r iio-sensor-proxy && modprobe iio-sensor-proxy

XFCE in Tablet Mode
When in tablet mode (screen folded) you expect all tablet features to be active , like touch screen support & auto rotate , but you also need keyboard and trackpad disable.
In my Toshiba Radius, when screen is folded keyboard and touchpad is automatically disabled, most probably by the bios.
With Screen folded, i am not able even to select an entry from the grub menu!

If you need to disable this devices you can do it with xinput set props like this:
#xinput set-prop 12 "Device Enabled" 0
Number 12 refers to your device id (use xinput list to see ids of keyboard and trackpad).
"Device Enabled" is the parameter description (use xinput list-props 12 to see all parameters for device 12)
Zero (0) is the new parameter value.
Tip: Instead of "Device Enabled" you can use the parameter numeric value (see xinput list-props).

Moreover it is possible (if required) to keep trackpad enabled and change the trackpad orientation using transformation matrix.

By applying above xinput disable commands in the autorotation script you can disable these devices based on the screen orientation.
More bash scripts about devices enable/disable : http://askubuntu.com/questions/65951/how-to-disable-the-touchpad

More XFCE Bugs and Tips:
See all available xfce packages with plugins, etc here: https://packages.debian.org/sid/xfce/ or apt list *xfce4* 

1. Mate apps found not to be correctly run under XFCE , but this could be due to messy installation by me.

2. To create a root version of your favorite app (i.e terminal, text editor, file manager) you can add a custom launcher (or you can add a default launcher by xfce menu) and modify running command to gksu -g. For example gksu -g thunar , gksu -g /usr/bin/x-terminal-emulator, etc
Also, you should modify pre-built root apps (i.e Root Terminal in xfce menu) by modifying corresponding .desktop files in /usr/share/applications folder (right click the file, open with text editor, change gksu to gksu -g)

3. OnBoard to appear in log on screen. 
This is somehow tricky; even when the corresponding option is enabled in OnBoard  Settings it seems that fails.  
https://debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian
http://askubuntu.com/questions/369621/how-to-get-the-onscreen-keybord-appear-on-login

Workarounds:I created a small script in /etc/init.d folder to call onboard but not worked. 
I also added onboard on /etc/rc.local , but still onboard is not auto starting.

Check  /etc/xdg/autostart : 
Found various files in there, including a file onboard-autostart.desktop . 
Modify the line OnlyShowIn=GNOME;Unity;MATE; to include XFCE; or comment out this line. 
Also changed the NoDisplay=true to false.
Executable found to be Exec= onboard --not-show-in=GNOME, GNOME-Classic:GNOME
PS: after restart no change was observed in onboard behavior. I kept in any case the modified file. 

Find and modify the "greeters". Greeters are files with settings for the display manager.

/etc/lightdm/lightdm-gtk-greeter.conf - Uncomment #keyboard= and do it keyboard=onboard.
PS: You migh also need to use gksu onboard or sudo keyboard.

It seems after this mod, during log on, OnBoard has become at least available to be called using F3 or by Accessibility options menu on the log on screen Is not auto-showing, but you can select it and it will appear.

Before modifying the greeter, i got only two options in log on Accessibility menu (F1 magnifier and F2 contrast). 
Now i get also F3 option = Virtual Keyboard, and by selecting this option, onboard appears (with typical /default appearance settings).

I tried in greeter to apply CLI options (keyboard=onboard --options xxxx (run onboard --help to see available options ) but no change.

Also add the line keyboard=onboard in file /usr/share/lightdm/lightdm-gtk-greeter.conf.d/01_debian.conf

It seems that the "greeter" files are the correct ones to tweak in order to change the behavios of log on screen.

4. Finding Files, Packages and installation history of apt-get / dpgk -i
http://askubuntu.com/questions/17823/how-to-list-all-installed-packages
* #less /var/log/apt/history.log (and/or dpkg.log) - Installation History of packages
* dpkg --get-selections (optional use |grep -v deinstall) / dpkg -l / apt list --installed
*apt-file (install it if missing) ,
*dpkg -S (you give specific file, it gives you the package this file came from)
*dpkg -L (the opposite- you give package name, it gives you files of the package with their installation location)
*find (i.e find / -name XX.log . can you also look for specific file type, etc)
*locate - simple file find. 
*which and whereis (whereis works with exact match and does not accept wildmarks!)
* apt show package name : gives info about a package in repos.
* dpkg -s package name : gives info the same way of apt but for installed packages.
* apt or apt-cache search package : list available packages acc to search criteria (not exact match)
* apt list package name (exact match) : Much more better package search in repos (i.e apt list mate*)
*apt-cache policy package : lists packages (exact match) and list their versions (available / installed).   PS: You can insert * in the end of search term to avoid the exact match default operation.
* aptitude why (or why-not) package : info about a package (i.e dependencies)
* apt list : list all the packages from the repos . Installed packages are marked [installed]
* apt list --installed : Search for installed packages. 
You can combine with grep to narrow the resutls to specific terms. Alternative apt-list |grep installed

apt list xfce* |grep -v 'installed' |grep -v 'dbg' : List all packages about xfce that are not installed and are not dbg packages (dbg is not in the pkg name)

Apt list bug:
while apt list onboard* , apt list xfce*, etc will list to my screen the onboard / xfce packages (with the remark [installed] next to each package if installed) , the command apt-list mate* shows nothing. 
On the other hand the apt list mate-common or any mate package you know it's eaxct name will be listed.
Workaround: apt list | grep mate gives you packages conaining mate in their name. 
By using grep ^mate will list packages starting with the word mate.


5. Replace XFCE Window manager (xfwm4).
If you like you can replace default window manager of xfce (xfwm4), by using the WM you like (i.e marco from mate) by applying --replace option (i.e marco --replace). 
This --replace options works for all WM and replaces the current window manager. 
PS: It might require first to quite your already loaded WM (i.e xfwm4 --quit).
If you then save the xfce session on your log out, the new WM will be loaded after a log in (and when you log using a saved session).
If you mess things up , clear all saved sessions data and make a new xfce log in attempt by selecting just xfce without saved sessions. Should be ok and should load the defaults.