Skip to content

Commit

Permalink
[adjacent-windows@klangman] Initial extension commit (#583)
Browse files Browse the repository at this point in the history
Add a new applet that allows the user to define hotkeys that will activate adjacent windows based on desired direction (left, right, up, down and under).
  • Loading branch information
klangman authored Mar 18, 2024
1 parent f6d1ef3 commit fddcd5d
Show file tree
Hide file tree
Showing 10 changed files with 1,382 additions and 0 deletions.
5 changes: 5 additions & 0 deletions adjacent-windows@klangman/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 1.0.0

* Initial verion commited to cinnamon spices
26 changes: 26 additions & 0 deletions adjacent-windows@klangman/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Adjacent Windows
A Cinnamon extension that allows you to define hot keys which will activate the nearest window to the current window on the left, right, above, below or underneath. There is also an option (disabled by default) to undo the window change and activate the window that previously had the focus. With this extension you can easily switch the window focus without reaching for the mouse and it's faster than using Alt-TAB. It's particularly useful for people frequently who use window tiling.

By default the Super+Alt+(arrow-keys) are defined as the hotkeys to move to adjacent windows, but this can be changed in the configuration. If you like, for instance, the Vim key bindings, you could change them to Super+h/j/k/l. The default hotkey for activating windows underneath the current window is Super+Alt+Insert (Keypad)

## Requirements
This applet requires at least Mint 21 / Cinnamon 5.4 because the Meta.Window.get_frame_rect() API is needed.

## Installation
1. Right click on the cinnamon panel and click "System Settings"
2. Click on the "Extensions" icon under the "Preferences" category
3. Click the "Download" tab and then click the "Adjacent Windows" entry
4. Click the "Install" button on the right and then return to the "Manage" tab
6. Select the new "Adjacent Windows" entry and then click the "+" button at the bottom of the window
7. Click on the gears icon to the right of the "Adjacent Windows" entry to open the configuration window so you can change the hotkeys and other options as desired.

## Feedback
Please leave a comment here on cinnamon-spices.linuxmint.com or you can create an issue on my "Adjacent Windows" development GitHub repository if you encounter any issues with this extension:

https://github.com/klangman/Adjacent-Windows

This is where I develop new features and test out any new ideas I have before pushing to cinnamon-spices.

If you use this extension please let me know by "liking" it here and on my Github repository, that way I will be encouraged to continue working on the project.

Free Icon: https://www.flaticon.com/free-icon/four-arrows_10696144 Four ways icons created by Laisa Islam Ani
674 changes: 674 additions & 0 deletions adjacent-windows@klangman/files/adjacent-windows@klangman/LICENSE

Large diffs are not rendered by default.

499 changes: 499 additions & 0 deletions adjacent-windows@klangman/files/adjacent-windows@klangman/extension.js

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"uuid": "adjacent-windows@klangman",
"name": "Adjacent Windows",
"version": "1.0.0",
"description": "Use hotkeys to switch to adjacent windows",
"url": "https://github.com/klangman/Adjacent-Windows",
"website": "https://github.com/klangman/Adjacent-Windows",
"cinnamon-version": ["5.4"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# SOME DESCRIPTIVE TITLE.
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: adjacent-windows@klangman 1.0.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-03-17 22:29-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. metadata.json->name
msgid "Adjacent Windows"
msgstr ""

#. metadata.json->description
msgid "Use hotkeys to switch to adjacent windows"
msgstr ""

#. settings-schema.json->keybinding-header->description
msgid "Hotkeys to switch focus relative to the current window"
msgstr ""

#. settings-schema.json->left-key->description
msgid "Activate window to the left"
msgstr ""

#. settings-schema.json->right-key->description
msgid "Activate window to the right"
msgstr ""

#. settings-schema.json->up-key->description
msgid "Activate window above"
msgstr ""

#. settings-schema.json->down-key->description
msgid "Activate window below"
msgstr ""

#. settings-schema.json->under-key->description
msgid "Activate window under"
msgstr ""

#. settings-schema.json->under-key->tooltip
msgid ""
"Switch to the next window in the z-order that is overlapped by the current "
"window. If the key combo is pressed again within 3 sec, the focus will "
"change to the next window beneath the window that originally had the focus "
"during the fist key combo press."
msgstr ""

#. settings-schema.json->back-key->description
msgid "Undo the focus change"
msgstr ""

#. settings-schema.json->settings-header->description
msgid "Other settings"
msgstr ""

#. settings-schema.json->next-focus->options
msgid "Closest to the current window"
msgstr ""

#. settings-schema.json->next-focus->options
msgid "Highest in the z-order"
msgstr ""

#. settings-schema.json->next-focus->options
msgid "Closest with a visible corner"
msgstr ""

#. settings-schema.json->next-focus->description
msgid "Activate the window that is..."
msgstr ""

#. settings-schema.json->next-focus->tooltip
msgid ""
"When using the Left, Right, Above or Below hotkeys, activate the window that "
"is either:\n"
"- Closest to the current window: this might activate a window that is "
"currently completely obscured by other windows.\n"
"- Highest in the z-order: most recently focused; this might skip over "
"visible windows that are closer to the current window.\n"
"- Closest window with a visible corner: a compromise that is designed to be "
"more like what most people would generally expect (I hope)."
msgstr ""

#. settings-schema.json->include-minimized->description
msgid "Allow switching to minimized windows"
msgstr ""

#. settings-schema.json->include-other-monitors->description
msgid "Allow switching to windows on other monitors"
msgstr ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"keybinding-header": {
"type": "header",
"description": "Hotkeys to switch focus relative to the current window"
},
"left-key": {
"type": "keybinding",
"description": "Activate window to the left",
"default": "<Alt><Super>Left"
},
"right-key": {
"type": "keybinding",
"description": "Activate window to the right",
"default": "<Alt><Super>Right"
},
"up-key": {
"type": "keybinding",
"description": "Activate window above",
"default": "<Alt><Super>Up"
},
"down-key": {
"type": "keybinding",
"description": "Activate window below",
"default": "<Alt><Super>Down"
},
"under-key": {
"type": "keybinding",
"description": "Activate window under",
"default": "<Alt><Super>KP_Insert",
"tooltip": "Switch to the next window in the z-order that is overlapped by the current window. If the key combo is pressed again within 3 sec, the focus will change to the next window beneath the window that originally had the focus during the fist key combo press."
},
"back-key": {
"type": "keybinding",
"description": "Undo the focus change",
"default": ""
},
"settings-header": {
"type": "header",
"description": "Other settings"
},
"next-focus": {
"type": "combobox",
"default": 2,
"options": {
"Closest to the current window": 0,
"Highest in the z-order": 1,
"Closest with a visible corner": 2
},
"description": "Activate the window that is...",
"tooltip": "When using the Left, Right, Above or Below hotkeys, activate the window that is either:\n- Closest to the current window: this might activate a window that is currently completely obscured by other windows.\n- Highest in the z-order: most recently focused; this might skip over visible windows that are closer to the current window.\n- Closest window with a visible corner: a compromise that is designed to be more like what most people would generally expect (I hope)."
},
"include-minimized": {
"type": "switch",
"default": false,
"description": "Allow switching to minimized windows",
"dependency" : "next-focus<1"
},
"include-other-monitors": {
"type": "switch",
"default": false,
"description": "Allow switching to windows on other monitors"
}
}
4 changes: 4 additions & 0 deletions adjacent-windows@klangman/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"author": "klangman",
"license": "GPL-3.0"
}
Binary file added adjacent-windows@klangman/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fddcd5d

Please sign in to comment.