mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-21 00:01:26 +02:00
feat(cli): add focus-monitor-at-cursor cmd
This commit adds a new komorebic command, focus-monitor-at-cursor, which can optionally be chained with the focus-workspace command in keybindings to reproduce the previous default behaviour of auto-focusing whichever monitor the cursor was on before attempting to change the focused workspace.
This commit is contained in:
@@ -119,6 +119,7 @@ pub enum SocketMessage {
|
|||||||
CycleFocusMonitor(CycleDirection),
|
CycleFocusMonitor(CycleDirection),
|
||||||
CycleFocusWorkspace(CycleDirection),
|
CycleFocusWorkspace(CycleDirection),
|
||||||
FocusMonitorNumber(usize),
|
FocusMonitorNumber(usize),
|
||||||
|
FocusMonitorAtCursor,
|
||||||
FocusLastWorkspace,
|
FocusLastWorkspace,
|
||||||
CloseWorkspace,
|
CloseWorkspace,
|
||||||
FocusWorkspaceNumber(usize),
|
FocusWorkspaceNumber(usize),
|
||||||
|
|||||||
@@ -735,6 +735,11 @@ impl WindowManager {
|
|||||||
self.focus_monitor(monitor_idx)?;
|
self.focus_monitor(monitor_idx)?;
|
||||||
self.update_focused_workspace(self.mouse_follows_focus, true)?;
|
self.update_focused_workspace(self.mouse_follows_focus, true)?;
|
||||||
}
|
}
|
||||||
|
SocketMessage::FocusMonitorAtCursor => {
|
||||||
|
if let Some(monitor_idx) = self.monitor_idx_from_current_pos() {
|
||||||
|
self.focus_monitor(monitor_idx)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
SocketMessage::Retile => {
|
SocketMessage::Retile => {
|
||||||
border_manager::destroy_all_borders()?;
|
border_manager::destroy_all_borders()?;
|
||||||
self.retile_all(false)?
|
self.retile_all(false)?
|
||||||
|
|||||||
@@ -1108,6 +1108,8 @@ enum SubCommand {
|
|||||||
/// Focus the specified monitor
|
/// Focus the specified monitor
|
||||||
#[clap(arg_required_else_help = true)]
|
#[clap(arg_required_else_help = true)]
|
||||||
FocusMonitor(FocusMonitor),
|
FocusMonitor(FocusMonitor),
|
||||||
|
/// Focus the monitor at the current cursor location
|
||||||
|
FocusMonitorAtCursor,
|
||||||
/// Focus the last focused workspace on the focused monitor
|
/// Focus the last focused workspace on the focused monitor
|
||||||
FocusLastWorkspace,
|
FocusLastWorkspace,
|
||||||
/// Focus the specified workspace on the focused monitor
|
/// Focus the specified workspace on the focused monitor
|
||||||
@@ -2588,6 +2590,9 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) {
|
|||||||
SubCommand::FocusMonitor(arg) => {
|
SubCommand::FocusMonitor(arg) => {
|
||||||
send_message(&SocketMessage::FocusMonitorNumber(arg.target))?;
|
send_message(&SocketMessage::FocusMonitorNumber(arg.target))?;
|
||||||
}
|
}
|
||||||
|
SubCommand::FocusMonitorAtCursor => {
|
||||||
|
send_message(&SocketMessage::FocusMonitorAtCursor)?;
|
||||||
|
}
|
||||||
SubCommand::FocusLastWorkspace => {
|
SubCommand::FocusLastWorkspace => {
|
||||||
send_message(&SocketMessage::FocusLastWorkspace)?;
|
send_message(&SocketMessage::FocusLastWorkspace)?;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user