Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Makefile for building the Cursor Flatpak
# Makefile for building the T3 Code Flatpak

# --- Variables ---
APP_ID := codes.t3.app
Expand All @@ -10,7 +10,7 @@ SQUASHFS_ROOT := squashfs-root
ARCH ?= x86_64


APPIMAGE_FILE = $(notdir $(CURSOR_URL))
APPIMAGE_FILE = $(notdir $(T3_URL))

.PHONY: all build install run clean uninstall

Expand All @@ -19,6 +19,7 @@ APPIMAGE_FILE = $(notdir $(CURSOR_URL))
all: build

# Builds the Flatpak. Depends on the AppImage being extracted.
build: $(SQUASHFS_ROOT)
@echo "--> Building the Flatpak..."
# Update the version in the appdata file before building
flatpak-builder $(BUILD_DIR) $(MANIFEST) --force-clean
Expand All @@ -32,22 +33,22 @@ install: build

# Uninstalls the application.
uninstall:
@echo "--> Uninstalling Cursor..."
@echo "--> Uninstalling T3 Code..."
flatpak uninstall $(APP_ID)

# --- Helper Targets ---

# This target handles downloading and extracting the AppImage.
# It's triggered by the 'build' target.

Cursor-$(VERSION)-$(ARCH).AppImage:
T3-Code-$(VERSION)-$(ARCH).AppImage:
@echo "--> Preparing AppImage..."
@echo " Downloading from: $(CURSOR_URL)"
wget -O $(APPIMAGE_FILE) "$(CURSOR_URL)"
@echo " Downloading from: $(T3_URL)"
wget -O $(APPIMAGE_FILE) "$(T3_URL)"
@echo " Making executable..."
chmod +x $(APPIMAGE_FILE)

$(SQUASHFS_ROOT): Cursor-$(VERSION)-$(ARCH).AppImage
$(SQUASHFS_ROOT): T3-Code-$(VERSION)-$(ARCH).AppImage
@echo " Extracting AppImage..."
./$(APPIMAGE_FILE) --appimage-extract
@echo " Extraction complete. Extracted to '$(SQUASHFS_ROOT)'."
Expand Down
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Cursor AI - Building a restrictive Flatpak
# T3 Code - Building a restrictive Flatpak

This repository contains the necessary files and automation to build a
restrictive, sandboxed Flatpak for the [Cursor AI](https://cursor.sh/) code
restrictive, sandboxed Flatpak for the [T3 Code](https://t3.chat/) code
editor.

The primary goal is to provide a secure environment for running Cursor by
The primary goal is to provide a secure environment for running T3 Code by
limiting its access to the host system. The build process is automated with a
`Makefile`, requiring only the version number and download URL for a new release
to build and package it.
Expand Down Expand Up @@ -39,33 +39,31 @@ This repository contains the following files:

- **`Makefile`**: The main script that automates the entire download, build, and
installation process.
- **`com.cursor.App.yml`**: The Flatpak manifest. This is the core blueprint
- **`codes.t3.app.yml`**: The Flatpak manifest. This is the core blueprint
that tells `flatpak-builder` how to construct the application, including its
dependencies, sources, and sandbox permissions.
- **`com.cursor.App.appdata.xml`**: AppStream metadata for the application. This
- **`codes.t3.app.appdata.xml`**: AppStream metadata for the application. This
file provides the information (name, description, version history) that software
centers like GNOME Software and KDE Discover use to display the application.
- **`com.cursor.App.desktop`**: The `.desktop` file that allows the application
- **`codes.t3.app.desktop`**: The `.desktop` file that allows the application
to be launched from your desktop environment's application menu.

## How to Build

The build process is managed entirely by the `Makefile`.

1. **Find the Release URL and Version:**
Go to the [Cursor Download History](https://github.com/oslook/cursor-ai-downloads)
or the official website to find the download URL for the Linux AppImage of the
version you want to package.
+Go to the [T3 Code website](https://t3.chat/) to find the download URL for the
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the t3 code website (i think that is t3.codes)

+Linux AppImage of the version you want to package.

2. **Run the Build Command:**
From the root of this project directory, run the `make` command, providing
the `VERSION` and `CURSOR_URL` as arguments.
the `VERSION` and `T3_URL` as arguments.
Comment thread
MoralCode marked this conversation as resolved.

**Example:**

```bash
make build VERSION=x.y.z
CURSOR_URL="URL_FOR_XYZ_RELEASE_OBTAINED_FROM_WEBSITE"
make build VERSION=x.y.z T3_URL="URL_FOR_XYZ_RELEASE_OBTAINED_FROM_WEBSITE"
```

This command will:
Expand Down Expand Up @@ -94,7 +92,7 @@ Once installed, you can normally run your application with:
The `Makefile` provides several convenient targets:

- `make build`: Downloads the AppImage and builds the Flatpak. (Requires
`VERSION` and `CURSOR_URL`).
`VERSION` and `T3_URL`).
- `make install`: Installs the locally built Flatpak for the current user.
- `make run`: Runs the installed Flatpak application.
- `make uninstall`: Removes the Flatpak from your system.
Expand All @@ -112,7 +110,7 @@ For easy, on-the-fly permission management *without* rebuilding, you can use
flatpak install flathub com.github.tchx84.Flatseal
```

2. **Launch Flatseal** and select "Cursor" from the list of applications.
2. **Launch Flatseal** and select "T3 Code" from the list of applications.
3. You can now toggle permissions for filesystem access, network sockets, device
access, and more. Changes are applied instantly.

Expand Down