6 Commits
v0.2 ... v0.2.1

Author SHA1 Message Date
Peter Fajdiga
0266cde2f1 bump version to 0.2.1 2023-06-23 21:01:24 +02:00
Peter Fajdiga
f0e662de37 shrinkVisibleColumns: prevent expanding 2023-06-23 20:36:12 +02:00
Peter Fajdiga
e5c9b52370 Grid.rescaleVisibleColumns: adjust scroll after rescaling 2023-06-23 20:32:04 +02:00
Peter Fajdiga
83ac2506cf Grid.rescaleVisibleColumns: take overscroll amount into account 2023-06-23 20:32:03 +02:00
Peter Fajdiga
d8eec7a881 generate key binding documentation for bbcode 2023-06-23 20:32:03 +02:00
Peter Fajdiga
cb66a26394 readme: add key bindings 2023-06-23 13:43:49 +02:00
7 changed files with 62 additions and 16 deletions

View File

@@ -21,8 +21,8 @@ package:
logs:
journalctl -t kwin_x11 -g '^qml:|^file://.*karousel' -f
docs-key-bindings-plain:
@tsc ${TSC_SCRIPT_FLAGS} ./src/keyBindings/definition.ts ./generators/docs/keyBindings.ts ./generators/docs/keyBindingsPlain.ts --outFile /dev/stdout | node -
docs-key-bindings-bbcode:
@tsc ${TSC_SCRIPT_FLAGS} ./src/keyBindings/definition.ts ./generators/docs/keyBindings.ts ./generators/docs/keyBindingsBbcode.ts --outFile /dev/stdout | node -
docs-key-bindings-table:
@tsc ${TSC_SCRIPT_FLAGS} ./src/keyBindings/definition.ts ./generators/docs/keyBindings.ts ./generators/docs/keyBindingsTable.ts --outFile /dev/stdout | node -

View File

@@ -20,3 +20,40 @@ Similar window managers include [PaperWM](https://github.com/paperwm/PaperWM) an
- Doesn't support multiple screens
- Doesn't support windows on all desktops
- Doesn't support windows on multiple activities
## Key bindings
| Shortcut | Action |
| --- | --- |
| Meta+Space | Toggle floating |
| Meta+A | Move focus left |
| Meta+D | Move focus right |
| Meta+W | Move focus up |
| Meta+S | Move focus down |
| Meta+Home | Move focus to start |
| Meta+End | Move focus to end |
| Meta+Shift+A | Move window left (Moves window out of and into columns) |
| Meta+Shift+D | Move window right (Moves window out of and into columns) |
| Meta+Shift+W | Move window up |
| Meta+Shift+S | Move window down |
| Meta+Shift+Home | Move window to start |
| Meta+Shift+End | Move window to end |
| Meta+X | Expand window (Expands focused window vertically; toggles stacked layout for focused column) |
| Meta+Ctrl+Shift+A | Move column left |
| Meta+Ctrl+Shift+D | Move column right |
| Meta+Ctrl+Shift+Home | Move column to start |
| Meta+Ctrl+Shift+End | Move column to end |
| Meta+Ctrl+X | Expand column (Expands focused column horizontally to fill the screen) |
| Meta+Alt++ | Expand fully visible columns (Expands fully visible columns to fill the screen) |
| Meta+Alt+- | Shrink visible columns (Shrinks fully and partially visible columns, making them fully visible and filling the screen) |
| Meta+Alt+Return | Center focused window (Scrolls so that the focused window is centered in the screen) |
| Meta+Alt+A | Scroll one column to the left |
| Meta+Alt+D | Scroll one column to the right |
| Meta+Alt+PgUp | Scroll left |
| Meta+Alt+PgDown | Scroll right |
| Meta+Alt+Home | Scroll to start |
| Meta+Alt+End | Scroll to end |
| Meta+[N] | Move focus to column N |
| Meta+Shift+[N] | Move window to column N (Requires manual remapping according to your keyboard layout, e.g. Meta+Shift+1 -> Meta+!) |
| Meta+Ctrl+Shift+[N] | Move column to position N (Requires manual remapping according to your keyboard layout, e.g. Meta+Ctrl+Shift+1 -> Meta+Ctrl+!) |
| Meta+Ctrl+Shift+F[N] | Move column to desktop N |
| Meta+Ctrl+Shift+Alt+F[N] | Move this and all following columns to desktop N |

View File

@@ -0,0 +1,12 @@
console.log(`[list]`);
for (const binding of keyBindings) {
console.log(` [*] ${binding.defaultKeySequence}${binding.description}${formatComment(binding.comment)}`);
}
for (const binding of numKeyBindings) {
const numPrefix = binding.fKeys ? "F" : "";
console.log(` [*] ${binding.defaultModifiers}+${numPrefix}[N] — ${binding.description}N${formatComment(binding.comment)}`);
}
console.log(`[/list]`);

View File

@@ -1,8 +0,0 @@
for (const binding of keyBindings) {
console.log(`${binding.defaultKeySequence} - ${binding.description}${formatComment(binding.comment)}`);
}
for (const binding of numKeyBindings) {
const numPrefix = binding.fKeys ? "F" : "";
console.log(`${binding.defaultModifiers}+${numPrefix}[N] - ${binding.description}N${formatComment(binding.comment)}`);
}

View File

@@ -9,7 +9,7 @@
}],
"Id": "karousel",
"ServiceTypes": ["KWin/Script"],
"Version": "0.2",
"Version": "0.2.1",
"License": "GPLv3",
"Website": "https://github.com/peterfajdiga/karousel",
"BugReportUrl": "https://github.com/peterfajdiga/karousel/issues"

View File

@@ -177,13 +177,13 @@ function initActions(world: World) {
expandVisibleColumns: () => {
const grid = world.getCurrentGrid();
grid.rescaleVisibleColumns(true);
grid.rescaleVisibleColumns(true, true);
grid.arrange();
},
shrinkVisibleColumns: () => {
const grid = world.getCurrentGrid();
grid.rescaleVisibleColumns(false);
grid.rescaleVisibleColumns(false, false);
grid.arrange();
},

View File

@@ -114,7 +114,7 @@ class Grid {
return last;
}
rescaleVisibleColumns(fullyVisible: boolean) {
rescaleVisibleColumns(fullyVisible: boolean, allowScaleUp: boolean) {
const startColumn = this.getLeftmostVisibleColumn(fullyVisible);
const endColumn = this.getRightmostVisibleColumn(fullyVisible);
if (startColumn === null || endColumn === null) {
@@ -124,8 +124,11 @@ class Grid {
const startX = startColumn.gridX;
const endX = endColumn.gridX + endColumn.width;
const width = endX - startX;
const scaleRatio = this.tilingArea.width / width;
let remainingWidth = this.tilingArea.width;
let remainingWidth = this.tilingArea.width - 2 * this.world.config.overscroll;
const scaleRatio = remainingWidth / width;
if (!allowScaleUp && scaleRatio >= 1.0) {
return;
}
for (const column of this.columns.iteratorFrom(startColumn)) {
if (column !== endColumn) {
@@ -137,6 +140,8 @@ class Grid {
break;
}
}
this.setScroll(startX - this.world.config.overscroll, false);
}
scrollToColumn(column: Column) {