Skip to main content

code-recent-rofi

Open VS Code recent projects, files, and workspaces from a rofi popup.

The intended desktop workflow is:

keyboard shortcut -> code-recent-rofi
                  -> rofi popup
                  -> select a recent VS Code target
                  -> code focuses it or opens it in a new window

Native VS Code status

VS Code 1.118 adds native recent-folder sharing for the Visual Studio Code Agents app in Insiders. That covers the VS Code Insiders/Agents workflow, but it is not a general Linux launcher API. code-recent-rofi remains useful when you want a rofi menu for VS Code recent projects, files, and workspaces before asking VS Code to focus or open the selected target.

Requirements

  • Linux desktop session with rofi
  • VS Code CLI available as code
  • Python 3.12+

The tool reads VS Code's history.recentlyOpenedPathsList value from state.vscdb in read-only SQLite mode. It checks common VS Code locations, VS Code product metadata, and $VSCODE_RECENT_DB when set.

Install

After the package is published to PyPI, run it directly with uvx:

uvx code-recent-rofi

Or install it as a persistent user-level tool:

uv tool install code-recent-rofi

Before the first PyPI release, install the command from this repository checkout:

uv tool install . --force

If your desktop shortcut editor requires an absolute command path, resolve the installed command from your current environment instead of hard-coding one:

command -v code-recent-rofi

For editable development:

uv sync
uv run code-recent-rofi

Usage

Run the default workflow:

code-recent-rofi

Select a recent item, or type a new path in rofi and press Enter. Custom input is passed to VS Code as an open-or-focus target.

Use a specific VS Code database, useful for debugging or tests:

code-recent-rofi --database ~/.config/Code/sharedStorage/state.vscdb

Override desktop command names:

code-recent-rofi --rofi-command rofi --code-command code

Show the installed version:

code-recent-rofi --version

Behavior

  • Local file:// targets first check VS Code's persisted open-window state. If the target is an existing directory, the tool asks VS Code to open or reveal it through --folder-uri, adding --new-window when the directory is not already open. Non-directory local targets keep the safe -- <path> separator.
  • vscode-remote:// and vscode:// targets are handed to VS Code through code --folder-uri <uri> when already open, or code --new-window --folder-uri <uri> otherwise.
  • Non-recent custom input from rofi is treated as a plain open-or-focus target; leading ~ is expanded before launching VS Code.
  • Duplicate recent targets are hidden while preserving VS Code's recency order.
  • Cancelling rofi exits without opening anything.
  • If no recent data is found and no custom input is entered, the tool sends a best-effort desktop notification.

Development

Install dependencies:

uv sync

Run the full quality gate:

uv run poe check

Individual commands:

uv run poe format
uv run poe lint
uv run poe type-check
uv run poe test
uv run poe deptry

Build and validate the PyPI distributions:

uv run poe build
uv run poe dist-check

Publishing

PyPI publishing is wired through .github/workflows/release.yml using Trusted Publishing, so no long-lived PyPI token is needed in GitHub Actions.

For the first upload, create a pending publisher in PyPI with:

  • PyPI project name: code-recent-rofi
  • Owner: sean2077
  • Repository name: code-recent-rofi
  • Workflow filename: release.yml
  • Environment name: pypi

Publishing follows the same shape as jsonpath-python: push conventional commits to main, wait for CI to pass, and the release workflow runs from the successful CI run. semantic-release updates the version first, builds the distributions from that updated version, creates the GitHub release, and only then publishes the built artifacts to PyPI.

If a Git tag already exists for a version that was not uploaded to PyPI, publish the next release version instead of trying to reuse the existing tag.

Manual local publishing remains possible when you have a PyPI token:

uv run poe build
uv run poe dist-check
UV_PUBLISH_TOKEN=... uv publish

License

MIT

Metadata

Release files for code-recent-rofi 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for code-recent-rofi 1.1.0
File Size Uploaded
code_recent_rofi-1.1.0.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for code-recent-rofi 1.1.0
File Interpreter ABI Platform
code_recent_rofi-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.9 kB

Release files / code_recent_rofi-1.1.0.tar.gz

Download URL code_recent_rofi-1.1.0.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3cc0d19640b0eab4603abf64076f124040b5d39682656bc5e866fe949a6c4a4e
BLAKE2b-256 checksum
How to use checksums
9c46251bb6bd1030417815fb72d7bb8453ca4ca2feadc76c5f52f2ccd8319964
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.

Transparency log

Release files / code_recent_rofi-1.1.0-py3-none-any.whl

Download URL code_recent_rofi-1.1.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2dc7eba649c295b8dd4c6edfe0798a7fe4a108708b334da232f8dc16c33a43cf
BLAKE2b-256 checksum
How to use checksums
b6e801408beea909406aecc5606b77ad2bec849961c219d4605928d55b3f0902
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page