Advertisement
Guest User

Untitled

a guest
Dec 29th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. function kmscon()
  2.     launch_terminal();
  3. end
  4.  
  5. function launch_terminal()
  6.     local term_arg = "palette=solarized"; -- run as root and append :login to act as prompt
  7.  
  8.     terminal = launch_avfeed(term_arg, "terminal",
  9.         function(source, status)
  10.             if (status.kind == "preroll") then
  11.                 target_displayhint(source, VRESW, VRESH, 0, {ppcm = VPPCM});
  12.                 target_fonthint(source, "myfont.ttf", 5, 3); -- will look in kmscon/fonts
  13.  
  14.             elseif (status.kind == "terminated") then
  15.                 delete_image(source);
  16.                 launch_terminal();
  17.  
  18.             elseif (status.kind == "resized") then
  19.                 show_image(source);
  20.                 resize_image(source, status.width, status.height);
  21.             end
  22.         end
  23.     );
  24. end
  25.  
  26. -- you need to do more magic for keylayout but...
  27. function kmscon_input(iotbl)
  28.     if (valid_vid(terminal, TYPE_FRAMESERVER)) then
  29.         target_input(terminal, iotbl);
  30.     end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement