Last active
June 26, 2025 02:59
-
-
Save jyxjjj/977264b3bfd40d3490a53ab94ef04726 to your computer and use it in GitHub Desktop.
SwiftBar SSH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RENAME functions script with hidden dot `.SSH.functions.sh` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# <bitbar.title>SSH</bitbar.title> | |
# <bitbar.version>v1.0</bitbar.version> | |
# <bitbar.author>DESMG</bitbar.author> | |
# <bitbar.author.github>jyxjjj</bitbar.author.github> | |
# <swiftbar.hideAbout>true</swiftbar.hideAbout> | |
# <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal> | |
# <swiftbar.hideLastUpdated>false</swiftbar.hideLastUpdated> | |
# <swiftbar.hideDisablePlugin>false</swiftbar.hideDisablePlugin> | |
# <swiftbar.hideSwiftBar>true</swiftbar.hideSwiftBar> | |
# <swiftbar.runInBash>true</swiftbar.runInBash> | |
# 图标 | |
echo '🖥️' | |
echo "---" | |
# 功能 | |
echo '{REPLACE_WITH_YOUR_SERVER} | bash=$SWIFTBAR_PLUGINS_PATH/.SSH.functions.sh param1={REPLACE_WITH_YOUR_SERVER} terminal=false font="JetBrains Mono NL"' | |
echo '{REPLACE_WITH_YOUR_SERVER} | bash=$SWIFTBAR_PLUGINS_PATH/.SSH.functions.sh param1={REPLACE_WITH_YOUR_SERVER} terminal=false font="JetBrains Mono NL"' | |
echo '{REPLACE_WITH_YOUR_SERVER} | bash=$SWIFTBAR_PLUGINS_PATH/.SSH.functions.sh param1={REPLACE_WITH_YOUR_SERVER} terminal=false font="JetBrains Mono NL"' | |
echo '{REPLACE_WITH_YOUR_SERVER} | bash=$SWIFTBAR_PLUGINS_PATH/.SSH.functions.sh param1={REPLACE_WITH_YOUR_SERVER} terminal=false font="JetBrains Mono NL"' | |
echo "---" | |
echo 'ALL | bash=$SWIFTBAR_PLUGINS_PATH/.SSH.functions.sh param1=ALL terminal=false font="JetBrains Mono NL"' | |
# 编辑功能 | |
echo "---" | |
echo 'Edit | bash=code param1="'$SWIFTBAR_PLUGINS_PATH'" terminal=false font="JetBrains Mono NL"' | |
echo 'Refresh | refresh=true font="JetBrains Mono NL"' | |
# 版权信息 | |
echo "---" | |
echo "Copyright (C) DESMG | font='JetBrains Mono NL'" | |
echo "All Rights Reserved | font='JetBrains Mono NL'" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
ConnectToServer() { | |
osascript <<EOF | |
tell application "Terminal" | |
activate | |
delay 0.2 | |
tell application "System Events" to keystroke "t" using command down | |
delay 0.2 | |
do script "ssh $1" in front window | |
end tell | |
EOF | |
} | |
if [[ "$1" == "ALL" ]]; then | |
ConnectToServer "{REPLACE_WITH_YOUR_SERVER}" | |
ConnectToServer "{REPLACE_WITH_YOUR_SERVER}" | |
ConnectToServer "{REPLACE_WITH_YOUR_SERVER}" | |
ConnectToServer "{REPLACE_WITH_YOUR_SERVER}" | |
else | |
ConnectToServer "$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment