Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat: add toggle flag to set_* commands rather than separate toggle command

Lars Berger93d10c299cda
diff --git a/packages/wm/src/app_command.rs b/packages/wm/src/app_command.rs
index ee017ece..14942233 100644
--- a/packages/wm/src/app_command.rs
+++ b/packages/wm/src/app_command.rs
@@ -97,8 +97,15 @@ pub enum QueryCommand {
#[derive(Subcommand, Debug)]
#[clap(rename_all = "snake_case")]
pub enum InvokeCommand {
- AdjustBorders(InvokeAdjustBordersCommand),
Close,
+ ChangeBorders(InvokeChangeBordersCommand),
+ ChangeTilingDirection {
+ #[clap(long = "tiling_dir")]
+ tiling_direction: Option<TilingDirection>,
+
+ #[clap(long)]
+ toggle: bool,
+ },
Focus(InvokeFocusCommand),
Ignore,
Move(InvokeMoveCommand),
@@ -107,25 +114,30 @@ pub enum InvokeCommand {
direction: Direction,
},
Resize(InvokeResizeCommand),
- SetFloating,
- SetFullscreen,
- SetMaximized,
- SetMinimized,
- SetTiling,
- SetTilingDirection {
- #[clap(long = "tiling_dir")]
- tiling_direction: TilingDirection,
+ SetFloating {
+ #[clap(long)]
+ toggle: bool,
+ },
+ SetFullscreen {
+ #[clap(long)]
+ toggle: bool,
+ },
+ SetMaximized {
+ #[clap(long)]
+ toggle: bool,
+ },
+ SetMinimized {
+ #[clap(long)]
+ toggle: bool,
+ },
+ SetTiling {
+ #[clap(long)]
+ toggle: bool,
},
ShellExec {
#[clap(long, num_args = 1..)]
command: Vec<String>,
},
- ToggleFloating,
- ToggleFullscreen,
- ToggleMaximized,
- ToggleMinimized,
- ToggleTiling,
- ToggleTilingDirection,
WmDisableBindingMode {
#[clap(long)]
name: String,
@@ -137,7 +149,20 @@ pub enum InvokeCommand {
},
WmRedraw,
WmReloadConfig,
- WmToggleFocusMode,
+ WmChangeFocusMode {
+ #[clap(long)]
+ toggle: bool,
+ },
+}
+
+#[derive(Args, Debug)]
+#[group(required = true, multiple = true)]
+pub struct InvokeChangeBordersCommand {
+ #[clap(long)]
+ width: Option<LengthValue>,
+
+ #[clap(long)]
+ height: Option<LengthValue>,
}
#[derive(Args, Debug)]
@@ -180,13 +205,3 @@ pub struct InvokeResizeCommand {
#[clap(long)]
height: Option<LengthValue>,
}
-
-#[derive(Args, Debug)]
-#[group(required = true, multiple = true)]
-pub struct InvokeAdjustBordersCommand {
- #[clap(long)]
- width: Option<LengthValue>,
-
- #[clap(long)]
- height: Option<LengthValue>,
-}
diff --git a/resources/sample-config.yaml b/resources/sample-config.yaml
index d406e6b3..32f6e614 100644
--- a/resources/sample-config.yaml
+++ b/resources/sample-config.yaml
@@ -15,7 +15,7 @@ general:
# Amount to move floating windows by (eg. when using `alt+<hjkl>` on a floating window)
floating_window_move_amount: '5%'
- # Whether to center new floating windows.
+ # Whether to center new floating windows by default.
center_new_floating_windows: true
# *Strongly* recommended to set to 'false'. Whether to globally enable/disable
@@ -69,7 +69,7 @@ window_rules:
match_class_name: 'Chrome_WidgetWin_1|MozillaDialogClass'
# Some applications (eg. Steam) have borders that extend past the normal border size.
- - commands: ['adjust_borders --right -7px --bottom -7px --left -7px']
+ - commands: ['change_borders --right -7px --bottom -7px --left -7px']
match_process_name: 'steam'
binding_modes:
@@ -125,23 +125,23 @@ keybindings:
bindings: ['Alt+R']
# Change tiling direction. This determines where new tiling windows will be inserted.
- - commands: ['toggle_tiling_direction']
+ - commands: ['change_tiling_direction --toggle']
bindings: ['Alt+V']
# Change focus between floating / tiling windows.
- - commands: ['wm_toggle_focus_mode']
+ - commands: ['wm_change_focus_mode --toggle']
bindings: ['Alt+Space']
# Change the focused window to be floating / tiling.
- - commands: ['toggle_floating --centered']
+ - commands: ['set_floating --centered --toggle']
bindings: ['Alt+Shift+Space']
# Change the focused window to be maximized / unmaximized.
- - commands: ['toggle_maximized']
+ - commands: ['set_maximized --toggle']
bindings: ['Alt+X']
# Minimize focused window.
- - commands: ['set_minimized']
+ - commands: ['set_minimized --toggle']
bindings: ['Alt+M']
# Close focused window.