How to cleanly kill Ubuntu onboard keyboard with keystroke from the onboard keyboard - linux

I am trying to close the Ubuntu onscreen keyboard named onboard with a command entered by that keyboard. What happens is if I type a kill command such as the following using the onscreen keyboard itself. . .
killall onboard
and then hit Enter again on the onscreen keyboard, I get continuous Enter hits on the terminal I was on. It's like I unplugged a physical keyboard and it keeps thinking I'm hitting the key I depressed as it was being unplugged.
I can't find any documentation online for how to do this any better so I thought I would ask here. I've tried the following sending the following kill signals which all have the same behavior: 1 (SIGHUP), 2 (SIGINT), 9 (SIGKILL), 15 (SIGTERM), and 24 (SIGXCPU).
Any ideas? I'm hoping I'm missing something obvious. . .

So I found the answer: https://bugs.launchpad.net/onboard/+bug/1032042
Once you have onboard 0.99 installed and running, you can execute the following two commands to show and hide the keyboard respectively without having to kill the process:
dbus-send --type=method_call --dest=org.onboard.Onboard /org/onboard/Onboard/Keyboard org.onboard.Onboard.Keyboard.Show
dbus-send --type=method_call --dest=org.onboard.Onboard /org/onboard/Onboard/Keyboard org.onboard.Onboard.Keyboard.Hide
This solved all my problems in a way better than just killing it.

Related

Can't find stop button in Android Studio to stop the emulator

I don't know how to stop the emulator. Apparently, there's supposed to be a stop button but it's not there?
You can close the running Emulator by clicking the x button at the top of the Emulator tab (see image below)
Print a list of your devices:
adb devices
Kill it using emu
adb -s emulator-5432 emu kill
You can close the Emulator by clicking the X button at the top of emulator window. I found this answer on another stack overflow thread. There they've provided a complete explanation along with the original documentation. If you want you can check out that answer here
I know of no other way than the command line, as #Tian said. Closing the emulator window has no effect as far as I know...
To add more explanation:
open a terminal window (either the AS one or any other, as long as adb commands are available)
list the running connected devices with: adb devices
identify your emulator in the resulting list (usually in the form of: emulator-5556 device)
now kill the emulator with: adb -s emulator-5556 emu kill (replace the name of your own emulator in the command of course)
You'll see a confirmation message like OK: killing emulator, bye bye
enter code here
no stop button in bumblebee I also failed to find a way to stop it pressing the power button for long shows options lockdown poweroff and restart which in my case didnt work checked avd location lock file was created so finally killed it through taskmanager by ending qemu task

Detect Keypress in background Linux in c/bash

I want to detect a key combination like alt+g in an application that runs as a background process (other keypresses/combinations should be executed normally) ,
if the combination is pressed i want to block all keypresses and send them via serial to another linux pc instead of executing them. I cannot find a solution for detecting the key combination and recording the keys within a background process.
I'd prefer to use a bash script, but c is ok aswell.
I just cant find a starting point. Any directions or help are appreciated.
Using Xlib I managed to fetch the keyboard Input http://www.x.org/releases/X11R7.7/doc/libX11/libX11/libX11.html
Doesn't the application screen do what you want? Allows you to detach & reattach to sessions on another PC over network (which could be connected over a serial line)?
10 Screen command examples and
How to use Linux Screen

how to stop ubuntu from making sounds for every key i press

I'm using ubuntu 14 that from some reason announce on every key that is pressed. I don't know how someone did it, but i would love to know how to stop it.
Have you tried entering "xset -b" in a terminal prompt ?

Ubuntu BASH Script Background Job Hide Windows

I have a seemingly simple problem that I can't figure out how to solve.
I have a bash script which launches a program in the background within a loop. However, each time the program opens up it launches a window and focuses on it. Is there a way to launch a process and have all of the windows which it launches be minimized or completely suppressed?
Here is my code:
#!/bin/bash
while true; do
process1 & P=$!; #I need to hide all of the windows in this process
process2;
kill $P;
wait;
sleep 0.1; done
Thank you for your help.
Use xdotool, replace name_in_titlebar with the name from your titlebar :D
xdotool search --name name_in_titlebar windowactivate
xdotool key ctrl+super+Up
This is up to the Window Manager. Try looking up how to prevent focus stealing in your wm documentation.
For a more general approach, you can start a second X server (startx -- :1 and then Ctrl-Alt-F8 to switch to it), run an instance of Xnest to get an X-server-in-a-window where subwindows won't steal focus, or run a vncserver/nxserver that the windows can spam and you can occasionally connect to and look at if you want. With any of these set up on e.g. display :1, you can redirect your process's window with DISPLAY=:1 process1.

Used Ctrl-Alt-F6 in Linux, and can't get my screen back

This is obviously a stupid question.
I am coding in Eclipse both on Mac and Linux, but I mixed up and used the Mac shortcut to window tabbing (Ctrl-Cmd-F6), but I was using the Linux on uni and screen went black. I've done this before, but this time I can't get back to my desktop. Ctrl-Alt F1-F6 gives me different terminals, F7 gives me a black screen and F8 a blinking underscore in the top left corner. Shouldn't my session have been somewhere in F1-F6 and is it lost?
Ctrl-Alt-F7 should work perhaps your X has crashed?
I just did what you did and F7 got it back for me, saying that before I remember X crashing and I had the same black screen
I had the same issue. I tried with hitting ctl+ alt + F1 together. And it worked
X is probably still running on F7, your display driver (or something else) is just misbehaving. You might be able to trick it into coming back on by going to F7 and blindly opening a terminal and playing with xset ($ xset dpms force on). Or you can ctrl-alt-backspace to kill X and GDM should restart it.
Try seeing if you can repeat the problem and then file a bug report (or let the lab admin know if it isn't your computer). It probably has something to do with your distro's kernel configuration/patching. I've had this happen before on Ubuntu but not any other distros (I've used many), which is why I am assuming it might be distro-specific issue. Probably the unintended consequences of some kernel patching.
The ctrl+alt+Fx (x=1..6) key combinations often allow you to have up to 6 concurrent terminal sessions on the console.
Usually one is setup to use X windows, and differs from distribution to distribution. Typically its on Ctrl+Alt+F7.
http://linux.about.com/od/linux101/l/blnewbie5_1.htm
Some distributions of Linux allow you to kill the X Windows session with Ctrl+Alt+Backspace at which point the operating system will attempt to restart it.
alt + F1
works for ubuntu 18.04.
In the future, you can go into a terminal and type:
init 3
To bring the system into text mode, and:
init 5
To return the system to X mode. The nice thing about doing it that way is that everything should be shut down and restarted cleanly.
For My case. I tried with hitting
ctl+ alt + F2
together. And it worked in Fedora
Try Ctrl-Alt-F9, and Ctrl-Alt-F10. :-)
Looks like X crashed. To check, you could log in on one of the terminals (on Ctrl+F1 etc.) and check that the "X" process is still running.
I've had the same happen to me recently, and found the SIGSEGV and backtrace later in /var/log/Xorg.0.log. Curse your graphics driver vendor (usually) and then reboot.
We're running gnome on Red Hat 5.
ps axu in one of the other terminals showed some of the processes still running. Probably something with the display drivers then. Did ctrl-alt-backspace and restarted it. Thanks for the help.
F8 solves the problem in Linux Mint 17.3 Rosa

Resources