Update active settings when plug and unplug the external monitor to the laptop - archlinux

I have settings for an external monitor and a laptop screen. They are in the ~/.xprofile file and look like this:
xrandr --output eDP-1 --primary --mode 1920x1200 --pos 760x1440 --output HDMI-1 --mode 3440x1440 --dpi 144
I use arco linux with awesome wm.
If I restart my laptop with the monitor connected, everything works fine. But if I just connect the monitor to an already turned on laptop, then the monitor positioning is wrong. The laptop is under my external monitor, but when I connect the system positions the monitor to the right of the laptop.
The question is how to make sure that the monitor positioning settings are applied when it is connected to the laptop and not when I reboot.
Also, when I disconnect the monitor, my laptop still thinks that the monitor is connected and allows me to move the mouse course away from the laptop screen.
I would like that the settings automatically applied when you connect and disconnect the external monitor. Please, advise how to do this?

Related

Phone connected to adb via Wi-Fi disconnects immediately when USB cable is pulled [duplicate]

I develop on my tablet using android studio.
The tablet is connected to the computer by wifi using
adb connect <ip_andress>:5555
My application contains listeners for USB devices attached/detached.
But unfourtunately, when I connect/disconnect usb device to/from the tablet, the adb connection is getting killed, and I can no longer see the device under "adb devices".
It is not a adb-connection-by-wifi what gets killed. It is just that USB enumerations affect the sys.usb.* system properties which on many devices is causing restart of adbd regardless whether it's being used over USB or tcpip.
Do grep "stop adbd" /init*rc to see what I mean.
You could either comment out those stop adbd lines or just disconnect the USB cable before running your adb connect command.
I was never able to connect my cellphone with my computar through wi-fi.
I had already given up. I followed all the instructions and tips, and nothing worked.
Finally, I did what no one said to do.
I've connected the phone to the WiFi network provided by the cable modem itself and not to some (not all) additional networks that are included in the router.
At home I use one of these networks, because I use a Deco Tp-Link router, which propagates the signal to my entire house, but this network is NOT compatible with ADB. It does not identify it as belonging to the same network.
After this, I use the normal procedure described here.
a) Connect cellphone with a USB cable
b) Find the IP_Phone depends on system in the cell phone. Here I use Settings, About Phone, Status and IP address.
c) Run the following adb commands in Command Prompt (Windows) or Terminal (Linux), where IP_Phone is the IP above mentioned. Normally adb.exe is an executable stored in computer path. adb is already included in Android Studio package.
adb tcpip 5555
adb connect IP_Phone
d) Now disconnect USB cable and it's ready. The cellphone model continues to appear in the status line in the top of Android Studio.
-/-
The best wifi is that defined in Cable Modem. It, unlike an any account defined in my router, answers to a ping command.
ping IP_Phone
Disconnect the usb cable just before running adb connect <*ip_address_of_your_phone*>

Cannot access USB UART in VirtualBox Guest on macos Host

I've created a virtualbox via docker-machine:
$ docker-machine create --driver virtualbox default
Within the Guest-OS I'd like to access my USB-Serial device, which is a Nordic nRF52840 DevKit, which is listed in macos as /dev/tty.usbmodem144241.
However, this device is not listed as USB device by virtualbox. I've also tried adding the devices as a Serial Port with the Port Mode "Host-Device" as described in this link, but without any success:
If I add the Serial Port as .tty-usbmodem the virtualbox will hang in 'Starting', I have to kill all virtualbox processes or disconnect the serial cable in order to start again. If I use .cu-usbmodem the virtualbox starts up but immediately crashes.
I'm running out of ideas here. I'm stuck at this issues since docker for mac does not support the --devices mapping without virtual machine, and for the virtual machine I somehow can't manage to add the port.
Any ideas on what else I could try?
So as it turns out virtualbox is quite picky about when a device is actually connected and does not work as seamlessly as I'm used from using VMWare:
The device I was using really just shows up as SEGGER J-Link in the USB menu
It must be added as filter (filter is really confusing > first I thought it would ignore the device)
The device cannot be added to the virtualbox 'on the fly' (using the USB-icon in the 'Show' window, see screenshot), it must not be connected before the virtualbox starts up.
The serial-tab is irrelevant > it's all handled via the USB tab.
The important fact is that the device must not be connected wenn the virtualbox fires up. So the steps to add a device are the following:
Power down the virtualbox
Make sure the USB controller is enabled
Connect the USB/serial device to the computer (host)
Add it to the filter in the virtual box
Now every time you want to use the device with the virtualbox:
Make sure the virtualbox is down (e.g. docker-machine stop default)
Disconnect the USB/serial device from the computer
Start up the virtualbox (e.g., docker-machine start default)
Virtualbox should now be able to "intercept" the device and list it under /dev, e.g., as /dev/ttyACM0
Un-/Plugging a filtered device once the box is up also works (you don't have to power down the virtualbox again if you forgot to disconnect the device before starting it up. Just wait for the box to be up, unplug, plug in, should be good).

Qubes OS: No networking?

I am using a Lenovo T420 machine having Cubes OS 3.2 freshly installed. On the upper right corner where the system tray icons reside appears no entry that allows me to connect to my home wifi. I tried to reboot the system several times without change. Right before the install I had an up-to-date Ubuntu installation and networking was no problem at all.
Somewhere on the web I read about weird interference about networking in cubes having wifi enabled or ethernet plugged in during the install. Furthermore I read about Cubes OS having trouble sometimes with Lenovo systems that have to hardware wifi toggle.
As my Lenovo Thinkpad T420 has such hardware toggle this inspired me to do the following:
Having Cubes OS booted without any networking icon in the system tray
Toggle the hardware switch to disable the wifi
Reboot the whole system
Directly after the restart my networking has been recognized by Cubes OS showing up the icon in the system tray. After toggling the hardware wifi switch again to enable it, available wifi networks have been listed and I were able to connect. Since then my networking works fine. Indeed I have not tested out yet if a cable connection would still work out. But it doesn't matter for me for now.

VMware USB autoConnect blacklisting?

Is there a way to stop VMware (Workstation 12 Player) from automatically connecting a USB device?
When I wake up my Surface (Win 10 x64) it connects the Type Cover to the running Linux (Ubuntu 14.04.3, 4.3 kernel) guest, which doesn't seem to know how to handle it. I then have to use the touch screen to manually disconnect the device (= attach it to the Windows host) to be able to move my cursor or type again.
I'm sure there is an option to ignore a device in the .vmx config file...?
Edit: Note that I don't want to generally disable usb.autoConnect, because I need it for another device (an Arduino Micro that must be quickly reattached in bootloader mode...)
You can either stop Mware USB Arbitration Service
or
try to uncheck "Automatically connect new USB devices" in "VM Setting ->USB controller panel" and check "do not show this hint again".

Raspberry Pi2 IoT no HDMI output

I have had Win 10 IoT Core running on a Raspberry Pi2, it was working fine, I had ported across my signage software, and all good, then the hdmi port stopped working ? my monitor just says no output, and goes into sleep mode. the Pi is running as I can assess it via the web portal, I can still deploy my application to it, and it says its running, but nothing been displayed.
I know that when using Linux there is a config file that you can modify, but what do you do with windows version ?
you have the configuration file for Windows too. check in the root of SD card. refer https://www.raspberrypi.org/forums/viewtopic.php?t=5851. You can try setting (this forces the board to use DVI mode instead of HDMI)
hdmi_group=2 # forces DVI timing to be used
It might also be due to low power input to the RP2, which could cause HTMI to not work. Try using USB3 or 1.5A~2.0A/ 5V adapter.
Ensure that you are running headed mode and not switched to headless by mistake. Details here: https://ms-iot.github.io/content/en-US/win10/HeadlessMode.htm
he display.