linux-second-screen

授权协议 MIT License
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 马正初
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

linux-second-screen

Scripts to repurpose old android device as second monitor on linux

Warnning

This script is using Legacy nVidea Driver and may not be compatible anymore.It was created on 2017 and it's not actively maintained.Please be carefull if you insist to use it.One alternative cold be using the evdi kernel module.Look here for more details.

Usage

This repo have many bash scripts to interact with android using adb.Each script have it's own function.

Device

A simple wrapper to select target device by name.

Add device

device add droid2 015F13B817021010

Usage

device droid2 adb shell
device droid2 <any other command>

Display

Change host (linux) display settings.With this script we can create, change settings or remove of virtual displays.It does not care about positioning the virtual displays, this should be done using your favorite monitor app. E.g.: xrandr, arandr or some other you like.

droid

General commands for android.This script is a wrapper for adb, with it we can:

  • start an app to resolve one url
  • open pre-defined activites
  • set date and time
  • get device ip
  • connect to wifi
  • get sdk
  • get model
  • get and change orientation
  • change some developer settings
  • get screen resolution
  • shutdown device
  • record and playback inputs

input

An reimplementation of input script on android.Some devices doesn't have tap and swipe command, so this script tries to reprotuce theses commands.

keyboard

Send multiple KEY_EVENTS in a single string.The idea here is to simplify the way to send keyboard inputs.This script replaces (space character) by %s the one is used by key event.Also send key events by name, just using UPPERCASED text.

# We can input text, then key, the text again, the order doesn't matter
keyboard "My name is Bruno;ENTER;This one is probably on the next field"

# we can also send multiple key events
keyboard "UP;UP;DOWN;DOWN;LEFT;RIGHT;LEFT;RIGHT"

terminal

This script is a wrapper to interact with screen, a screen manager for terminal.Using screen we can share a terminal session like.The idea is use it like a vnc, and connect other devices to keep a terminal session running on then like server logs or status.

vnc

A wrapper for vnc commands.We have only two commands here:

  • Start - wich starts vnc for a virtual display
  • window - wich starts vnc for a given window

Setup

First we need to run setup to install all tools we need to run this.There are tools that we doesn't provide, like adb (Android Debug Bridge), it comes with android sdk.You will have to setup adb into your path.

Then run setup.You will be prompt to put your password to install necessary tools.We may split setup into multiple phases later, for optional instalation.

# install tools
./main setup

# create virtual displays, only works with intel's graphic card
# you may change 2 by any number of virtual displays you want
./display create 2

Restart you computer, if you created virtual display.When you login again you will see VIRTUAL as possible video output.

How to create a extended display? - Intel's graphic card only

With these scripts it gets simple.But we still need to make some touches to make then integrated.may I make this on main.

I high recomend you to write a script to start your own devices, this will make your life a lot easier.So I will write the step-by-step in a script-like.

Step 1 - get information from your device

We need to know the resolution from our device, it's orientation and screen size inches.Based on these two informations we can create one virtual display.

# resolution - this one may fail, so you may have to get this information from internet
# ./droid resolution
resolution=$(./droid resolution)

# replace resolution ´x´ by ´ ´ (space)
resolution=${resolution/x/ }

# orientation
# ./droid orientation
orientation=$(./droid orientation)

# inches - this one may fail too, cause we need resolution and density to calculate an aproximate screen inches
# ./droid inches
inches=$(./droid inches)

Step 2 - calculate virtual display resolution

Now we have the resolution let's calculate an virtual display size

# ./display calcRes $resolution $inches
virtual=$(./display calcRes $resolution $inches | grep virtual | grep -Po "(\d+x\d+)")

Step 3 - set virtual display resolution

Let's set the resolution for display 1.Depending on orientation we change order of width and height.

virtual=(${virtual/x/ })
width=${virtual[0]}
height=${virtual[1]}
if [ "$orientation" == 0 ] || [ "$orientation" == 2]; then
  # portrait
  ./display setRes 1 $width $height
else
  # landscape
  ./display setRes 1 $height $width
fi

Step 4 - share display on vnc

./vnc start 1

Step 5 - share vnc connection directly to device

./droid start vnc://{your local ip address}:5900

Here we can also use adb reverse tcp:5900 tcp:5900 to make a tunnel using usb cable, but it only works on android 5.0+.

Step 6 - clean

Shutdown display and remove configurations from it.

./display remove 1

if you still want to do it by hand

Follow this tutorial.

Similar apps

This app will be made by the rage because we have a lot of apps for all other platformsOnly linux isn't supported by those apps.

Splashtop appear to have a beta, for linux.
\o/

  • Linux下SIPp测试Freeswitch 知识必备:Linux操作系统、Sip协议 一、安装 1.依赖包安装: yum -y install gcc-c++ yum -y install ncurses-devel yum -y install openssl-devel # 为了安装libpcap,还需要安装以下两个开发包: yum -y install flex yum -y instal

  • 平台:Linux ubuntu 3.5.0-54-generic #81~precise1-Ubuntu SMP Tue Jul 15 04:02:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux cross-compiler:arm-linux-gcc-4.4.3 kernel:2.6.35.4 下载地址:https://www.kernel.org/pub/

  • GNU Screen is a terminal multiplexer. You can have multiple sessions / terminal from single Screen instance. Using screen your process is not interrupted when your connection is disconnected. You migh

  •  Linux kernel release 2.6.xx These are the release notes for Linux version 2.6.  Read them carefully, as they tell you what this is all about, explain how to install the kernel, and what to do if some

  • 请问linux的dialog设计对话框不同的对话框可以嵌套吗?如果可以的话怎么嵌套呢? 比如下面这段shell脚本代码的各个对话框都是彼此独立的,我想把它们一起放到一个大对话框离里去,但不知道怎么弄: /bin/bash yesno() { dialog --title "First screen" --backtitle "Test Program" --clear --yesno \ "Sta

  • 摘要: If you've already got Linux up and running on your machine and you really want to exploit its capabilities, Beginning Linux Programming is packed full of useful information that will keep you busy

  • MSM8909+Android5.1.1启动流程(8)---boot_linux()和kernel入口 Smem:sharedmemory 上一篇:MSM8909+Android5.1.1启动流程(7)---boot_linux_from_mmc() /bootable/bootloader/lk/app/aboot/aboot.c中的boot_linux()函数主要实现了内核引导参数参数的处理过

 相关资料
  • 第二个函数返回0到59之间的数字,表示指定时间戳的小时的第二个。 语法 (Syntax) Second(time) 例子 (Example) 添加按钮并添加以下功能。 Private Sub Constant_demo_Click() msgbox("Line 1: " & Second("3:13:25 PM")) msgbox("Line 2: " & Second("23:1

  • 问题内容: To find the first , use: How do I find the second occurence? 问题答案: List item You can perform another search for the index of element at the remaining array slice as follow: edit/update: Xcode 11

  • 我的主机有2个ips。主机为主,应用程序为辅助。在Azure上运行,设置私有dns。主ip可以反向查找。第二个不能。尝试设置in-addr.arpa域并添加反向ips,没有运气。尝试设置120.10.in-addr.arpa域并添加反向ips,没有运气。 是否有一种方法可以使用专用dns在Azure上对具有分配给nic的多个IP的主机执行反向查找? 额外信息: 如果这是我的vnet范围,我想快速查

  • Hibernate 的 Session 在事务级别进行持久化数据的缓存操作。 当然,也有可能分别为每个类(或集合),配置集群、或 JVM 级别(SessionFactory 级别)的缓存。你甚至可以为之插入一个集群的缓存。注意,缓存永远不知道其他应用程序对持久化仓库(数据库)可能进行的修改 (即使可以将缓存数据设定为定期失效)。 通过在 hibernate.cache.provider_class

  • 所以, 我对JBehave有一个奇怪的行为。我有一个场景,需要如下所示的StepDef结构: 似乎我的配置限制了可以解释的连续“and”语句的数量。然而,我似乎没有发现问题。我在这里做错了什么?

  • 本文向大家介绍Android测量每秒帧数Frames Per Second (FPS)的方法,包括了Android测量每秒帧数Frames Per Second (FPS)的方法的使用技巧和注意事项,需要的朋友参考一下 本文实例讲述了Android测量每秒帧数Frames Per Second (FPS)的方法。分享给大家供大家参考。具体如下: MainThread.java: 希望本文所述对大家