From 26901a699a96da8ae527525c05733d132e0091d9 Mon Sep 17 00:00:00 2001 From: B Manoj Kumar Date: Mon, 12 Sep 2022 16:54:37 +0530 Subject: [PATCH] Updated afk alias "CGSession --suspend" is no longer supported in latest Mac OS versions. Alternative is osascript -e 'tell application \"System Events\" to keystroke \"q\" using {command down,control down}' Refer here: https://apple.stackexchange.com/questions/406616/replacement-for-cgsession-suspend --- .aliases | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.aliases b/.aliases index d708199c5..cc58c0455 100644 --- a/.aliases +++ b/.aliases @@ -135,7 +135,8 @@ alias pumpitup="osascript -e 'set volume 7'" alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill" # Lock the screen (when going AFK) -alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend" +# Reference: https://apple.stackexchange.com/questions/406616/replacement-for-cgsession-suspend +alias afk="osascript -e 'tell application \"System Events\" to keystroke \"q\" using {command down,control down}'" # Reload the shell (i.e. invoke as a login shell) alias reload="exec $SHELL -l"