From 2958d53ef74099c3ccf3bcdaa1853e92edac22d0 Mon Sep 17 00:00:00 2001 From: Will Nayes Date: Sun, 14 Jan 2024 14:33:59 -0600 Subject: [PATCH] Add file manager default shortcut. --- docs/docs/usage/keyboard-shortcuts.md | 1 + packages/react-config/index.ts | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/docs/usage/keyboard-shortcuts.md b/docs/docs/usage/keyboard-shortcuts.md index 44e7ea7..6a46a5d 100644 --- a/docs/docs/usage/keyboard-shortcuts.md +++ b/docs/docs/usage/keyboard-shortcuts.md @@ -16,6 +16,7 @@ that can be edited or extended as desired. | ----------------------------------------- | --------------------------------------------------------- | | `Mod4 + Enter` | Opens a new instance of your configured default terminal. | | `Mod4 + Space` | Swaps between available layouts on the current screen. | +| `Mod4 + E` | Opens a file manager of your choice. | | `Mod4 + R` | Opens a launcher program of your choice. | | `Mod4 + O` | Sends the active window to the next screen. | | `Mod4 + 1` ... `Mod4 + 9` | Switches to a different tag by index. | diff --git a/packages/react-config/index.ts b/packages/react-config/index.ts index 7f28ec5..c433cb9 100644 --- a/packages/react-config/index.ts +++ b/packages/react-config/index.ts @@ -4,6 +4,7 @@ import LayoutTiling from "@bond-wm/layout-tiling"; const DefaultTerminal = "xterm"; const DefaultLauncher = "dmenu_run"; +const DefaultFileManager = "pcmanfm"; const config: IConfig = { /** Layout to use initially. */ @@ -22,19 +23,19 @@ const config: IConfig = { onWindowManagerReady: ({ wm }) => { // Establish keyboard shortcuts. wm.registerShortcuts({ - "Mod4 + o": () => wm.sendActiveWindowToNextScreen(), + "Mod4 + e": () => wm.launchProcess(DefaultFileManager), "Mod4 + r": () => wm.launchProcess(DefaultLauncher), - "Mod4 + Return": () => wm.launchProcess(DefaultTerminal), + "Mod4 + space": () => wm.switchToNextLayout(), + "Mod4 + o": () => wm.sendActiveWindowToNextScreen(), "Mod4 + Shift + C": () => wm.closeFocusedWindow(), "Mod4 + Shift + M": () => wm.startDragFocusedWindow(), - "Mod4 + Shift + Q": () => wm.quit(), - "Mod4 + Shift + F12": () => wm.showDevtoolsForFocusedWindowFrame(), "Mod4 + Ctrl + r": () => wm.restart(), + "Mod4 + Shift + Q": () => wm.quit(), }); for (let i = 1; i <= 9; i++) { wm.registerShortcuts({