在Terminal/iTerm中使用HotKey切换不透明度

Fra*_*nni 9 transparency terminate opacity iterm2

有没有办法设置热键来改变终端或iTerm的不透明度?我通常使用低百分比的不透明度,能够快速打开和关闭会很好.

编辑:没有一些可定制性,Cmd + U基本上是相同的

Sus*_*ver 5

您可以使用AppleScript来做到这一点。

即在iTerm(2.9版以上)中,您可以使用以下方法将所有窗口/隔震设置为50%的透明度:

tell application "iTerm"
    repeat with aWindow in windows
        tell aWindow
            tell current session
                set transparency to 0.5
            end tell
        end tell
    end repeat
end tell
Run Code Online (Sandbox Code Playgroud)

将其保存到文件并通过以下命令从cmd行运行:

osascript scriptname.scpt
Run Code Online (Sandbox Code Playgroud)

您也可以将其放入Automator.app并设置为通过热键组合运行。

假设您可以在中执行相同的操作Terminal.app,为此打开AppleScript字典,然后查看设置窗口属性/透明度...

  • 我使用的是最新的 2.1.4 版本(这是 iTerm2 而不是 iTerm)。`Cmd + U` 对我有用。我还为 VIM (`Cmd+U`) 设置了相同的设置,这样我就可以在编码时在后台观看内容。 (2认同)

DKo*_*DKo 5

cmd + u 切换透明度。

  • 只需转到 iTerm -> 首选项 -> 配置文件 -> 窗口 ..,然后您就可以管理透明度。 (2认同)