Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions close-in-switcher@Sarthak-Raghav/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Close in Switcher

Press **Delete** while the Alt-Tab window switcher is open to close the
highlighted window. The switcher stays open, so you can close several
windows in one Alt-Tab hold.

Restores behaviour familiar from Windows.

Tested on Cinnamon 6.6.

![demo](demo.gif)
Binary file added close-in-switcher@Sarthak-Raghav/demo.gif
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,36 @@
const AppSwitcherMod = imports.ui.appSwitcher.appSwitcher;
const Clutter = imports.gi.Clutter;

let _orig = null;

function init(metadata) {}

function enable() {
if (!AppSwitcherMod.AppSwitcher ||
!AppSwitcherMod.AppSwitcher.prototype ||
!AppSwitcherMod.AppSwitcher.prototype._keyPressEvent) {
global.logError("close-in-switcher: incompatible Cinnamon version, not enabling");
return;
}

_orig = AppSwitcherMod.AppSwitcher.prototype._keyPressEvent;

AppSwitcherMod.AppSwitcher.prototype._keyPressEvent = function(actor, event) {
if (event.get_key_symbol() === Clutter.KEY_Delete) {
let win = this._windows && this._windows[this._currentIndex];
if (win) {
global.log("CloseInSwitcher: closing " + win.get_title());
win.delete(event.get_time());
}
return true;
}
return _orig.call(this, actor, event);
};
}

function disable() {
if (_orig) {
AppSwitcherMod.AppSwitcher.prototype._keyPressEvent = _orig;
_orig = null;
}
}
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": "close-in-switcher@Sarthak-Raghav",
"name": "Close in Switcher",
"description": "Press Delete in the Alt-Tab switcher to close the highlighted window.",
"version": "1.0.0",
"url": "https://github.com/Sarthak-Raghav/close-in-switcher",
"author": "Sarthak-Raghav",
"cinnamon-version": ["6.6"]
}
5 changes: 5 additions & 0 deletions close-in-switcher@Sarthak-Raghav/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"author": "Sarthak-Raghav",
"name": "Close in Switcher",
"description": "Press Delete in the Alt-Tab switcher to close the highlighted window."
}
Binary file added close-in-switcher@Sarthak-Raghav/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading