LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-01-2018, 07:46 AM   #1
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Arrow Fujitsu Lifebook T901 convertible laptop/tablet features missing on default install


This thread is for both helping me and helping others get the most of this sophisticated machine thru Slackware.

1.[SOLVED] So far I got Slackware64 14.2 o install and it was a bumpy road - no legacy mode, only EFI and the dreaded installer FS format bug.
Once i figured to format the EF00 partition to FAT32 before i run setup i installed it with elilo easy and with no further problems.

2.[SOLVED] My processor is i5 2520M and my T901 uses the IGP Intel HD3000 -detected properly form the get go.
I further tweaked it to allow for DRI3 because i wanted to try out latest wine and Gallium 9 support - it works and can be done - is it useful remains to be further tested.

3.[SOLVED] The Wacom tablet and pen drivers (ISD-V4?) didn't work properly out of the box on XFCE4 so i had to make few custom scripts that helped me on the way - will post them in further messages after this one.

4. The Wacom touchpad works out of the box, I particular enjoy the edge scrolling but, alas the circular scroll pad next to it is still out of use. The driver is psmouse and I didn't find any solution yet.

5.[SOLVED] The light sensor can be easy red and the back-light of the display can be easy adjusted - even automatically - but it can be annoying at times as the sensor seems to respond to light changes quite abruptly. There is a script it tried to use I also will post later.

6. The scroll sensor on the screen edge can't be used still - my wild guess is it is also connected to the psmouse controlled Wacom touchpad.

7. The ACPI subsystem sends correctly an event when the lid is rotated and folded into the tablet position - I'm not aware of any script/utility using this information to adjust any of the settings, I'm right now exploring if I could make any sense/use of it

8. There seems to be an inertial/gravity sensor for protecting the hard disk, but i didn't even start to look it up yet.

9.[SOLVED] GSM/GPRS modem works - I used it with Network Manager with no problems. Maybe it could be used for SMS as well - didn't finish this yet. The device is "Sierra Wireless Inc - MC8305"

10.[SOLVED] Bluetooth works (Broadcom - bcm20702a0). See further below.

11. The fingerprint sensor seems detected, but i didn't tried anything with it yet.

12.[SOLVED] The camera is auto detected, and all that is needed is to run an mplayer command-line or install wxcam to check if it works.

13.[SOLVED 50%] The buttons on the edge of the screen bezel - i edited out the fujitsu-tablet.c to have keys i prefer over the shipped ones - while this is a quick and dirty fix, I would prefer the module takes the config from users-pace so it would survive kernel upgrades without the fuss. Preferably a module parameter or an file somewhere.

Last edited by SCerovec; 09-11-2018 at 04:31 AM. Reason: forgot some... there's quite a mouthful and marking [SOLVED]
 
Old 09-01-2018, 08:20 AM   #2
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Post wacomrotate

As promised, (intended use - for tablets and convertibles):

file:wacomrotate.sh
Code:
#!/bin/sh
IFS=$'\n'

orient() {
  # make all wacom devices oriented in a desired way
  for ((d=1; d<$n; d++))
  do
   xsetwacom set ${T[d]} Rotate $1
  done
}

rotate() {
  #detect xrandr display orientation and translate it for wacom
  O=$(xrandr -q | grep $S | awk -F'(' '{print $1}' | awk '{print $4}')
  #echo "orientation: $O"
  case $O in
left)
  orient "ccw"
  ;;
right)
  orient "cw"
  ;;
inverted)
  orient "half"
  ;;
*)
  orient "none"
  ;;
  esac
}

# number of and the store of wacom devices
n=0
T[9]=''

# where we check for rotation events
logfile="/var/log/Xorg.0.log"

# tell we are online
echo "Wacom screen rotation adjustemnt online."

# collect the available devices
for d in $(xsetwacom list devices | awk -F'  ' '{print $1 }')
do
  echo "found: $d"
  n=$((++n))
  T[$n]=$d
done

echo "$n devices found"

# find our display
S=$(xrandr | grep " connected" | awk '{print $1}' )

# we currently support only one device really
if [[ $S == "LVDS1" ]]; then
  echo "Found supported video device"
else
  echo "No supported device found"
fi

# one dry run
rotate

# await for events
tail -fn0 $logfile | \
while read line; do
  echo $line | grep -q "rotation"
  if [ $? = 0 ]
  then
    rotate
  fi
done
HOWTO:
have this script executable and called during your's favorite DM startup.

As the X is rotated, the script will align the wacom tablet input accordingly.
 
Old 09-01-2018, 08:34 AM   #3
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
file:blendwacom.sh
Code:
#!/bin/sh
device="Wacom ISDv4 EC Pen"
pen=$device" stylus"
eraser=$device" eraser"

echo "setting up Wacom ISDv4 EC for blender"
#set eraser to be 3rd mouse button - rotate with the back of the pen 
xsetwacom set "${eraser}" "Button" "1" "button +2 "
xsetwacom set "${eraser}" "Button" "2" "button +2 "
xsetwacom set "${eraser}" "Button" "3" "button +2 "

# set pen tip be left click - to move the 3d cursor and interact with menus
xsetwacom set "${pen}" "Button" "1" "button +1 "
# set the front click make the pen tip be RMB - select in viewport
xsetwacom set "${pen}" "Button" "2" "button +3 "
# set the back click make the pen tip be middle button - rotate in viewport
xsetwacom set "${pen}" "Button" "3" "button +2 "
The file i use when working with blender...

Last edited by SCerovec; 09-01-2018 at 03:59 PM. Reason: O.o found errors -fixed now
 
Old 09-01-2018, 08:52 AM   #4
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
location:/usr/src/linux/arch/ia64
file:fujitsu-tablet.c
(around line 74)
Code:
static unsigned short keymap_Lifebook_T901[KEYMAP_LEN] __initdata = {
	KEY_RESERVED,
	KEY_RESERVED,
	KEY_RESERVED,
	KEY_RESERVED,
	KEY_LEFTALT,
	KEY_TAB,
	KEY_ESC,
	KEY_RIGHTCTRL,
	KEY_RESERVED,
	KEY_RESERVED,
	KEY_RESERVED,
	KEY_RESERVED,
	KEY_RESERVED,
	KEY_RESERVED,
	KEY_RESERVED,
	KEY_RIGHTSHIFT
};
This suited me best for use with blender.

"1" = left Alt
"2" = Tab
"3" = Esc
"4" = Contorl
"ent" = Shift

after editing as root run (replace 4.4.153 below, with what applies for your system):
Code:
cd /usr/src/linux
make drivers/platform/x86/fujitsu-tablet.ko
cp -v drivers/platform/x86/fujitsu-tablet.ko /lib/modules/4.4.153/kernel/drivers/platform/x86/
modprobe -rv fujitsu-tablet
modprobe -av fujitsu-tablet
and you should have the changes at your disposal.

This is somewhat unfortunate, as it does not account for alternative configurations preferred by other programs.
An user-space control mechanism would be more flexible and suited for more uses.

Last edited by SCerovec; 09-01-2018 at 09:00 AM. Reason: forgot line number and howto make
 
Old 09-01-2018, 09:37 AM   #5
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Wow SCerovec !

Thanks for sharing all your work.

You opened my eyes to a couple possibilities for my Laptop as well.

My Laptop is is not nearly as sophisticated as yours but there were a couple 'windows-only F-Key Features' that I never pursued ...

Don't you love the Flexibility of Slackware + Linux ?

-- kjh
 
1 members found this post helpful.
Old 09-01-2018, 02:30 PM   #6
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Quote:
Originally Posted by kjhambrick View Post
Wow SCerovec !

Thanks for sharing all your work.
You are most polite sir
Quote:
You opened my eyes to a couple possibilities for my Laptop as well.

My Laptop is is not nearly as sophisticated as yours but there were a couple 'windows-only F-Key Features' that I never pursued ...
I would more than gladly, read how it went, here on the forum
Quote:

Don't you love the Flexibility of Slackware + Linux ?

-- kjh
Kind sir, i have no idea what You are talking about , Slackware is so hard and -current just breaks my boxxen.
/sarcasm
Attached Thumbnails
Click image for larger version

Name:	rofl.gif
Views:	26
Size:	192.0 KB
ID:	28502  
 
Old 09-01-2018, 02:52 PM   #7
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Post Virtual keyboards and other stuff

It goes without saying I had to install Florence and svkbd.

For Florence it is quite intuitive but somewhat buggy and quirky to set up as one likes. I recommend trying with switching the window decorations on and off until the size is just right.

For svkbd, i like much better, i recommend following command-line parameters:
Code:
svkbd -g 400x120
For a easy to point to and click, yet small enough window. It can be set as a dock window, I guess this meas it can be auto hidden as well - i didn't try that yet.

For convenient screen rotation in XFCE4 i used the keyboard settings and assigned the "4"+"3" keys to setting up the display
Attached Thumbnails
Click image for larger version

Name:	4plus3.png
Views:	30
Size:	2.4 KB
ID:	28503   Click image for larger version

Name:	keyboard_settings.png
Views:	44
Size:	47.2 KB
ID:	28504  
 
Old 09-01-2018, 03:12 PM   #8
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Post Phisical keyboard and other stuff

I ordered an US layout keyboard to replace my DIN layout one I've got with the laptop.

I ended up using neither - actually I swapped some keys and used the original keyboard for one reason - the [fn] keys had different mapping and the US vs DIN just didn't match.

SO i went ahead and replaced only the offending keys:
Code:
Q,Y,P,[,],
;,',\,
Z,M,,,. and /
both Ctrls, both Alts
but i kept the 7 style win and menu keys, especially because the later had a black "X11 like" arrow on it

---

I can't praise sbotools enough:
Code:
bash-4.3# sbofind ournal
SBo:    rednotebook 2.4
Path:   /usr/sbo/repo/office/rednotebook

SBo:    xournal 0.4.7
Path:   /usr/sbo/repo/office/xournal

SBo:    zpaq 7.15
Path:   /usr/sbo/repo/system/zpaq

bash-4.3# sboinstall xournal
and i had my first tablet friendly notes application ready to roll
How cool is that?
 
Old 09-11-2018, 04:40 AM   #9
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Post Broadcom bluetooth oddity

As it turns out, the bluetooth might be a tad hackier than the usual day.

Download the broadcom drivers from Yours Laptop vendor and use the hex2bcd tool:

Code:
$ git clone git://github.com/jessesung/hex2hcd.git
$ make
$ cp <your downloaded BCM*.hex file location> . #<-- note the dot! it is IMPORTANT
$ ./hex2hcd BCM*.hex BCM.hcd
# cp -v BCM.hcd /lib/firmware/brcm/
# ln -vs /lib/firmware/brcm/BCM.hcd /lib/firmware/brcm/BCM20702A0-0489-e031.hcd
It just so happens, that my module wanted only the BCM20702A0-0489-e031.hcd and the BCM20702A0-0489-e031.hcd only, so i symlinked the *.hcd to that.

Seems a bit odd, so I figured i share that too.
my OEM hex was :
Code:
BCM20702A0_001.001.024.0156.0204.hex
And i tested it - it works.

Automatic dependency solving my a$$
 
Old 09-11-2018, 04:26 PM   #10
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Question screen

Code:
# i2cdetect -l 0
i2c-3	i2c       	i915 gmbus panel                	I2C adapter
[snip]
Code:
# i2cdump -y 3 0x50
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 ff ff ff ff ff ff 00 09 e5 28 0a 00 00 00 00    ........??(?....
10: 00 11 01 03 80 1d 12 78 0a 6f 8c 90 5a 54 8a 25    .??????x?o??ZT?%
20: 1e 4c 52 00 00 00 01 01 01 01 01 01 01 01 01 01    ?LR...??????????
30: 01 01 01 01 01 01 c7 1b 00 a0 50 20 17 30 30 20    ????????.?P ?00 
40: 36 00 1e b3 10 00 00 19 00 00 00 fe 00 0a 20 20    6.???..?...?.?  
50: 20 20 20 20 20 20 20 20 20 20 00 00 00 fe 00 42              ...?.B
60: 4f 45 20 48 59 44 49 53 0a 20 20 20 00 00 00 fe    OE HYDIS?   ...?
70: 00 48 56 31 33 33 57 58 31 20 20 20 20 0a 00 2f    .HV133WX1    ?./
80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
What do you know, this is the LCD/TFT panel of the laptop
I wonder how this can be put to any use?

BTW searching for the accelerometer (still no dice).

Last edited by SCerovec; 09-11-2018 at 04:27 PM. Reason: added more info
 
Old 09-21-2018, 03:18 AM   #11
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Quote:
Originally Posted by SCerovec View Post
As promised, (intended use - for tablets and convertibles):

file:wacomrotate.sh
Code:
#!/bin/sh
IFS=$'\n'

orient() {
  # make all wacom devices oriented in a desired way
  for ((d=1; d<$n; d++))
  do
   xsetwacom set ${T[d]} Rotate $1
  done
}

rotate() {
  #detect xrandr display orientation and translate it for wacom
  O=$(xrandr -q | grep $S | awk -F'(' '{print $1}' | awk '{print $4}')
  #echo "orientation: $O"
  case $O in
left)
  orient "ccw"
  ;;
right)
  orient "cw"
  ;;
inverted)
  orient "half"
  ;;
*)
  orient "none"
  ;;
  esac
}

# number of and the store of wacom devices
n=0
T[9]=''

# where we check for rotation events
logfile="/var/log/Xorg.0.log"

# tell we are online
echo "Wacom screen rotation adjustemnt online."

# collect the available devices
for d in $(xsetwacom list devices | awk -F'  ' '{print $1 }')
do
  echo "found: $d"
  n=$((++n))
  T[$n]=$d
done

echo "$n devices found"

# find our display
S=$(xrandr | grep " connected" | awk '{print $1}' )

# we currently support only one device really
if [[ $S == "LVDS1" ]]; then
  echo "Found supported video device"
else
  echo "No supported device found"
fi

# one dry run
rotate

# await for events
tail -fn0 $logfile | \
while read line; do
  echo $line | grep -q "rotation"
  if [ $? = 0 ]
  then
    rotate
  fi
done
HOWTO:
have this script executable and called during your's favorite DM startup.

As the X is rotated, the script will align the wacom tablet input accordingly.
Slowly stitching it all together:

all the tools i posted go to ~/bin on my system,
then i fiddled with ACPI:
Code:
$ cd /etc/acpi/
$ tree
.
├── acpi_handler.sh
├── events
│** ├── default
│** └── tabletmode
└── tabletmode.sh
files of interest:
file :events/default
Code:
# This is the ACPID default configuration, it takes all
# events and passes them to /etc/acpi/default.sh for further
# processing.

# event keeps a regular expression matching the event. To get
# power events only, just use something like "event=button power.*"
# to catch it.
# action keeps the command to be executed after an event occurs
# In case of the power event above, your entry may look this way:
event=button power.*
action=/sbin/init 0

# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.

#event=.*
#action=/etc/acpi/acpi_handler.sh %e
as can be seen, i cut off the acpi handler and turned to individual event handling
file: events/tabletmode
Code:
#!/bin/sh

params=$@
enabled=$(( $4 ))
state="/var/state/tabletmode"
export DISPLAY=:0
export USERNAME_TO_RUN_SCRIPT_AS=`who | grep "(${DISPLAY}" | awk '{print $1}'`
export XAUTHORITY=/home/$USERNAME_TO_RUN_SCRIPT_AS/.Xauthority
HANDLER="/home/${USERNAME_TO_RUN_SCRIPT_AS}/bin/tabletflipped"


case $enabled in
1)
  echo "enabled" > $state
  ;;
*)
  echo "disabled" > $state
  ;;
esac
chmod 0664 $state

export TABLETMODE=$(cat $state)
/usr/bin/sudo -u $USERNAME_TO_RUN_SCRIPT_AS $HANDLER &

set > /var/state/tabletmode.env
there are some minor leftover from debugging it :P

stay tuned...

Last edited by SCerovec; 09-23-2018 at 12:09 PM. Reason: Obsolete - look further down for newer version of the handler script!
 
Old 09-21-2018, 03:22 AM   #12
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
tabletflipped (solved point 7 (can't edit anymore))

So here we are - the script that rotates the screen according to the bezel flip:
file: ~/bin/tabletflipped
Code:
#!/bin/bash
#
# 2018 for slackware ACPI tabletmode
#

OUTPUT=$(xrandr | grep " connected " | awk '{print $1}')
TABLETMODE=$(cat /var/state/tabletmode)

#available options:
#                  inverted normal left right
ENABLED="inverted"
DISABLED="normal"

#run the stylus setup (must be in $PATH):
blendwacom.sh

case $TABLETMODE in
enabled|on|1)
    xrandr --output ${OUTPUT} --rotate ${ENABLED}
    ;;
*)
    xrandr --output ${OUTPUT} --rotate ${DISABLED}
    ;;
esac
as soon as the proper files are made executable the construction kicks into action.

Last edited by SCerovec; 09-23-2018 at 01:59 AM. Reason: can't edit opening post (+ errors found)
 
Old 09-23-2018, 02:02 AM   #13
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
I edited the ACPI handler to reflect my recent discovery:
for one reason or the other the output of who might change depending on the login manager

so i simply removed the closing bracket of the grep pattern to catch both:
(:0)
and
(:0.0)
at the end of the line

It passes the 1st user logged on a X session since

I tried with who -m, but besides it doesn't work, it also might omit the X if zapped to background - which is not desired IMO.

I'm open to suggestions.
 
Old 09-23-2018, 12:14 PM   #14
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Exclamation developers; developers; developers; developers; developers;

what do You know, it was working intermittently and I couldn't for the life of me get what was wrong...

then, all of sudden, it downed on me - terminal users can be found out by who, or by w, but Xorg users can't.

and i dudkduckgo-ed ( ) away:

Code:
#!/bin/sh

params=$@
enabled=$(( $4 ))
state="/var/state/tabletmode"
xorg_bin=/usr/libexec/Xorg

Xuser() {
xorg_bin=/usr/libexec/Xorg
xorg_pid=$(pidof -s ${xorg_bin})
test -n "$xorg_pid" || exit 1
dm_pid=$(ps -eo pid,ppid,args | awk -v xorg_pid=$xorg_pid '$1 == xorg_pid {print $2}' )
pid_list="$(ps -eo pid,ppid,cmd | awk -v dm_pid=$dm_pid '$2 == dm_pid {if (matchnr == 0) { printf "%s%d ","$2 == ",$1; matchnr++;} else printf "%s%d ","|| $2 == ",$1;}')"
ps -eo pid,ppid,user,cmd | awk "$pid_list"'{print $3}'
}

export DISPLAY=:0
export USERNAME_TO_RUN_SCRIPT_AS=$(Xuser)
export XAUTHORITY=/home/$USERNAME_TO_RUN_SCRIPT_AS/.Xauthority
HANDLER="/home/${USERNAME_TO_RUN_SCRIPT_AS}/bin/tabletflipped"

case $enabled in
1)
  TABLETMODE="enabled"
  ;;
*)
  TABLETMODE="disabled"
  ;;
esac

echo $TABLETMODE > $state
chmod 0664 $state

export TABLETMODE
/usr/bin/sudo -u $USERNAME_TO_RUN_SCRIPT_AS $HANDLER &

set > /var/state/tabletmode.env
chmod 0664 /var/state/tabletmode.env
hope this helps
 
1 members found this post helpful.
Old 03-02-2019, 07:58 AM   #15
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,478

Original Poster
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Exclamation progress breaks things

Just as the dust began to settle on our quiet story, what do you know, the thing broke again...

To shorten the story, libevent got precedence over native wacom drivers and so my little script went heiwire on rotating my pen to the screen...

And once i had time to sit down and play with it, the following script got patched together:
file:~/bin/wacomrotate.sh
Code:
#!/bin/bash

# ISC license applies. For Slackware 2019 and onward.
# author cest73@ya.ru, support on Linuxquestions.org

IFS=$'\n'

#lib wacom
orient() {
  # make all wacom devices oriented in a desired way
  for ((d=1; d<$n; d++))
  do
   xsetwacom set ${T[d]} Rotate $1
  done
}

#lib input
matrix() {
  #set the libinput wacom tablet device 
  # to appropriate orientation via 
  # the transformation matrix
  echo "xinput set-prop $wacom_tab $calibration $@"
  xinput set-prop $wacom_tab $calibration $@
}

rotate() {
  #detect xrandr display orientation and translate it
  O=$(xrandr -q | grep $S | awk -F'(' '{print $1}' | awk '{print $4}')
  #echo "orientation: $O"
  case $O in
left)
  orient "ccw"
  matrix  0.000000 -1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000
  ;;
right)
  orient "cw"
  matrix  0.000000 1.000000 0.000000 -1.000000 0.000000 1.000000 0.000000 0.000000 1.000000
  ;;
inverted)
  orient "half"
  matrix -1.000000 0.000000 1.000000 0.000000 -1.000000 1.000000 0.000000 0.000000 1.000000
  ;;
*)
  orient "none"
  matrix  1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000
  ;;
  esac
}
# matrix  X range 0.0      X offset  0.0     Y range   Y offset 0.0     0.0       1
# number of and the store of wacom devices
n=0
T[9]=''

# where we check for rotation events
logfile="/var/log/Xorg.0.log"

# tell we are online
echo "Wacom screen rotation adjustemnt online."

# collect the available devices
for d in $(xsetwacom list devices | awk -F'  ' '{print $1 }')
do
  echo "found: $d"
  n=$((++n))
  T[$n]=$d
done

echo "$n lib Wacom devices found."

# we seek for 'Wacom" "keyboard input" (pen press events?)
wacom_tab=`xinput list | grep "keyboard" | grep "Wacom" | awk -F= '{print $2}' | awk '{ print $1}'`
# and it's belonging calibration matrix to edit
calibration=`xinput list-props 13 | grep 'libinput Calibration Matrix (' | awk -F')' '{print $1}' | awk -F'(' '{print $2}'`

if [[ $wacom_tab == 0 ]]; then
  echo "no libinput device found."
else
  echo "libinput Wacom device found!"
fi

# find our display
S=$(xrandr | grep " connected" | awk '{print $1}' )

# we currently support only one device really
if [[ $S == "LVDS1" ]]; then
  echo "Found supported video device"
else
  echo "No supported device found"
fi

# one dry run
rotate

# await for events
tail -fn0 $logfile | \
while read line; do
  echo $line | grep -q "rotation"
  if [ $? = 0 ]
  then
    echo
    rotate
  fi
done
No laptop hinges where harmed during the production of said code.
 
  


Reply

Tags
fujitsu, slackware, support



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
Internal Laptop Mic Not Working - Fujitsu Lifebook A6110 sstoveld Linux - Laptop and Netbook 1 03-26-2012 07:14 PM
Karmic on Fujitsu T3010d Tablet/Convertible PC mrdjflores Linux - Laptop and Netbook 0 05-05-2010 12:45 PM
Using Linux on a convertible laptop with Multitouch-TouchScreen: Thinkpad x200 tablet christian.l Linux - Laptop and Netbook 0 04-17-2010 04:59 AM
knoppix 6.2 and fujitsu lifebook 1010 tablet WhiteDevel Linux - Laptop and Netbook 1 01-20-2010 09:15 AM

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

All times are GMT -5. The time now is 05:33 PM.

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