Live Clock VS Code Extension
A simple VS Code extension that displays a live clock in the status bar footer.
Features
- 🕐 Live Clock: Displays current time in VS Code's status bar
- ⚙️ Configurable Format: Toggle between 12-hour and 24-hour formats
- 📅 Optional Date: Show or hide the current date
- ⏱️ Optional Seconds: Show or hide seconds in the time display
- 🖱️ Click to Toggle: Click the clock to toggle between 12/24-hour formats
Installation
From Source
- Clone this repository
- Open the project in VS Code
- Run
npm install to install dependencies
- Press
F5 to open a new Extension Development Host window
- The clock should appear in the status bar
Building VSIX Package
- Install
vsce globally: npm install -g vsce
- Run
vsce package to create a .vsix file
- Install the extension using
code --install-extension live-clock-1.0.0.vsix
Configuration
The extension provides several configuration options:
liveClock.use24HourFormat (boolean, default: true): Use 24-hour time format
liveClock.showSeconds (boolean, default: true): Show seconds in the clock
liveClock.showDate (boolean, default: false): Show date along with time
You can modify these settings in VS Code's settings (File > Preferences > Settings) or by editing your settings.json file:
{
"liveClock.use24HourFormat": false,
"liveClock.showSeconds": true,
"liveClock.showDate": true
}
Commands
Toggle Live Clock : Switches between 12-hour and 24-hour format
Development
Prerequisites
- VS Code 1.60.0 or higher
- Node.js 14.x or higher
- TypeScript 4.4.4 or higher
Setup
- Clone the repository
- Run
npm install
- Run
npm run compile to compile TypeScript
- Press
F5 to start debugging
Scripts
npm run compile : Compile TypeScript to JavaScript
npm run watch : Watch for changes and compile automatically
npm run lint : Run ESLint
License
MIT License
| |