LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi
User Name
Password
Bodhi This forum is for the discussion of Bodhi Linux.

Notices


Reply
  Search this Thread
Old 07-03-2020, 12:16 AM   #1
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Rep: Reputation: Disabled
Question Yoga Laptop - Autodisable Keyboard when screen folded back to use as tablet?


anyone know how i can automatically disabe the keyboard when i fold th screen of my laptop back and use it as a tablet?

thanks

i have a YOGA LAPTOP... it must have a sensor as it has this function in windows10
 
Old 07-03-2020, 01:18 AM   #2
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 696

Rep: Reputation: 158Reputation: 158
i'm not sure about the auto- part of that, but if you can find the sensor it might be possible with xinput (link1, link2, even an example script).
 
1 members found this post helpful.
Old 07-05-2020, 08:10 PM   #3
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Original Poster
Rep: Reputation: Disabled
I found this but I can not work out how it is supposed to work...

https://github.com/alesguzik/linux_detect_tablet_mode

I installed ruby ( sudo apt install ruby )

Than I copied the two files form the page... the settings file and the script.

The instructions say...
Code:
  1. Install ruby and stdbuf (most likely you already have them preinstalled)
  2. Clone it somewhere, and optionally symlink watch_tablet into any directory in your $PATH
  3. Copy a config file into ~/.config/watch_tablet.yml
  4. Adjust the config (see below)
  5. Add watch_tablet & to your ~/.xinitrc
  6. Restart your desktop session and enjoy
I did everything but (2).. I do not know what that means.

The config instructions say...

Code:
input_device is a path to the device that provides the tablet mode switch. To find it you may run stdbuf -oL libinput debug-events|grep switch and notice something like event4 in the leftmost column. That would correspond to /dev/input/event4. Device numbers may be unstable across reboots, so you may consider doing ls -lh /dev/input/by-path and finding a symlink to that device. For X1 Yoga Gen2 it's /dev/input/by-path/platform-thinkpad_acpi-event.

modes.laptop, modes.tablet - this contain commands that will be executed when mode changes. Most likely this will contain xinput enable and xinput disable commands to enable/disable kb/touchpad/trackpoint (just run xinput to look them up). You may use any other commands to adjust your desktop environment (e.g. hide or show additional panels, increase button size, hide/show onscreen keyboard etc.)
But the command "stdbuf -oL libinput debug-events|grep switch" dose not work?
Code:
:~$ stdbuf -oL libinput debug-events|grep switch
stdbuf: failed to run command ‘libinput’: No such file or directory
Anyone know how I can get this working?
 
Old 07-05-2020, 08:22 PM   #4
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, Arch, Void
Posts: 3,473

Rep: Reputation: 1145Reputation: 1145Reputation: 1145Reputation: 1145Reputation: 1145Reputation: 1145Reputation: 1145Reputation: 1145Reputation: 1145
I'll just say that my Yoga did this automatically in any OS that I put on it (Yoga 710 & Yoga 3 Pro), I thought it was a low-level (efi firmware) function, not software.
 
1 members found this post helpful.
Old 07-05-2020, 08:27 PM   #5
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Timothy Miller View Post
I'll just say that my Yoga did this automatically in any OS that I put on it (Yoga 710 & Yoga 3 Pro), I thought it was a low-level (efi firmware) function, not software.
well it works in Windows 10... just not in Ubuntu 18.04 LTS (BodHi).

To be clear the touchscreen is working, it is just that the keyboard dose not disable when it is folded backward.
 
1 members found this post helpful.
Old 07-06-2020, 01:19 AM   #6
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Timothy Miller View Post
I'll just say that my Yoga did this automatically in any OS that I put on it (Yoga 710 & Yoga 3 Pro), I thought it was a low-level (efi firmware) function, not software.
Well... I tried a number of Live Dstros... and none of them worked...
  • AntiX
  • LinuxLite
  • Lubuntu
  • Kubuntu
  • Ubuntu
  • LxLe
  • Manjaro-Xfce
  • BunsenLabs
  • LinuxMint
  • KDENeon

What was strange though is that in Kubuntu when I folded it backwards it said "touchpad disabled" as a popup. So while the keyboard still tryped and made the tablet mode unusable, it did recognize that it was folded and disabled the touchpad.

I tried a few of the distros and all of them had the touchpad disable, even if it didn't say so.
  • Kubuntu
  • LinuxLite
  • BodHi

Yes BodHi.. so the BodHi Live Boot did recognize the fold and used that to disable to touchpad... but like all of them, that did not disable the actual keyboard

Quote:
Originally Posted by Timothy Miller View Post
I thought it was a low-level (efi firmware) function, not software.
I looked through the Bios.. did not see any options to control this. I'm going to go to the website and see if there is an updated bio / firmware or something I can install on the device.
 
Old 07-06-2020, 03:45 AM   #7
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Original Poster
Rep: Reputation: Disabled
I just can not get this script to work at all...

I have written a two simple script that I can run through the file manager...

Quote:
#!/bin/bash
xinput enable 'AT Translated Set 2 keyboard'
Quote:
#!/bin/bash
xinput enable 'AT Translated Set 2 keyboard'
I guess my next step is.. how to make this into a single script, that disables if enabled and enable if disabled.

Than how can I add it to the menu or favorites with a icon and stuff so I can quickly access it?
 
Old 07-06-2020, 03:54 AM   #8
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Original Poster
Rep: Reputation: Disabled
Code:
#! /bin/bash
#  sKeyboard
#  http://ubuntuforums.org/showthread.php?t=2100744
 
DEVICE="AT Translated Set 2 keyboard"
STATUS=`xinput list-props "$DEVICE" | grep 'Device Enabled' | sed 's/.*\([0-9]\)$/\1/'`
 
if [ "$STATUS" = "1" ]
then
    xinput set-prop "$DEVICE" 'Device Enabled' 0
elif [ "$STATUS" = "0" ]
then
    xinput set-prop "$DEVICE" 'Device Enabled' 1
else
    echo "Error : bad argument"
fi
Ok this works... now I just need to work out how to make it a icon you can click on in the menu of BodHi
 
Old 07-06-2020, 03:57 AM   #9
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 829

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Create a desktop file with reference to sh script and place it to the desktop folder.

Stefan
 
1 members found this post helpful.
Old 07-06-2020, 04:26 AM   #10
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by the_waiter View Post
Create a desktop file with reference to sh script and place it to the desktop folder.

Stefan
A "desktop file" ?
 
Old 07-06-2020, 04:41 AM   #11
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 829

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Yes, look at /usr/share/applications folder and pick up one of the desktop file as example

It looks like this

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Sample Application Name
Comment=A sample application
Exec=application
Icon=application.png
Terminal=false
 
1 members found this post helpful.
Old 07-06-2020, 05:27 AM   #12
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by the_waiter View Post
Yes, look at /usr/share/applications folder and pick up one of the desktop file as example

It looks like this

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Sample Application Name
Comment=A sample application
Exec=application
Icon=application.png
Terminal=false
where do I place the icons? They do not appear be be in that directory.. is there another one they are searched for, or do I need to use a full path?
 
Old 07-06-2020, 05:40 AM   #13
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 829

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
By default the icons are placed in /usr/share/icons but you can place it wherever you want. If in home folder just add that path in desktop file. It is up to you

Last edited by the_waiter; 07-06-2020 at 05:44 AM.
 
1 members found this post helpful.
Old 07-06-2020, 09:27 PM   #14
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Original Poster
Rep: Reputation: Disabled
Is there a way to monitor all the events going off?

Basically BodHi can "tell" when the screen is folded back, as it automatically disables the touch pad when I fold the screen back... so is there a way to monitor all the events so I can see what event is triggering to do that and then somehow "monitor" for that event and add my on-off_Keyboard script to trigger when it happens?

I think that is what this script I was looking at does, but I can not work out how to get it working.
 
Old 07-06-2020, 09:36 PM   #15
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 696

Rep: Reputation: 158Reputation: 158
sounds like trying to write a udev rule for the event that occurs when your screen is folded. i don't know if there will be info for the exact event that you are describing, but if you run journactl -f when you do something like disable wifi or insert a usb you can see all kinds of identifying information about the process (possibly dmesg output?) that may help to figure out how your system identifies that event as well as the mechanism (switch/input device) behind it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to print folded code CVAlkan Linux - Software 8 05-23-2018 09:32 AM
LXer: Big mistake, Google. Big mistake: Chrome OS to be 'folded into Android' LXer Syndicated Linux News 0 10-29-2015 11:33 PM
xrandr -o inverted causes black screen on Lenovo Yoga 2 Pro, Gnome 3.14.2 SignorX Linux - Laptop and Netbook 2 02-27-2015 01:46 PM
LXer: Yoga tablet is Android-powered and delivers up to 18 hours of juice LXer Syndicated Linux News 0 11-03-2013 03:24 AM
ls sorting problem: lower and upper case folded? mcwasi Linux - General 6 10-24-2007 09:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi

All times are GMT -5. The time now is 08:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration