Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Durden, Tiling Desktop Environment for Arcan

Bjorn Stahl
November 19, 2015

Durden, Tiling Desktop Environment for Arcan

Bjorn Stahl

November 19, 2015
Tweet

More Decks by Bjorn Stahl

Other Decks in Programming

Transcript

  1. Durden [Hacker-friendly] Desktop Environment for Arcan (first release, so be

    gentle) Demo Videos @ www.arcan-fe.com/videos ^^-- watch this before moving on
  2. Features • Keyboard Dominant (trying to assist you in using

    the mouse as little as possible). Primarily Tiled window management configuration - but normal “desktop- style” use also works • Zero-Config - inputs, visual features (animations), fonts etc. can all be tuned runtime without editing / rebuilding / reloading. • Complex cases, such as multiple heterogeneous displays (“mixed- DPI”) covered and prioritised • Global and Per Window clipboard with history • Highly configurable input model, rebind inputs globally and/or per window, support for game devices, switching keyboard layouts, ... • Fine grained control of individual window behavior in regard to locking, input translation, scaling, filtering, post-processing effects
  3. Layout Modes • Primary container is the ‘workspace’ • Up

    to 10 workspaces per display • Each workspace has:
 layout mode (tile, float, vtab, tab, fullscreen)
 current display
 preferred display
 possible background
 possible text tag

  4. Tile- Mode m1 + up/down/left/right : select m1 + m2

    + tab : insertion mode (v, h) switch m1 + m2 + up/down/left/right : resize m1 + m : merge or split subtree Also: Titlebar toggle on/off Swap left/right/up/down
  5. Float- Mode border-drag resize tbar-drag move tbar-dblclick toggle max. m1+m2

    | m2 | m1 + up/down/left/right : move, resize, select Position/Size tracked separately from other layout modes activate by clicking layout button
  6. Window Operations and Properties • Visual: Configurable border area (for

    gaps) border size (from 0 to gap_sz) workspace-transition animation, wallpaper • All Decorations are shader defined, can be made quite crazy :) • Custom tag to each window for searching / retrieval • Workspace Alert • Sound Controls (global or per window volume) • State Controls (suspend, resume, save, restore) • Remember Cursor Position, autolocking per window
  7. Global Menu, Window Menu, Launch Menu Default ( meta1 +

    g (main) or t (window) or d (launch) ) type to filter enter to launch selected both actions and groups can be bound to shortcut key arrow-keys to move selection [meta]escape to go back
  8. More Menus automation - bind action or target to: Widget

    Regions For image preview, keybinding helper, ... inactivity timer one-fire timer external command pipe periodic timer titlebar decoration icon statusbar button
  9. Widgets • Binds to one or many menu paths (e.g.

    !/global/input or special:bind_u8) • Generates dynamic helper contents that ties to widget regions
 Can be interactive (notes, todo, clock, cheat sheets, password generator, colour picker etc.) • Examples: (show existing bindings) (ASCII helper)
  10. Titlebar / Statusbar / IPC • Bind custom menu path

    to titlebar decoration button [left or right] • Can be hidden in tiled mode • 3 pipes (config/system/ipc): control [in], output [out], status [in] • control - activate menu path externally, output - write messages to external listener, status - modify statusbar • Statusbar can be externally modified (lemonbar- like protocol) • e.g. echo "hi %{F#00ffff} There | %{F-} %{Aclickme} Button" > ipc/status
 [ set bar to (hi There | Button) with "clickme" written to output pipe on click ]
  11. Multi-Display Setup • Arcan:egl-dri platform only one with hardware support

    at the moment (and related driver issues).. • Workspace is ‘homed’ to a display • Display disappears? workspace is adopted • Display reappears? workspace moves back home • Windows / Workspaces can be migrated to a display manually (global/ workspace/migrate/[display name] or target/window/migrate/[display name]) • Caveats: manual- scan for display changes as event-driven turned out driver-crash prone (global/display/rescan), poor identification (bad EDID values on reconnect breaks autohoming!) • Display properties (RGB layout, pixel density, font size) are communicated to window / workspace / external processes on migration
  12. Multi-Display / Quality • Every display - individual shader •

    For color- gamma- correction / special needs • Current arcan limitations makes ICC profile harder
 (no R10G10B10 or 3D LUT texture support) • Re- orientation • Per display : Toggle Horizontal / Vertical arrangement • Text • Font / Hinting / Size is managed per display, pushed to clients, synched on window- migration • Decoration, Font, Cursor follows display pixel density
  13. Sharing • One feature that covers: sharing**, streaming**, recording**, screenshots

    and magnification • m2: align to selected window canvas, 
 m1: switch anchor point, 
 mouse motion to resize • (currently poor sound-source control / mixing) ** spawns and forwards to encoding frameserver, will also be used for OCR and text to speech path: global/display/region/
  14. Input Features • Keyboard(s) (see global/input/keyboard/maps for load/save/modify) • key-press(+mods)

    maps to symbol and utf-8 sequence. • key-press/combination can be bound per window to label (each connection can dynamically communicate supported labels and datatype) • Sore spot: no good converter from X etc. to internal format (yet) • meta+key can be bound to target or global menu path (including setting a specific value, e.g. config/visual/mouse_scale=5) • per- window Bind UTF-8 overrides to Keymap or Global or Window
  15. Mouse / Game Devices • Cursor • Lock to Window

    Center, Lock to Window, Remember Window Position, Motion Scaling, Autohide • Bind buttons to Target / Global Menu action • Gamepads, switches etc. • Known devices (platform+string identifier) has a map in devmaps and gets "auto slotted" • Slot is expanded into label translation (=> PLAYERn_BUTTON1) • Can also be bound to menu paths like normal presses:
 input/bind/custom takes 'n' repeated inputs
 but currently only rising edge triggered, not level (hold) or falling (release)
  16. Clipboard • Hides in Window menu (Clipboard/*) • Tracks both

    Local (per window) and Global (shared) • Conservative History (no accidental duplicates) • meta_1 - activate to copy from local to global • Captures / Tracks URLs separately
 presents as completion sets in open/remote or open/media • Paste Modes • Strip leading / trailing / repeating whitespace / linefeeds
  17. Lockscreen • configurable event hooks: n-failure, on-enter, on-accept • tracks

    / shows failed attempts count • one-time passwords • no PAM/what-have-you integration on purpose • authenticate to current desktop, not re-use system authentication primitives for something as mundane like “I needed to go to the bathroom” path: system/lock
  18. Timers • add time delay or event triggered menu path

    activation • can be periodic (run every n ticks) • can be idle 
 (run path#1 on enter-idle, path#2 on exit-idle) • and fire-once or repeated path: config/timers
  19. Safety Features • Requires keyboard present on init • 'n'

    presses without meta+ combination? query for rebind • Remove / Insert keyboard device resets rebind helper • Individual windows can be ‘delete protected’ • External Control Channel (if enabled) can run menu commands • current settings can be externally modified with arcan_db [ arcan_db drop_appl durden to reset ] • Run with arcan -b :self durden to relaunch and inherit external connections on script error
  20. First Launch • Assumed: arcan installation working, depending on OS,

    distribution, graphics set-up etc. this can be hairy (drm- kms on linux, device permisions etc.) • arcan /path/to/durden (if in APPLBASE, ~/.arcan/appl just arcan durden) • some basic things, m1+enter (terminal), m1+g (global menu) • if nothing happens, type frantically on the keyboard for some ~20 presses and it assumes your keybindings are broken and you see:
  21. Launch targets • Arcan is rather restrictive about executing things

    (for good reason) • There is a database that tracks what is permitted to be launched and with which arguments. • We call those ‘targets’ and ‘configurations’ (multiple per target). • There is a tool to manage this database, arcan_db (though distributions etc. might just want to handle this differently). • Database is used both for tracking user settings globally and individually for the targets / configurations. -b filename to switch • By default, it resides in your ~/.arcan/arcan.sqlite, but you can specify it somewhere else (and have multiple to switch between) with -d file
  22. Launch example • This uses the builtin support for libretro

    (libretro.com), the freeware game doukutsu (cave story) and the corresponding libretro core. arcan_db arcandb.sqlite add_target “cave story” “[ARCAN_RESOURCEPATH]/ cores/cave.dylib” RETRO “[ARCAN_RESOURCEPATH]/assets/cave/Doukutsu.exe” • the [ARCAN_RESOURCEPATH] will be expanded at runtime to the path set as resource path (arcan -p respath), the RETRO indicates the binary format (we want afsrv_game as loader) • now “cave story” will be available in my meta-d launch menu, in the way it was used in the demo video.
  23. egl-dri (kms) notes • Permissions (/dev/dri/card*, renderD*, /dev/input/* or inotify

    for device nodes in ARCAN_INPUT_SCANDIR ENV) • Need recent: (kernel >= 4.x, libdrm and MESA) + compatible card and luck (/s long live gpu drivers).. • OK (Intel), So-So (AMD), “Exotic” (Nvidia, egl-nvidia VIDEO_PLATFORM) • Environment tuning (primary): DISPLAY_CONNECTOR • Current limits: 1 GPU / instance, (but multiple concurrent instances possible), handles primary display connector loss poorly. • External Launch support not fully implemented (upgrade without losing state, temporarily release resources and hand over to other program etc.)
  24. Future • Most (all?) prominent features of other tiling window

    managers are in place (and quite a few more of our own). • Big improvements will be directed towards: • raising quality (redshift, color correction profiles, daltonization, latency vs. energy-efficiency tradeoffs) • controlled sharing (multimedia/VM state copy/paste, network transparency, LAN state migration, VM integration) • advanced input (macro record/replay, sticky combinations, tablet gestures, OCR, eye-trackers, OSD keyboard, keyboard to mouse) • Longer list in README.md (checklist and crazy ideas)
  25. Developer / Debugging • First Release, don’t expect perfection. •

    ulimit -c unlimited; ARCAN_LOGPATH=/some/path arcan -g -b :self durden &> mylog will retain most information • -b :self means fallback to self on script error • system/debug submenu comes with -g debuglevel (-g -g is too verbose) • What I do? 2 GPUs (i915 + AMD R380 atm.), 2 durden checkouts • 2nd instance with different envs/db that uses a different name for connection point (ARCAN_VIDEO_DEVICE, ARCAN_APPLTEMPPATH, ARCAN_RESOURCEPATH, ALSA_CARD, ARCAN_FRAMESERVER_DEBUGSTALL=1 + config/system/connection_path • started with added cmdline arg input_lock ; secret sauce - shares input device nodes with other instance, (see: keybindings.lua with input_lock_toggle and input_lock_on input_lock_off to control)

  26. More? • We’re just getting started (see arcan overview presentation)

    • See Features and Status in README.md in git repository for updates on status • #arcan on Freenode for complaining, helping out or idling :-)