XR pass-through integration #19

Open
opened 1 year ago by utopiah · 12 comments
utopiah commented 1 year ago
Owner

Examples of changing screen resolution to make it more readible.


var http = require('http')
var url = require('url')
var fs = require('fs')

const execSync = require('child_process').execSync;

const highrescmd = 'xrandr --output DP-0 --mode 2560x1440; xrandr --output DP-2 --mode 1920x1080'
const lowrescmd = 'xrandr --output DP-2 --mode 800x600; xrandr --output DP-0 --mode 1600x1200'

http.createServer(function (request, response) {
    var requestUrl = url.parse(request.url)
    response.writeHead(200)
    console.log(requestUrl.pathname)
    if (requestUrl.pathname == '/low')
        code = execSync(lowrescmd);
    else
        code = execSync(highrescmd);
    response.end()
}).listen(9615)

// from https://stackoverflow.com/a/26354478

Examples of changing screen resolution to make it more readible. ```javascript var http = require('http') var url = require('url') var fs = require('fs') const execSync = require('child_process').execSync; const highrescmd = 'xrandr --output DP-0 --mode 2560x1440; xrandr --output DP-2 --mode 1920x1080' const lowrescmd = 'xrandr --output DP-2 --mode 800x600; xrandr --output DP-0 --mode 1600x1200' http.createServer(function (request, response) { var requestUrl = url.parse(request.url) response.writeHead(200) console.log(requestUrl.pathname) if (requestUrl.pathname == '/low') code = execSync(lowrescmd); else code = execSync(highrescmd); response.end() }).listen(9615) // from https://stackoverflow.com/a/26354478 ```
Poster
Owner

Could also provide a list of opened tabs.

Could also provide a list of opened tabs.
Poster
Owner

Could rely on an eye chart to calibrate scaling per user. Ideally it'd be displayed on the target screens though, not in the XR display controlling scaling. Selected value could then be saved locally, e.g localStorage, or remotely with a user ID so that it becomes the default on next connection.

Could rely on an [eye chart](https://en.wikipedia.org/wiki/Eye_chart) to calibrate scaling per user. Ideally it'd be displayed on the target screens though, not in the XR display controlling scaling. Selected value could then be saved locally, e.g `localStorage`, or remotely with a user ID so that it becomes the default on next connection.
Poster
Owner

Consider how furnitures could be used too, via e.g https://immersive-web.github.io/real-world-meshing/ , to know where screens are related to user.

Consider how furnitures could be used too, via e.g https://immersive-web.github.io/real-world-meshing/ , to know where screens are related to user.
Poster
Owner

Consider also kwin and Vimperator scripts, among the different ways to manage windows and tabs programmatically and thus remotely.

Consider also [kwin](https://develop.kde.org/docs/plasma/kwin/) and Vimperator scripts, among the different ways to manage windows and tabs programmatically and thus remotely.
Poster
Owner

see also #16 to avoid doing specific documentation and endpoints

see also https://git.benetou.fr/utopiah/offline-octopus/issues/16 to avoid doing specific documentation and endpoints
Poster
Owner

paths /hmdlink and /hmdlink/set are arguably XR specific, even though in truth are mostly about devices with inconvenient input methods

paths `/hmdlink` and `/hmdlink/set` are arguably XR specific, even though in truth are mostly about devices with inconvenient input methods
Poster
Owner

related code 6cb7a8c8c8 as starting point in xr branch.

related code https://git.benetou.fr/utopiah/offline-octopus/commit/6cb7a8c8c884dfc5fed74b075350df797b756164 as starting point in `xr` branch.
Poster
Owner

example with KWin :

script=/home/fabien/Prototypes/kwin-scripting/minimizeall.kjs
# from https://unix.stackexchange.com/a/517690/486198

num=$(dbus-send --print-reply --dest=org.kde.KWin \
    /Scripting org.kde.kwin.Scripting.loadScript \
    string:"$script" | awk 'END {print $2}' )

dbus-send --print-reply --dest=org.kde.KWin /$num \
    org.kde.kwin.Script.run

# I'm not sure if some delay is in order here to let your script complete?
dbus-send --print-reply --dest=org.kde.KWin /$num \
    org.kde.kwin.Script.stop

running the content of minimizeall.kjs

const clients = workspace.clientList();
for (var i = 0; i < clients.length; i++) {
  print(clients[i].caption);
  clients[i].minimized = true;
}
example with KWin : ```bash script=/home/fabien/Prototypes/kwin-scripting/minimizeall.kjs # from https://unix.stackexchange.com/a/517690/486198 num=$(dbus-send --print-reply --dest=org.kde.KWin \ /Scripting org.kde.kwin.Scripting.loadScript \ string:"$script" | awk 'END {print $2}' ) dbus-send --print-reply --dest=org.kde.KWin /$num \ org.kde.kwin.Script.run # I'm not sure if some delay is in order here to let your script complete? dbus-send --print-reply --dest=org.kde.KWin /$num \ org.kde.kwin.Script.stop ``` running the content of `minimizeall.kjs` ```javascript const clients = workspace.clientList(); for (var i = 0; i < clients.length; i++) { print(clients[i].caption); clients[i].minimized = true; } ```
Poster
Owner

embedding of KWin script 78229f9b8f

embedding of KWin script https://git.benetou.fr/utopiah/offline-octopus/commit/78229f9b8fa1f2a45a014295e23a6d0441202fd9
Poster
Owner
see past test with `xdotool` when APIs are missing e.g https://twitter.com/utopiah/status/1499486056042872839 and https://twitter.com/utopiah/status/1493480186368700416
Poster
Owner

On tridactyl see https://github.com/tridactyl/tridactyl/issues/780

Instead consider JavaScript timer in :jsb running tri.excmds.source("~/path/to/magic/RC") and have your RC file start that timer (cf discussion on Matrix)

On tridactyl see https://github.com/tridactyl/tridactyl/issues/780 Instead consider JavaScript timer in `:jsb` running `tri.excmds.source("~/path/to/magic/RC")` and have your RC file start that timer (cf discussion on Matrix)
Poster
Owner

pointer example 9414807070

pointer example https://git.benetou.fr/utopiah/offline-octopus/commit/94148070705b93feba0a1244bd4771c33ec87d6e
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: utopiah/offline-octopus#19
Loading…
There is no content yet.