Menu

VcItem appication suggestion (VNC/RPD/X11)

2009-08-25
2019-05-02
  • Mark McCorkle

    Mark McCorkle - 2009-08-25

    Could you make a vnc client (or RPD/remote desktop) as a VcItem relatively easy?  Or even more frighteningly, an X11 server that is just a VcItem on the surface of the cosmos?  Both of those ideas would allow a crafty user to "embed" whatever application they'd like into their cosmos with no special coding on your behalf. 

     
    • Oliver Hamann

      Oliver Hamann - 2009-08-26

      ...and the applications should start and stop automatically as the user zooms in and out. It would also be nice for virtual machines and emulators. Imaging you could find all mame games in the cosmos.

      Problems are (in-)persistence, double assignment of certain keyboard and mouse inputs, and that the applications themselves are still old style and not zoomable user interfaces.

      But it would be lots of fun.

       
    • Mark McCorkle

      Mark McCorkle - 2009-08-26

      You see exactly what I mean :-)  I'll see if I can response to the problems:

      * in-persistence: most emulators have a "save state" feature built in, you'd just have to tie that into the hook that gets fired when the VcItem goes out of focus.  As for vnc/rdp/x11 apps, you are only connecting / displaying pixels of applications that are actually being run elsewhere, so the state is managed on the remote machine.  The only stickiness you'd have to deal with inside of eagle mode is the authentication ... when the user zooms in the first time, they'd have to provide a hostname / username / password to connect to the remote machine, then when the app loses focus, to save bandwidth, you'd disconnect -- but you wouldn't want the user to have to re-auth each time, so you'd have to save last connections and just re-establish on re-focus.

      * Double assignment of keyboard/mouse:  Oh yeah, this one is a problem EVERYWHERE.  I run a lot of virtual machines (virtualbox and vmware) and when you move the mouse into the focused area, you lose control of your local machine until you hit a magic key-combo (ctrl-alt at the same time).  That seems to work well for me with virtual machines.  The other method I see used is "sloppy focus" mode with X -- the mouse is free to roam into and out of focus on the target VcItem/application, but while the mouse is over the application, the application gets full mouse / keyboard focus (including special keys like ctrl-alt-BS) until the mouse goes beyond the boarder of the application (or hits a magical corner). 

      * applications themselves still being old school GUI instead of ZUI: absolutely -- back in the windows 3.1 days, I still would fire up WP5.1 (which was dos based) because the new windows gui version of wordperfect was CRAP.  In linux, I still do a lot of stuff at console (not just coding) because I can be more efficient at console doing a "mv *.txt /tmp/foo && tar -czvf /tmp/foo.tar.gz /tmp/foo" than doing the same thing in a gui.

      My point there is that most applications are already old school guis and people can use them and be efficient using them inside of eagle mode, BUT, once the ZUI becomes the norm and other application developers figure that out (and hardware starts to better accommodate the ZUI) people will start building ZUI exclusive applications (or someone will come up with a ZUI/GUI compatibility layer API, gears are turning on that one already) and then the ZUI becomes universal.

       
    • Oliver Hamann

      Oliver Hamann - 2009-08-27

      I would wish that X11 applications would also be started and stopped by zooming in an out, because then any number of them could be configured (e.g. hundreds of games). But there the problem of in-persistence comes in. Maybe some configurable macro tricks could help there, like: "automatically hit ctrl-S before killing the X server".

       
      • Tony

        Tony - 2019-05-02

        This is easily possible using tools which can send keystrokes to the system. Here an example for Inkscape, xdotool sending the keystrokes, doing whatever needs to be done. I am coming from Windows and AutoHotkey, and having xdotool in linux, used together with xbindkeys, can do already many things, you can redefine any keystrokes to any shell scripts. Those scripts you could just call from any script as well, as for the above use case.

        #!/bin/bash
        target=$(xwininfo -int -id $(xdotool getactivewindow) | awk -F\" '/xwininfo:/ { print $2; exit }')
        
        if [[ $target == *"- Inkscape"* && $target != *"Mozilla Firefox"* ]]; then
            sleep 0.8 && xdotool key s && sleep 2 && xdotool key Tab && sleep 0.3 && xdotool key Return && sleep 0.3 && xdotool key shift+Tab && xdotool key shift+Tab && xdotool key shift+Tab && xdotool key Return 
        fi
        
         
    • Mark McCorkle

      Mark McCorkle - 2009-08-28

      A `kill -STOP 12345` and `kill -CONT 12345` (where 12345 is the pid of the app) will suspend and take away the CPU load of an app when "zoomed out", but there isn't anything where I can suspend the whole process's shared memory easily to disk.  If I recall correctly, the linux kernel will swap out older, unused memory blocks though, so as long as the machine has swap, then older processes still running would just be swapped out to disk until they are zoomed in and `kill -CONT 12345` again.  You can even adjust the linux kernel's tendency to swap things out to disk via /proc/sys/vm/swappiness (values 0 to 100, it defaults to 60).

      This brings up another interesting challenge, what to do on exit (or crash) of Eagle Mode.  If all of these applications are X11 apps running under the context of Eagle Mode, they will lose their controlling process.  A solution to this is to run everything under a vnc or remote desktop/RDP session instead of running them as native X11 apps -- then, when the user zooms out, kill -STOP the application, let linux swap deal with the idle memory pages, and if the user exits eagle mode and comes back in later, simply reconnect to the same remote desktop /vnc server hosting the process and send the kill -CONT to it again. 

      Still doesn't solve for the "shut down machine" case.  Only being able to suspend to disk would work there -- and to do that effectively, we'd likely have to get some support from the linux kernel for proper thread / memory / disk save and reload on next launch. 

       
  • Nobody/Anonymous

    asSOMETHING HERE

     

Log in to post a comment.