Skip to content
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
bayramarslan committed May 23, 2024
1 parent ec93606 commit 5e1971b
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 78 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

All notable changes to the "theme-status" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [Unreleased]
## [0.0.1] - 2024-05-24

- Initial release
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Your Name

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
76 changes: 20 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,35 @@
# theme-status README
# VSCode Theme Display and Selector

This is the README for your extension "theme-status". After writing up a brief description, we recommend including the following sections.
VSCode Theme Display and Selector is a Visual Studio Code extension that displays the name of the active theme in the status bar and opens a theme selection list when clicked. With this extension, you can easily see the name of the active theme and quickly switch between themes.

## Features

Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
- Displays the name of the current theme in the status bar.
- Opens a theme selection list when the theme name is clicked.
- User-friendly and easy to use.

For example if there is an image subfolder under your extension project workspace:
## Installation

\!\[feature X\]\(images/feature-x.png\)
1. **From the VSCode Marketplace**:
- Go to the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/).
- Search for "VSCode Theme Display and Selector" extension and click on the "Install" button.

> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
2. **Manual Installation**:
- Download the latest release from the [Releases](https://github.com/bayramarslan/vscode-theme-status/releases) page.
- Install the downloaded `.vsix` file by opening VSCode, navigating to the Extensions view, clicking on the ellipsis (...) icon, and selecting "Install from VSIX".

## Requirements
## Usage

If you have any requirements or dependencies, add a section describing those and how to install and configure them.
Once installed, the name of the active theme will be displayed in the status bar. Clicking on the theme name will open a dropdown menu with a list of available themes. Selecting a theme from the list will immediately apply the chosen theme.

## Extension Settings
## Contributing

Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
Contributions are welcome! Please fork the repository and submit a pull request with your improvements.

For example:
## License

This extension contributes the following settings:
This project is licensed under the [MIT License](LICENSE).

* `myExtension.enable`: Enable/disable this extension.
* `myExtension.thing`: Set to `blah` to do something.
## Acknowledgements

## Known Issues

Calling out known issues can help limit users opening duplicate issues against your extension.

## Release Notes

Users appreciate release notes as you update your extension.

### 1.0.0

Initial release of ...

### 1.0.1

Fixed issue #.

### 1.1.0

Added features X, Y, and Z.

---

## Following extension guidelines

Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.

* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)

## Working with Markdown

You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:

* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.

## For more information

* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)

**Enjoy!**
- Special thanks to [VSCode](https://code.visualstudio.com/) for providing a powerful extension development platform.
Binary file added images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 26 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
{
"name": "theme-status",
"displayName": "theme-status",
"displayName": "Theme Status",
"description": "Displays the current theme name in the status bar",
"icon": "images/icon.png",
"publisher": "bayramarslan",
"version": "0.0.1",
"engines": {
"vscode": "^1.89.0"
},
"categories": [
"Other"
"Themes"
],
"keywords": [
"theme",
"statusbar",
"color-scheme",
"theme-name",
"config",
"shortcut"
],
"activationEvents": [
"onStartupFinished"
],
"activationEvents": [],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "theme-status.helloWorld",
"title": "Hello World"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
Expand All @@ -37,5 +41,14 @@
"typescript": "^5.4.5",
"@vscode/test-cli": "^0.0.9",
"@vscode/test-electron": "^2.3.9"
}
}
},
"repository": {
"type": "git",
"url": "https://github.com/bayramarslan/vscode-theme-status.git"
},
"bugs": {
"url": "https://github.com/bayramarslan/vscode-theme-status/issues"
},
"homepage": "https://github.com/bayramarslan/vscode-theme-status",
"license": "MIT"
}
38 changes: 32 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
import * as vscode from 'vscode';

let statusBarItem: vscode.StatusBarItem | undefined;

export function activate(context: vscode.ExtensionContext) {
statusBarItem = vscode.window.createStatusBarItem(
vscode.StatusBarAlignment.Right,
Number.MIN_SAFE_INTEGER
);

statusBarItem.text = "${paintcan} NaN";
statusBarItem.tooltip = "Click to change theme";
statusBarItem.command = "workbench.action.selectTheme";

context.subscriptions.push(statusBarItem);
statusBarItem.show();

console.log('Congratulations, your extension "theme-status" is now active!');
updateStatusBar();

let disposable = vscode.commands.registerCommand('theme-status.helloWorld', () => {
vscode.window.showInformationMessage('Hello World from theme-status!');
});
vscode.workspace.onDidChangeConfiguration(() => {
updateStatusBar();
})

context.subscriptions.push(disposable);
}

export function deactivate() {}

function updateStatusBar() {
if (!statusBarItem) return false;
statusBarItem.text = "$(paintcan) " + getCurrentTheme();
}

function getCurrentTheme(): string {
return vscode.workspace.getConfiguration('workbench').get('colorTheme', 'Unknown');
}

export function deactivate() {
if (statusBarItem) {
statusBarItem.dispose();
}
}

0 comments on commit 5e1971b

Please sign in to comment.