Skip to content

Commit

Permalink
Merge pull request #11 from siropkin/develop
Browse files Browse the repository at this point in the history
v1.2.0
  • Loading branch information
siropkin authored Jul 29, 2024
2 parents aa1553e + a5ffb5e commit d97807b
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 19 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## [Unreleased]


## [1.2.0] - 2024-07-29
### Changed
- Plugin settings moved to Tools: `File` > `Settings` > `Tools` > `Kursor`.
- Fix German keyboard layout abbreviation for Windows.


## [1.1.1] - 2024-07-25
### Changed
- Improved keyboard layout detection for Windows users, including detection of different input methods within the same language. Previously, Kursor would not detect different input methods within one language, but now it does.
Expand Down
38 changes: 31 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,40 @@
</div>

<!-- Plugin description -->
## What is Kursor?
Avoid typos and coding errors caused by language switching.

Kursor simplifies language tracking directly on your IntelliJ IDE.

It dynamically displays the current keyboard language on your cursor, offering the added functionality of changing the cursor's color to match the language in use.

This feature is particularly beneficial for developers juggling multiple languages, significantly reducing the likelihood of typing errors.
<!-- Plugin description end -->

## Installation
### Features
- **🎨 Cursor Color Change:** Automatically changes the cursor color based on the current language.
- **🔤 Language Indicator:** Displays the current language on the cursor.
- **🔒 Caps Lock Indicator:** Shows the Caps Lock status on the cursor.
- **🔧 Customization:** Customize the language indicator's font, size, opacity, and position.
- **🖥️ Supported Operating Systems:** Available on Windows, Mac, and Linux.

[![Install Kursor](https://user-images.githubusercontent.com/12044174/123105697-94066100-d46a-11eb-9832-338cdf4e0612.png)](https://plugins.jetbrains.com/plugin/22072-kursor)

Alternatively, you can install it directly inside your IDE:
## Installation
[Get from marketplace](https://plugins.jetbrains.com/plugin/22072-kursor) or install it directly inside your IDE:

- **For Windows & Linux:** `File` > `Settings` > `Plugins` > `Marketplace` > Search for "Kursor" > `Install Plugin` > Restart IntelliJ IDEA
- **For Mac:** `IntelliJ IDEA` > `Preferences` > `Plugins` > `Marketplace` > Search for "Kursor" > `Install Plugin` > Restart IntelliJ IDEA

## Features and Settings

## Usage
Once installed, Kursor will automatically run when you open your project in IntelliJ IDEA.


## Customization
You can customize Kursor's settings to suit your preferences:

1. Go to `File` > `Settings` > `Tools` > `Kursor`.
2. Adjust the settings to your liking.
3. Click `Apply` to save the changes.

![Settings Screenshot](./screenshots/settings.png)

Expand All @@ -45,8 +62,8 @@ Alternatively, you can install it directly inside your IDE:
- **Vertical Position:** Vertical position of the language indicator (top, middle, or bottom).
- **Horizontal Offset:** Horizontal offset of the language indicator.

## Feedback and Suggestions

## Feedback and Suggestions
I value your feedback and suggestions to improve Kursor. If you have any ideas, issues, or feature requests, please share them with me on GitHub. Your input helps me make Kursor better for everyone.

To post your feedback or suggestions, visit our GitHub Issues page:
Expand All @@ -55,7 +72,14 @@ To post your feedback or suggestions, visit our GitHub Issues page:

Thank you for supporting Kursor and helping me enhance your coding experience.

<!-- Plugin description end -->


## Support
## License
Kursor is open-source and available under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).


## Support
[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ivan.seredkin)


2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = com.github.siropkin.kursor
pluginName = Kursor
pluginRepositoryUrl = https://github.com/siropkin/kursor
# SemVer format -> https://semver.org
pluginVersion = 1.1.1
pluginVersion = 1.2.0

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 232
Expand Down
Binary file modified screenshots/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 10 additions & 7 deletions src/main/kotlin/com/github/siropkin/kursor/KeyboardLayoutInfo.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.siropkin.kursor

import com.sun.jna.Platform
import com.sun.jna.platform.win32.User32
import com.sun.jna.platform.win32.WinDef
import com.sun.jna.platform.win32.WinDef.HKL
Expand All @@ -16,7 +17,7 @@ private val windowsKeyboardLayoutMap = mapOf(
"00000404" to "CH",
"00000405" to "CZ",
"00000406" to "DK",
"00000407" to "GR",
"00000407" to "DE",
"00000408" to "GK",
"00000409" to "US",
"0000040A" to "SP",
Expand Down Expand Up @@ -57,7 +58,7 @@ private val windowsKeyboardLayoutMap = mapOf(
"00001809" to "US",
"00010402" to "US",
"00010405" to "CZ",
"00010407" to "GR",
"00010407" to "DEI",
"00010408" to "GK",
"00010409" to "DV",
"0001040A" to "SP",
Expand All @@ -78,7 +79,7 @@ private val windowsKeyboardLayoutMap = mapOf(
)

// https://www.autoitscript.com/autoit3/docs/appendix/OSLangCodes.htm
val windowsKeyboardCountryCodeMap = mapOf(
private val windowsKeyboardCountryCodeMap = mapOf(
"0004" to "zh-CHS",
"0401" to "ar-SA",
"0402" to "bg-BG",
Expand Down Expand Up @@ -210,16 +211,15 @@ class KeyboardLayout(private val layout: String, private val country: String, pr
}

class KeyboardLayoutInfo {
private val os: String = System.getProperty("os.name").lowercase()
private var linuxDistribution: String = System.getenv("DESKTOP_SESSION")?.lowercase() ?: ""
private var linuxDesktopGroup: String = System.getenv("XDG_SESSION_TYPE")?.lowercase() ?: ""
private var linuxNonUbuntuKeyboardLayouts: List<String> = emptyList()

fun getLayout(): KeyboardLayout {
return when {
os.startsWith("linux") -> getLinuxKeyboardLayout()
os.startsWith("win") -> getWindowsKeyboardLayout()
os.startsWith("mac") -> getMacKeyboardLayout()
Platform.isLinux() -> getLinuxKeyboardLayout()
Platform.isWindows() -> getWindowsKeyboardLayout()
Platform.isMac() -> getMacKeyboardLayout()
else -> KeyboardLayout(unknown, unknown, unknown)
}
}
Expand Down Expand Up @@ -333,6 +333,9 @@ class KeyboardLayoutInfo {
"0xfffffffff014" -> {
"0001041F"
}
"0xfffffffff012" -> {
"00010407"
}
else -> {
layoutId.substring(2).padStart(8, '0')
}
Expand Down
19 changes: 15 additions & 4 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
<idea-plugin require-restart="false">
<id>com.github.siropkin.kursor</id>
<name>Kursor</name>
<version>1.1.1</version>
<version>1.2.0</version>
<vendor email="[email protected]">Ivan Seredkin</vendor>

<description><![CDATA[
Avoid typos and coding errors caused by language switching.<br />
Kursor simplifies language tracking directly on your IntelliJ IDE.<br />
It dynamically displays the current keyboard language on your cursor, offering the added functionality of changing the cursor's color to match the language in use.<br />
This feature is particularly beneficial for developers juggling multiple languages, significantly reducing the likelihood of typing errors.
]]></description>

<change-notes><![CDATA[
1.2.0 (2024-07-29)<br />
++++++++++++++++++<br />
Changed:<br />
- Plugin settings moved to Tools: `File` > `Settings` > `Tools` > `Kursor`.<br />
- Fix German keyboard layout abbreviation for Windows.<br />
<br />
<br />
1.1.1 (2024-07-25)<br />
++++++++++++++++++<br />
Changed:<br />
Expand Down Expand Up @@ -64,9 +72,12 @@
<depends>com.intellij.modules.platform</depends>

<extensions defaultExtensionNs="com.intellij">
<applicationConfigurable parentId="appearance"
instance="com.github.siropkin.kursor.settings.KursorSettingsConfigurable"
id="org.intellij.sdk.settings.AppSettingsConfigurable" dynamic="true" displayName="Kursor"/>
<applicationConfigurable
parentId="tools"
instance="com.github.siropkin.kursor.settings.KursorSettingsConfigurable"
id="com.github.siropkin.kursor.settings.KursorSettingsConfigurable"
displayName="Kursor"
/>
<applicationService serviceImplementation="com.github.siropkin.kursor.settings.KursorSettings"/>
<postStartupActivity implementation="com.github.siropkin.kursor.KursorStartupActivity" />
</extensions>
Expand Down

0 comments on commit d97807b

Please sign in to comment.