Ubuntu Always On Top Over Fullscreen - linux

I am running into a problem setting up some automation on Ubuntu and was hoping for some help. I need to be able to start chrome, set full screen, start another window, set that to always on top, and then set focus back to chrome. This should end up with a small window on top of chrome, but chrome receiving all user inputs.
I've done a lot of digging and the best I can come up with is using wmctrl:
// Set chrome as fullscreen<br/>
wmctrl -r [ChromeWindowTitle] -b add,fullscreen
// Set the app as always on top<br/>
wmctrl -r [AppWindowTitle] -b add,above
// Activate chrome<br/>
xdotool search --name [ChromeWindowTitle] | awk '{ system("xdotool windowactivate --sync " $1) }'
The always on top and full screen work, but when an app is in full screen mode it seems to supersede the always on top stack. I've been able to verify this through a bunch of experiments. Basically what I have been able to verify is:
1) I can force an app full screen
2) I can force an app always on top
3) I cannot do both and have the always on top app on top of the full screen app. The full screen app is always displayed on top.
So the question is, is it possible (and how is it possible) to have a window floating over a full screen window? I'm running a fairly vanilla Ubuntu 14.04 so there shouldn't be any big surprises there.
Thanks in advance.
-Mike

Related

How do I near the inputs I make on my phone towards my server via command

I'm trying to mirror my terminals screen on my phone but it's Ubuntu servers TL I want to mirror so when I go out and about I can do some typing on my phone and then when I get home I can resume from where I left off without having to go through the whole entire process I set up again like for example I'm at home using my terminal right and I left off from saying that my text hi and goodbye need to continue and then I'm out and about like at the shopping market or something I open I pull up my phone and I go to juice SSH and I connect via there and it will reconnect me to my current session I already have open and then when I get home it will let me go off when I left off I hope you understand this stack overflow don't fail me :D
I tried going on the internet trying to figure this out because I had no idea where to start for coding which I know some and I tried the internet but I couldn't find anything so I'm trying to overflow I use their services a lot very helpful and hopefully they can help me with my question this is the first time so please don't fail me
You are looking for screen
$ sudo apt install screen
$ screen -S mysessionname
# run commands
To detach from it: CTRL+a+d
To attach from your SSH client in your phone:
$ screen -r
To detach the session at your phone, since keyboard shortcuts are not available, you would need to detach it from your server terminal:
$ screen -ls
There are screens on:
8365.pts-6.vm2 (Attached)
7317.pts-1.vm2 (Attached)
2 Sockets in /var/run/screen/S-root.
$ screen -d 8365
[8365.pts-6.vm2 detached.]

specify the location of a window using a shell script

I am working on a script that will set up most of the programs I use during work.
I started simple like this:
#!/bin/bash
thunderbird &
utox &
firefox http://www.stackoverflow&
it is already pretty nice, but lubuntu doesn't memorize the position. so it is all messed up and i have to position every window.
I am looking for a possibility to move every window using the very same script. I found the -geometry parameter, but it is application specific and e.g. firefox doesn't support something like that.
as I have 2 monitors there has to be the ability to also control the screen the window shows up.
A bonus would be to also set up windows on my 2nd virtual desktop.
Thanks in advance.

Command issue in J2ME

Currently I am working on J2ME App and I am facing command issue in j2me.
When I am adding any command on form its coming under options, not coming directly on screen.
Command selCommand = new Command("Select");
This select command is not coming directly on screen, options is coming on screen then click on option command then Select command is coming.
I want Select command on screen instead of option.
High Level GUI coding in JavaME doesn't let you decide how a Command should be displayed.
The same code may display a Command directly on the screen on some devices, but under Options on other devices. So don't have any control of that.
Your best chance is to look into priorities. By setting a high priority on your Command, you may be lucky that it displays directly on the screen instead of under Options. It is not something you should count on though, since it's not required by the specification, but I suspect at least many devices would do that.
J2ME doesn't let you allow to add commands on Screen it will come in menu but we can set priority to command so that they can be visible in left or right side.
even if you want to add command on Screen you have to use buttons.
Container containerbtn;
Button btnsel = new Button("Select");
containerbtn.addComponent(btnsel );
this.addComponent(containerbtn);

How to manipulate a window in Linux

I've been programming in Linux for years but don't have too much knowledge in the perspective of display. Now I'm asked to write a separate process that will monitor which window (probably not the window created by my process) is focused by the user and do some simple manipulations such as move and resize.
Is it possible? Is there a general way to achieve that? Can someone give any hint I can look into? Thanks!
Use xdotool. It can emulate keystrokes, mouse-actions, find active windows etc.
Example: Run this command in your (non maximized) terminal window and it will jump 10 pixels down and to the right:
xdotool windowmove --relative $(xdotool getwindowfocus) 10 10
It should be available in most distributions, ie sudo apt-get install xdotool or similar for other package managers.
Essentially its the XWindow system that does it all. However you can control a lot of it using simple utilities. For example if I wan to change the title of a VLC window, I can do it like this:
# this will ask me to point to a window and I will point to VLC player
$ xwininfo -all | grep 'xwininfo: Window id:'
xwininfo: Window id: 0x2000011 (has no name)
Here 0x2000011 is the window id of VLC Player running on my system. We can use this window to get or set properties. To do that we can use xprop utility:
for p in _NET_WM_VISIBLE_NAME _NET_WM_NAME; \
do xprop -id 0x2000011 -format $p 8s -set $p "MyVLC"; done
This will change the window title of VLC Player to MyVLC.
Although this is what xdotool also does behind the scenes, these commands are fairly low level, and are very likely be installed by default.
References:
https://github.com/ChickenProp/set-window-title/blob/master/set-window-title

unix shell command that make the virtual desktop spin

I'm looking for a way to make my virtual desktop change without using keyboard shortcuts.
I explain: I want to do a java program that will change my current desktop to the desktop at the left for exemple, let's say by clicking on a button. I've done it using keyboard shortcuts sent by the java program, but i want it more universal (i mean, that can work for everyone). Hope I'm clear enough!
Thanks.
This will give you available workspace (virtual desktop) names:
wmctrl -d
then
wmctrl -s <workspace name>
will move to the workspace.
Take a look at here http://tomas.styblo.name/wmctrl/ to see what window managers are supported.
My previous answer was:
xrandr is probably what you want. Take a look at this wikipedia page here too.
I thought xrandr will work but couldn't figure out how. I hope someone will comment and give the definite answer whether xrandr will work or not.

Resources