我如何从github运行此“ run_scaled”脚本

时间:2019-05-16 22:09:43

标签: bash

我想开始使用Linux,但是在HiDPI显示屏中缩放时遇到问题。

我在github上发现了这段名为“ run_scaled”的代码,每个人都为我的问题推荐该代码,使我能够将单个应用程序扩展2倍。

问题是我无法运行脚本并无法将run_scaled识别为命令。

我尝试转到目录并使用

~$ sh run_scaled

但是它只输出类似于README.md

的内容

Usage: run_scaled [--scale=scaling_factor] [--opengl=auto|yes|no] [--sleep=sleeptime] application

--scale  Sets the factor the application is scaled by. Fractional scales are
         supported. It is set to 2 by default.
--opengl Sets whether xpra should use opengl for rendering. If you get rendering
         errors, especially when the window is resized, try setting it to no. It
         is set to auto by default.
--sleep  Sets how many seconds to wait after starting xpra before attaching to
         the xpra session. It is set to 1 by default.
         You might need to increase the value if your machine is particularly
         slow and attaching fails with a message like

             InitException: cannot find any live servers to connect to
             xpra initialization error:
              cannot find any live servers to connect to

2 个答案:

答案 0 :(得分:0)

用法是:

run_scaled [...] application

您需要提供一个应用程序才能运行。例如:

run_scaled firefox
run_scaled --scale=2 gedit

答案 1 :(得分:0)

首先,使脚本可执行:

$ cd /path/to/dir/with/run_scaled
$ sudo chmod +x run_scaled

然后运行它:

$ ./run_scaled application

开头的“ ./”表示“从该目录调用名为run_scaled的文件”。您也可以使用bash(如脚本顶部的shebang所示)运行它

$ bash run_scaled application

如自述文件和帮助/用法中所述,您还可以传递选项:

$ ./run_scaled --scale=2 application

您需要位于脚本所在的目录中(这可能是为什么您收到无法识别的命令错误,错误的目录)。如果要从任何地方运行脚本,则需要将脚本的目录添加到PATH环境变量中。