From 4ad1cff80e9647d56ca336011777667e73848a56 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Mon, 20 Jun 2022 09:19:51 -0400 Subject: [PATCH] add changes from master --- .../Spoons/MoveWindow.spoon/init.lua | 17 ++++++++++++++++- modules/shell/git.nix | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/darwin/hammerspoon/Spoons/MoveWindow.spoon/init.lua b/modules/darwin/hammerspoon/Spoons/MoveWindow.spoon/init.lua index dc6071c..9de8ca4 100644 --- a/modules/darwin/hammerspoon/Spoons/MoveWindow.spoon/init.lua +++ b/modules/darwin/hammerspoon/Spoons/MoveWindow.spoon/init.lua @@ -17,7 +17,22 @@ function obj:init() local screen = win:screen() -- compute the unitRect of the focused window relative to the current screen -- and move the window to the next screen setting the same unitRect - win:move(win:frame():toUnitRect(screen:frame()), screen:next(), true, 0) + win:moveToScreen(screen:next(), true, true, 0) + end) + + hs.hotkey.bind({ "alt", "ctrl", "cmd" }, "b", function() + local win = hs.window.focusedWindow() + local screen = win:screen() + win:moveToScreen(screen:previous(), true, true, 0) + end) + + hs.hotkey.bind({ "alt", "ctrl", "cmd" }, "m", function() + -- get the focused window + local win = hs.window.focusedWindow() + -- maximize if possible + for i = 1, 8 do + win:maximize() + end end) end diff --git a/modules/shell/git.nix b/modules/shell/git.nix index da56122..3851f83 100644 --- a/modules/shell/git.nix +++ b/modules/shell/git.nix @@ -53,7 +53,8 @@ in { gl = "git log --graph --decorate --oneline -20"; gll = "git log --graph --decorate --oneline"; gco = "git checkout"; - gcom = "git switch master"; + gcom = '' + git switch (git symbolic-ref refs/remotes/origin/HEAD | cut -d"/" -f4)''; gcob = "git switch -c"; gb = "git branch"; gbd = "git branch -d";