Skip to content

Commit 8dbf79f

Browse files
committed
add install method for linux + desktop file
1 parent d3bab6e commit 8dbf79f

3 files changed

Lines changed: 82 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Clone the repository and build the binary:
2929
```bash
3030
git clone https://github.com/dotsem/tusshi.git
3131
cd tusshi
32-
go build -o tusshi cmd/main.go
32+
go build -o tusshi cmd/tusshi/main.go
3333
```
3434

3535
You can run the compiled binary directly or move it into a directory in your system PATH (such as `/usr/local/bin`):
@@ -38,6 +38,20 @@ You can run the compiled binary directly or move it into a directory in your sys
3838
mv tusshi /usr/local/bin/
3939
```
4040

41+
### Installing on Linux
42+
43+
```bash
44+
./linux-install.sh
45+
```
46+
47+
### Installing on MacOS
48+
49+
Currently built from source, homebrew support will be added later on.
50+
51+
### Installing on Windows
52+
53+
Currently built from source, package manager support will be added later on.
54+
4155
---
4256

4357
## Getting Started

linux-install.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
if ! command -v go >/dev/null 2>&1; then
6+
echo "Error: Go is not installed. Please install Go 1.26.3 or higher." >&2
7+
exit 1
8+
fi
9+
10+
echo "Building tusshi..."
11+
go build -o tusshi cmd/tusshi/main.go
12+
13+
# determine target directories depending on privilege level
14+
if [ "$(id -u)" -eq 0 ]; then
15+
BIN_DIR="/usr/local/bin"
16+
APP_DIR="/usr/share/applications"
17+
ICON_DIR="/usr/share/icons/hicolor/512x512/apps"
18+
PIXMAP_DIR="/usr/share/pixmaps"
19+
echo "Installing system-wide..."
20+
else
21+
BIN_DIR="${HOME}/.local/bin"
22+
APP_DIR="${HOME}/.local/share/applications"
23+
ICON_DIR="${HOME}/.local/share/icons/hicolor/512x512/apps"
24+
PIXMAP_DIR="${HOME}/.local/share/icons"
25+
echo "Installing user-local (run with sudo for system-wide installation)..."
26+
fi
27+
28+
mkdir -p "$BIN_DIR" "$APP_DIR" "$ICON_DIR" "$PIXMAP_DIR"
29+
30+
cp -f tusshi "$BIN_DIR/"
31+
chmod +x "$BIN_DIR/tusshi"
32+
33+
if [ -f "assets/tusshi.png" ]; then
34+
cp -f assets/tusshi.png "$ICON_DIR/tusshi.png"
35+
cp -f assets/tusshi.png "$PIXMAP_DIR/tusshi.png"
36+
fi
37+
38+
if [ -f "tusshi.desktop" ]; then
39+
cp -f tusshi.desktop "$APP_DIR/"
40+
fi
41+
42+
# update desktop environment database to pick up the new shortcut
43+
if command -v update-desktop-database >/dev/null 2>&1; then
44+
update-desktop-database "$APP_DIR" || true
45+
fi
46+
47+
echo "Installation complete!"
48+
if [ "$(id -u)" -ne 0 ]; then
49+
# alert user if bin dir is not in PATH
50+
case ":$PATH:" in
51+
*:"$BIN_DIR":*) ;;
52+
*)
53+
echo "Warning: $BIN_DIR is not in your PATH."
54+
echo "Please add it to your shell configuration (e.g. ~/.bashrc or ~/.zshrc):"
55+
echo " export PATH=\"\$PATH:$BIN_DIR\""
56+
;;
57+
esac
58+
fi

tusshi.desktop

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=tuSSHi
4+
Comment=Interactive SSH connection manager (TUI)
5+
Icon=tusshi
6+
Exec=tusshi
7+
Terminal=true
8+
Categories=System;Utility;TerminalEmulator;
9+
Keywords=ssh;tui;config;connection;manager;

0 commit comments

Comments
 (0)