-
Notifications
You must be signed in to change notification settings - Fork 24
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
non-functioning rotation #36
Comments
Based on the logs, it looks like your postrotate hook is getting called but is not working correctly. According to this, dconf uses D-Bus. I suspect that you're having issues modifying the Unity launcher because acpid doesn't set the for pid in $(pgrep dbus); do
if address="$(grep -z '^DBUS_SESSION_BUS_ADDRESS=' /proc/${pid}/environ)"; then
eval "export ${address}"
fi
done If that doesn't work, also try replacing I'm not sure about the screen keyboard. Does After just rotating your screen, do your Wacom devices (tablet and touchscreen) work properly? Is the TrackPoint disabled? (This is hard to test while the screen is rotated and laid down, but you can try rotating the screen while pushing down to try and push against the TrackPoint.) |
Hi Jim. Thanks.
Yes, when I call it from the command line. I think there's nothing to kill
I'd like to. I guess I'm asking for advice on how to do that. What would I
The touchpad is properly disabled. The touchscreen is properly rotated. Chris |
Okay, so it sounds like the only problems are that, when I can think of two possibilities why you may not see the virtual keyboard:
You can add some additional logging as in the patch below that will help eliminate at least the first possibility. It's probably way more logging than what you actually need (it's effectively walking the code line-by-line), but with this much detail, we should be able to get a much better understanding of what's happening. After applying the patch, will you paste the syslog output here and also any output from the virtual keyboard that goes to the temporary logging file (see the patch)? diff --git a/bin/think-rotate b/bin/think-rotate
index 22d474c..180ced8 100755
--- a/bin/think-rotate
+++ b/bin/think-rotate
@@ -167,22 +167,35 @@ mylogger $"Starting or killing virtual keyboard"
kdialog-update $"Starting or killing virtual keyboard"
# Start the virtual keyboard, if it is installed.
+mylogger "Checking to see if '$virtual_kbd' is available"
if type "$virtual_kbd" &> /dev/null
then
+ mylogger "The virtual keyboard program '$virtual_kbd' is visible to 'type'"
+ mylogger "The value of setto is '${setto}'"
if [[ "$setto" = "normal" ]]
then
+ mylogger "The virtual keyboard '${virtual_kbd}' will be killed"
# So the user reverts back to normal. Kill the virtual keyboard (if it
# is running), since it does not make any sense to use that any more.
if pgrep "$virtual_kbd" &> /dev/null
then
+ mylogger "Virtual keyboard is running with PIDs: '$(pgrep $virtual_kbd)'; killing it"
killall "$virtual_kbd"
fi
+ mylogger "Virtual keyboard killed; remaining PIDs: '$(pgrep $virtual_kbd)'"
else
# The user rotated the screen. Start the virtual keyboard since he
# might need it.
- "$virtual_kbd" &> /dev/null &
+ mylogger "Making log file for virtual keyboard '$virtual_kbd'"
+ temp_logging_file="$(mktemp)"
+ mylogger "Starting virtual keyboard and directing output to '$temp_logging_file'"
+ "$virtual_kbd" &> "$temp_logging_file" &
+ mylogger "Virtual keyboard started; PIDs: '$(pgrep $virtual_kbd)'"
fi
fi
+mylogger "Sleeping 1 sec to check on status of virtual keyboard"
+sleep 1
+mylogger "Virtual keyboard PIDs: '$(pgrep $virtual_kbd)'"
###############################################################################
# TrackPoint and TouchPad # |
Thanks, Jim!! After figuring out how to use a patch file.... I tried your help: When initiated automatically, the temporary file looks like this:
When called from the command line, it is instead:
The syslog entries are as follows:
On Thu, 2 Jan 2014, Jim Turner wrote:
|
See #24, where the wireless is not disabled when |
I went through your output, it looks like the missing reference to DBus is causing the problem. I looked into the different environments that the command line and the hook have and documented it in the main documentation, in case we need this again. There is no However, I use |
I added an It is such an improvement for me that I will merge it in a couple days. However, I do not want to cause regressions, so please test it. |
A naive question: how do I do that? Should I install from the On Mon, 6 Jan 2014, Martin Ueding wrote:
|
You have to install it from the git checkout: git clone https://github.com/martin-ueding/think-rotate.git |
Thanks. I suppose I have undone the extra debugging output I had patched in , Should I have noticed something different, or am I supposed to do thanks, On Mon, 6 Jan 2014, Martin Ueding wrote:
|
@cpbl If you executed the commands that Martin sent and tested the behavior, I think that is what Martin was looking for. Since you noticed no change in behavior, it sounds like the change didn't work. And yes, checking out the @martin-ueding I might be missing something, but the way I read the man page for |
To copy all of the variables from the environment of process while read -rd '' var; do
export "$var"
done < /proc/$(pidof -s foo)/environ Note that this will not remove any previously-defined variables in the current environment (although it will overwrite their values if they are defined in the environment of It might be a good idea to do something like this at the beginning of |
Hmm. I updated the documentation about the environments, and I did see what you say: There is no improvement using But why do Perl programmers use @jturner314 could you add the debugging code as a branch? That way, we can merge it with the current master branch and make it easier for @cpbl to use it. |
This is to help investigate issue martin-ueding#36.
If adding
That's the only reason I've ever seen. The
Done. I also added a line to make it output the environment variables. It's in the jturner314/think-rotate/add-kvkbd-logging branch. |
Did I mention that my home folder is encrypted? I cannot imagine that can make a difference here, but I thought I should mention it. Jan 10 06:11:46 meuser-x230 think-rotate-hook[5421]: Using user meuser. Jan 10 06:12:05 meuser-x230 think-rotate-hook[5548]: Using user meuser. |
I very much doubt that the encrypted home directory is the issue because The I thought of something interesting to try. Run the following in env -i XDG_SESSION_ID=c8 TERM=linux SHELL=/bin/bash XDG_SESSION_COOKIE=36bd8e6a2f35671272f3ef1e52ab6906-1389352306.610380-2055989495 USER=meuser kdialog=false PATH=/home/meuser/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games MAIL=/var/mail/meuser PWD=/home/meuser LANG=en_CA.UTF-8 HOME=/home/meuser SHLVL=2 LANGUAGE=en_CA:en LOGNAME=meuser XDG_RUNTIME_DIR=/run/user/1000 DISPLAY=:0.0 _=/usr/bin/env kvkbd If you've logged out since you posted those logs from 2 days ago, then you'll need to change the command to match your current environment variables. Basically, I grabbed the list of environment variables following
in your logs and placed them in the command env -i [ENV VARS] kvkbd If you execute the command in Please let me know if you need more explanation. |
I just tried to start kvkbd with an empty environment: mu:~ env -i kvkbd kvkbd(22245): KUniqueApplication: Pipe closed unexpectedly. mu:~ 255 env -i DISPLAY=:0.0 kvkbd It then started, though. And I have an encrypted home directory as well |
Hello. In my last message, I should indeed have tried both the Now, when I call think-rotate from the command line, I now see the Hardware-triggered, syslog from going into tablet mode: Jan 13 17:13:55 meuser-lenovo think-rotate-hook[7850]: Using user meuser. Hardware-triggered, syslog from going FROM tablet mode: Jan 13 17:14:05 meuser-lenovo think-rotate-hook[7982]: Using user meuser. think-rotate called from command-line, syslog from going into tablet mode: Jan 13 17:14:25 meuser-lenovo think-rotate[8161]: Script starting up think-rotate called from command-line, syslog from going FROM tablet mode: Jan 13 17:15:05 meuser-lenovo think-rotate[8273]: Script starting up Now, calling kvkbd with same environment as think-rotate used: env -i kvkbd(8683): KUniqueApplication: Pipe closed unexpectedly. [1719][meuser@meuser-lenovo:~]$ kvkbd [Weird. kvkbd is not visible. But...: ] [1719][meuser@meuser-lenovo:~]$ ps -A|grep kvkbd env -i (process:8980): dconf-WARNING **: failed to commit changes to dconf: Error On Sat, 11 Jan 2014, Jim Turner wrote:
|
I had an idea about this whole thing: If we do #39, we could have some server process running from the user. Then instead of the hooks trying to regenerate the user's environment, it could tell the user-server to perform the given action (DBus, socket, …). That way, the correct environment would be used. I have no idea whether this would be an improvement. |
Another advantage to having a daemon is that we could avoid double-executing scripts as sometimes happens with repeated hardware events. |
Indeed. However, this will require a process to run in the context of the user. Is that really worth it to have a think-daemon running all the time? We are getting away from just having some rotation scripts. What really bugs me is that I have the KDE screen settings, and it does stuff when I attach screens and so on. But I work with basic I will have time starting from 2014-02-14, unless I fail one of the exams. Then, I should be able to look into D-Bus and whether we could use that with Python. |
While porting this to Python, I stumpled across Get the git repo, then do:
|
No one else is complaining, so this comes as a question not a bug.
When I call
from the command line,
But when I rotate my screen, the only visible change is that the display rotates. That is, the keyboard does not come up and the unity bar does not appear.
If I remove all my customizations, the behaviour is the same (bad).
The logs in syslog seem to be the same in the two cases (command-line and triggered). Here they are.
First, the triggered rotation and reversion:
And here is the command-line version:
Can anyone help me debug why the script is not working for me?
I'm on an X230-tablet, Ubuntu 13.10, ...
The text was updated successfully, but these errors were encountered: