Skip to main content

Open VS Code recent projects from a rofi menu.

Project description

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 opens the selection

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

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 open with code --reuse-window <path>.
  • vscode-remote:// and vscode:// targets open with code --folder-uri <uri>.
  • Duplicate recent targets are hidden while preserving VS Code's recency order.
  • Cancelling rofi exits without opening anything.
  • If no recent data is found, 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code_recent_rofi-1.0.1.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

code_recent_rofi-1.0.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file code_recent_rofi-1.0.1.tar.gz.

File metadata

  • Download URL: code_recent_rofi-1.0.1.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for code_recent_rofi-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4a783808d891da392f305dd5c6ef54da8f196d995bef868875d9e0726525315a
MD5 0524b65c0006045a855795081102b750
BLAKE2b-256 5cbe737e9d47d38c0a9e89495fb7f01e09e44c399d72934da920e5b477169717

See more details on using hashes here.

Provenance

The following attestation bundles were made for code_recent_rofi-1.0.1.tar.gz:

Publisher: release.yml on sean2077/code-recent-rofi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file code_recent_rofi-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for code_recent_rofi-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae4cf7a201bbf29f92a8b31c40585f6a06a528e57e7879db37af3cdd020a3ef
MD5 3aa26ec411d787f327746e122c5f80c7
BLAKE2b-256 09cd80dcdf5bf081a1c621cf8492177f1c8e6f585cfb2cb6d15faf407dd2166d

See more details on using hashes here.

Provenance

The following attestation bundles were made for code_recent_rofi-1.0.1-py3-none-any.whl:

Publisher: release.yml on sean2077/code-recent-rofi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page