awesome-wm external monitor and laptop - awesome-wm

I use awesome wm with an external monitor on my laptop but sometimes I move and take the laptop only.
My question is: what happens with the clients opened in the external monitor when I disconnect it to move the laptop?
Is there a way to make awesome remember the layout of the screens? currently I'm using arandr every time I plug the screen but it is very annoying to do that every time I move the laptop.
In general any tips about how to handle a setup with an external display and a laptop is what I'm looking for.
Thanks!

Check out autorandr
It's been working perfectly for me when plugging/unplugging monitors.
EDIT:
Here's an example of how I used autorandr (on Ubuntu)
git clone https://github.com/wertarbyte/autorandr.git
cd autorandr
make deb
dpkg -i autorandr*.deb
Save my current config (no monitors)
autorandr --save mobile
Plug in additional monitor (and configure your settings)
autorandr --save multi
It should now automatically detect and apply the correct configurations when devices are plugged/unplugged. This works via a udev rule:
cat /lib/udev/rules.d/40-monitor-hotplug.rules
ACTION=="change", SUBSYSTEM=="drm", RUN+="/bin/systemctl start --no-block autorandr.service"

Nothing happens! All your applications stay open as they were when you had your monitor connected. When you reconnect the monitor everythingi will still be the same.
Take note that this means that you can still go with your mous on the disconnected screen. Your mouse will simply disappear ath the edge of your monitor because awesome still thinks that there are two screens.
If you want awesome to realize that there is only one screen remaining you have to reload the awesome-config. Once you do that, all open clients will be distributed according to your client rules on the available tags.

Related

Why Qt can not capture touch event after re-plug USB touch device?

Have a good day.
I have a problem about touch device's hot-plug.
I set the environment variable as below.
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/ts_uinput:rotate=0
The "/dev/input/ts_uinput" is created by ts library's application "ts_uinput".
The touch function can work normally before I re-plug the USB touch device.
If I re-plug the USB touch device, the touch function doesn't work.
The "/dev/input/ts_uinput" still is created after I re-plug the USB touch device.
I also monitor the data in "/dev/input/ts_uinput" and it also has data report.
Why the Qt does not get the touch event after re-plug the USB touch device?
I would boldly guess that this is because Qt (the Qt evdev platform plugin) opens /dev/input/ts_uinput when the app start. When you replug the touch device, the file is recreated but the file handle held by Qt has become invalid. Making it work again would require Qt to close and reopen the handle.
You could try getting more info by enabling debug logs: http://doc.qt.io/qt-5/embedded-linux.html#debugging-input-devices
However, I do not know if this is a bug or a missing feature, you might want to contact the Qt interest mailing list or report a bug.

Beaglebone Black, Qt Application, and startup procedure

I have a BBB running Debian 3.18.13-bone70. I have made a Qt application that works great. I would like this application to run on startup.
Currently, I have made a script, placed it in /etc/init.d and made a symbolic link to it in /etc/rc5.d/S05application. This all functions correctly.
The issue that I'm having is when my system boots up, I see my application briefly (<1 second) before the CLI login screen appears and hides my application.
I've tried playing around with the startup script location (moving it to rc2.d, but the same issue persists.
I have a splash screen that times out after 10 seconds, and it moves on to the next screen. After moving to the next screen the application is never hidden again. I would like to see the splash screen the entire time and hide the CLI login screen entirely. How could I go about doing this?
EDIT:
#!/bin/bash
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_TSDEVICE=/dev/input/event1
/home/root/./Scanscale -qws
This is the script that I use to start the application. The Qt window service is used when I start the program.
EDIT 2:
I'm running Debian 7 using the Debian 7 image from http://elinux.org/Beagleboard:BeagleBoneBlack_Debian from March 1, 2015. This is maintained by Robert Nelson, I'm not sure if it's a yocto build or something else.
Furthermore, it doesn't appear to be an X issue. I've stopped loading X, I no longer boot into the application and just sit on the command line waiting to log in. The system flickers at about the same point in time. Any thoughts?
I should probably also mention that I'm running it on a 4.3" LCD cape, not on the HDMI interface.
You weren't specific about your system and what else is running on it. For example, is it a yocto build and does it run the sato user interface, or is it more traditional X server with a display manager, window manager, etc? Either way, there is a session-specific file which directs what programs get launched when the Xserver starts up. Using matchbox, that file is .matchbox/session. With X, it's usually xinit, which is driven by .xinitrc or .xserverrc. Also, look at startx as another poster mentioned. The latter can either be in your home directory or /etc/X11. Depending on your system and configuration, likely one of those methods, customized, is what you're looking for. See man xinit for more info.

USB driver not loading one USB image but loads another?

I have a usb driver with multiple IOKitPersonalities each with a IOMediaIcon entry. all works fine if the usb devices are plugged in after the kext has been loaded (kext loads fine, is signed, etc.). but after reboot of the computer, only ONE of the usb devices shows the standard orange default usb image. if I unplug/reload kext/replug the usb device in, the image gets corrected.
Any thoughts?
(Details:
running Mac OS X 10.10.1 (I don't think I saw this problem before Yosemite, definitely not a problem on 10.6.8), all the Personalities are the same (except for the IDs (which are correct I think since the usb device loads correctly if I plug in after the kext is loaded) so it isn't mistake with the personality...)
I don't know how to fix your specific problem, but I can give you some pointers which may or may not be helpful (sorry, a bit too big for a comment, but not a proper answer):
The icon stuff is handled in user space, the only thing that the kernel should have to do in theory is set the IOMediaIcon before registering the service. Setting it in the personality should be fine.
In user space, Disk Arbitration takes over. You can download (most of?) the source code for it from Apple's Open Source Site.
A quick search reveals that the diskarbitrationd source code does indeed reference the IOMediaIcon, in DADisk.c
I don't know how well it works to recompile diskarbitrationd and substitute Apple's binary with your own, but if that works, maybe you can modify it to log output from the icon code, and get closer to your answer that way?
The other source of error I can possibly think of is that although the system gets the correct icon information, it can't actually find the icon file? I've heard about various bugs related to bundles and resources in the context of /System/Library/Extensions vs /Library/Extensions since they added the latter. If your icons are in your kext bundle, and you've switched to /Library/Extensions, try switching back to SLE.
I hope that helps your debugging efforts!

How to programatically change the output mode of an intel gma450 graphics card to clone

I would like to change the output mode of an Intel GMA450 based graphics chip to "cloned" mode.
Since the environment is a Windows Embedded Standard and only one of the connected monitors might be visible for the enduser, I would like to either permanently set the output mode to cloned or reset it continuously to cloned mode in case the actual mode differs (e.g. after a reboot, disconect/reconect of the second monitor or by other means).
Is there a way (Registrykey, API for the Intel driver, Win-Api) to change the display mode to cloned / dual output programatically?
Update:
I found the SDK for the IEDG driver it seems that I might be able to programatically set the resolution, clone mode etc.
However, I can't find the SDK or any information for the driver I am currently using: IntelĀ® Graphics Media Accelerator Driver for Windows* XP, version 14.32.4.4926.
This isn't a good answer, but it might get you headed in a direction to figure it out.
My last laptop had an external monitor connected, and the Intel drivers would often be confused about the orientation of the secondary after a reconnect or a reboot. I got tired of dealing with that and tried to fix it programatically because the clicks were too many in the GUI. Select this monitor, select rotation, select other monitor, select rotation, apply, arrange, apply, wait...
I spent about a day on it (ahh, the days of being an employee vs. self-employed!) and the solution I found was to use a program to compare the registry (regshot perhaps?) to discover what keys were involved in the correction (what they were before versus what they were after) and then there was an intel-provided exe that forced the driver to reset based on the registry-- the exe was essentially like pressing the "apply" button in the gui. I was running XP and if I recall, the gui management was for configuration of the Intel Graphics Media Accelerator Driver for Windows XP as well. So the final solution became a cmd file on my desktop that would apply a REG without confirmation and then run an exe with some parameters.
Now, I don't have that laptop (they didn't let me walk out the door with it when I quit!) and I do not remember the specifics on the exe that was required to do the reset. Just changing registry keys didn't spontaneously cause it to take effect-- there was an api call involved, which I just handled with their exe. I know that isn't a lot to go on, but something tells me the file was in the driver package, or somewhere on the drive already, and I just found it. Running it at the command line gave options. Like /reset.
I hope that helps you a little. Be sure to post back if you figure it out.
Also post back if I'm completely mistaken and it didn't happen like this at all. But that's the way I remember it. :)

What is the best tool to make a CD-ROM Demo Application?

I have to make an application that will do the following:
Open a video file embedded in the application
Open some pdf files, preferably embedded in the application, but if it will have to open externally, it's no problem.
Work in fullscreen on the user computer, with a minimum resolution of 1024x768. I'm thinking about a resolution of 1024x768, centered on a black background.
I was thinking of using Flash, but I don't have much experience, so if there is another easier IDE that creates a Flash application, I would prefer that.
So, if anyone knows any Flash component to do this, I'll be very thankful.
Creating a Flash CDROM takes a little bit of care, but from my experience it's well worth it. From your requirements, the Flash IDE is well up to the task. The common requirements are as follows:
Windows / Mac platform
Flash Projector file
Autorun file (For the Windows platform)
Net access or all local
If your client is happy with creating the CDROM just for Windows, there will be very few dramas - but if they want to create a Mac-friendly version, you can do that too and I will explain afterwards.
Your Flash should preferably be an .exe projector file - the reason for this is so that the Windows user can open your app without downloading a Flash player (If the client wants a CDROM, they probably have limited net access, so this is a good thing!)
Within Flash, you can perform all your standard fs commands including full-screen.
You will likely need an Autorun file so that the user sees your application as soon as you put in the CDROM - simply create a file named 'autorun.inf' in notepad and enter the following:
[autorun]
open=yourProjector.exe
Where 'yourProjector.exe' is the name and path of your projector file.
It sounds like you're going to embed your videos and content in the CDROM - this is usually the ideal case, since your client won't receive annoying security messages, but this can also be a bad thing if you want to correct your content later (spotting errors after a thousand CDROMS have been distributed can be a PAIN).
You can serve some of your content online to avoid this, but it would give your user some ugly messages, so as long as you triple-check your content and embed everything, it would be the best scenario.
Now for a Mac, Apple has done away with autorun features years ago - there is a way to turn it on through Quicktime, but this is off by default for almost all Mac users, and turning it on is not recommended because it makes the Mac vulnerable to the 'Hong Kong Virus', one of the few Mac viruses around.
You can make your CDROM mac-friendly by creating a Mac Projector and adding instructions for how to use it by changing the background image of the CDROM window. I haven't had to do it before, but I hear that it's not too difficult.
You can use the Flash Projector. Here is a tutorial to get you started. Now, you won't be able to embed the PDF files but you can open them easily enough using fscommand("exec","foo.pdf")
You can create an Adobe AIR Application; however it won't run off the CD ROM; it'll need to be installed locally.
If creating a projector from Flash Pro doesn't work; look at a tool like Janus or Zinc

Resources