Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It stopped working after a while #9

Open
IlgazC opened this issue Nov 6, 2019 · 3 comments
Open

It stopped working after a while #9

IlgazC opened this issue Nov 6, 2019 · 3 comments

Comments

@IlgazC
Copy link

IlgazC commented Nov 6, 2019

Sorry for unscientific title but I installed this one 2 days ago, it was working when first installed and now it does nothing when I physically rotate the device (hp pavilion 13" x360).
I got some system log entries which seem related (taken when I rotated the device)

Kas 06 23:51:23 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: warning: output not found; ignoring
Kas 06 23:51:23 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: awk: option -W interactive' unrecognized, ignored Kas 06 23:51:23 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: rotate -- pointers: <<11 Kas 06 23:51:23 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: 12 Kas 06 23:51:23 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: 15>> matrix: <<-1 0 1 0 -1 1 0 0 1>> Kas 06 23:51:30 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: normal Kas 06 23:51:30 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: Error org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.UPower.KbdBacklight” on object at path /org/freedesktop/UPower/KbdBacklight Kas 06 23:51:30 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: warning: output not found; ignoring Kas 06 23:51:30 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: awk: option -W interactive' unrecognized, ignored
Kas 06 23:51:30 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: rotate -- pointers: <<11
Kas 06 23:51:30 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: 12
Kas 06 23:51:30 ilgaz-HP-Pavilion-13-x360-PC auto-rotate[2409]: 15>> matrix: <<1 0 0 0 1 0 0 0 1>>

Ubuntu 19.10 here with "kubuntu-desktop" installed. I already have issues so I stay away from anything advanced (hacks etc), I just have the "kde backports ppa" installed which seems to update kde to current stable version.

@IlgazC
Copy link
Author

IlgazC commented Nov 7, 2019

Here is the output when I run auto rotate via bash -x
bash -x auto-rotate

  • DISPLAY=:0
  • export DISPLAY
    ++ xrandr --current
    ++ grep connected
    ++ awk -W interactive '/primary/ {print $1}'
    awk: option `-W interactive' unrecognized, ignored
  • MAIN_SCREEN=eDP-1
  • echo eDP-1
    eDP-1
  • monitor-sensor
  • awk -W interactive '/Accelerometer orientation changed:/ { print $NF; fflush();}'
  • read -r line
    awk: option `-W interactive' unrecognized, ignored
  • echo bottom-up
    bottom-up
    ++ xrandr
    ++ grep -c ' connected'
  • nscreens=1
  • '[' 1 '!=' 1 ']'
  • case "$line" in
  • dbus-send --print-reply=literal --type=method_call --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness int32:0
    Error org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.UPower.KbdBacklight” on object at path /org/freedesktop/UPower/KbdBacklight
  • xrandr --output eDP-1 --rotate inverted
  • rotate_cursor -1 0 1 0 -1 1 0 0 1
    ++ xinput list
    ++ awk -W interactive '/Virtual core pointer/ { printing=1 } /Virtual core keyboard/ { printing=0} { if (printing && (match($0, /ELAN/) || match($0, /Pen/) || match($0, /Finger/) || match($0, /Touch/) )) { gsub(".*id=",""); print $1 } }'
    awk: option `-W interactive' unrecognized, ignored
  • pointers='11
    12
    15'
  • echo 'rotate -- pointers: <<11
    12
    15>> matrix: <<-1 0 1 0 -1 1 0 0 1>>'
    rotate -- pointers: <<11
    12
    15>> matrix: <<-1 0 1 0 -1 1 0 0 1>>
  • for p in $pointers
  • xinput set-prop 11 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
  • for p in $pointers
  • xinput set-prop 12 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
  • for p in $pointers
  • xinput set-prop 15 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
  • install_background bottom-up
  • export BACKDROP=/home/ilgaz/.config/auto-rotate/bottom-up.jpg
  • BACKDROP=/home/ilgaz/.config/auto-rotate/bottom-up.jpg
  • '[' -f /home/ilgaz/.config/auto-rotate/bottom-up.jpg ']'
  • read -r line
  • echo normal
    normal
    ++ xrandr
    ++ grep -c ' connected'
  • nscreens=1
  • '[' 1 '!=' 1 ']'
  • case "$line" in
  • dbus-send --print-reply=literal --type=method_call --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness int32:1
    Error org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.UPower.KbdBacklight” on object at path /org/freedesktop/UPower/KbdBacklight
  • xrandr --output eDP-1 --rotate normal
  • rotate_cursor 1 0 0 0 1 0 0 0 1
    ++ awk -W interactive '/Virtual core pointer/ { printing=1 } /Virtual core keyboard/ { printing=0} { if (printing && (match($0, /ELAN/) || match($0, /Pen/) || match($0, /Finger/) || match($0, /Touch/) )) { gsub(".*id=",""); print $1 } }'
    ++ xinput list
    awk: option `-W interactive' unrecognized, ignored
  • pointers='11
    12
    15'
  • echo 'rotate -- pointers: <<11
    12
    15>> matrix: <<1 0 0 0 1 0 0 0 1>>'
    rotate -- pointers: <<11
    12
    15>> matrix: <<1 0 0 0 1 0 0 0 1>>
  • for p in $pointers
  • xinput set-prop 11 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
  • for p in $pointers
  • xinput set-prop 12 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
  • for p in $pointers
  • xinput set-prop 15 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
  • install_background normal
  • export BACKDROP=/home/ilgaz/.config/auto-rotate/normal.jpg
  • BACKDROP=/home/ilgaz/.config/auto-rotate/normal.jpg
  • '[' -f /home/ilgaz/.config/auto-rotate/normal.jpg ']'
  • read -r line

@ddacons
Copy link

ddacons commented Jan 12, 2020

Hello,
Your post helped me fix my issue, so I hope to return the favor.

I have an HP Spectre x360 with the same tablet mode and orientation. On a fresh install of auto-rotate I got similar errors as you, but I also received one indicating that the screen it was attempting to update didn't exist like this:

» ./auto-rotate
awk: option `-W interactive' unrecognized, ignored

awk: option -W interactive' unrecognized, ignored right-up Error org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.UPower.KbdBacklight” on object at path /org/freedesktop/UPower/KbdBacklight warning: output not found; ignoring awk: option -W interactive' unrecognized, ignored
rotate -- pointers: <<12
16>> matrix: <<0 1 0 -1 0 1 0 0 1>>
normal
Error org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.UPower.KbdBacklight” on object at path /org/freedesktop/UPower/KbdBacklight
warning: output not found; ignoring
awk: option `-W interactive' unrecognized, ignored
rotate -- pointers: <<12
16>> matrix: <<1 0 0 0 1 0 0 0 1>>
^C

I believe something must have happened with the 'awk -W interactive' option as well as the command to modify the backlight at some point as that seems to be the issue. Looking at your output I saw that my 'MAIN_SCREEN' variable was different and that I was also getting the errors about awk not recoginized. I ultimately hard coded my screen name and commented out the lines about modifying the backlight (I'll worry about that later). After that I restarted and all seems to be working fine. Still getting the awk errors, but they aren't affecting the rotating. Hope this helps you somehow.

Regardless, thank you for helping me!

@blauer4
Copy link
Contributor

blauer4 commented Apr 28, 2020

I found out the issue. It seems that the service would start too early and then the script couldn't load properly the service. This caused the script to not found the screen. Adding a little bit of delay on the start of the service seems to resolve this issue, will propose a merge after a little bit of testing.

blauer4 added a commit to blauer4/kde-auto-rotate that referenced this issue Apr 28, 2020
The issue caused the script to not work after a restart or shutdown, because it was called to early. All has been resolved by adding a start delay on the service, by using ExecStartPre=/usr/local/sleep 10.
Don't know if add a little more delay for older system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants