Skip to content

Instantly share code, notes, and snippets.

@rahulnshah
Last active January 15, 2023 23:50
Show Gist options
  • Select an option

  • Save rahulnshah/faacff418ee282f66055dfac87ac2986 to your computer and use it in GitHub Desktop.

Select an option

Save rahulnshah/faacff418ee282f66055dfac87ac2986 to your computer and use it in GitHub Desktop.
See Shortcuts on-the-go
#!/usr/bin/bash
# Author: Rahul Shah
# In your terminal, run this command first: export times=0. This will initialize a variable called times for this script to use
# When you run a script, your current shell, such as bash, launches a child shell, most often sh, to run the script. You can instead execute a script that modifies the current shell environment using the source. Execute this script as source see_shortcuts.sh to accurately see how many times you have called this script in your current shell.
# windows 10
if (test $times) then
hitTheUnkownCase=0
case $1 in
[Ww]in10 | [Ww]10 | [Ww]in[_-]10)
cat <<HERE
To move left one tab in Chrome, Ctrl + Shift + Tab
To move right one tab in Chrome, Ctrl + Tab
For xbox game bar, windows logo + G
For emojis press, windows logo + ;
To view copied things, Windows logo + V
For snip and sketch, windows logo + Shift + S
For magnifier and read aloud, windows logo + "+"
For shake and snap, just shake your window
To move separate windows around your screen, windows logo key + left or right arrow bring window to the left or right
To open task bar apps, windows logo + number
HERE
;;
[vV][sS][-_]code | [vV][sS]code | [vV][Cc]) # vs code
cat <<'HERE'
To open zen mode, Ctrl + K Z, press ESC twice to exit it
To access CMD pallete, Ctrl + Shift + P
To open the CMD line, Ctrl + `
HERE
;;
*)
hitTheUnkownCase=1
echo "shortcuts for $1 are unknown"
;;
esac
if (test $hitTheUnkownCase -eq 0) then
times=$((times + 1))
lastDigit=$((times % 10))
LCYAN='\033[1;36m'
NOCOLOR='\033[0m'
# ...And for a little boost of encouragement
echo -n "You have accessed this lookup for the "
if (test $lastDigit -eq 1) then
echo -e "${LCYAN}${times}st${NOCOLOR} time!"
elif (test $lastDigit -eq 2) then
echo -e "${LCYAN}${times}nd${NOCOLOR} time!"
elif (test $lastDigit -eq 3) then
echo -e "${LCYAN}${times}rd${NOCOLOR} time!"
else
echo -e "${LCYAN}${times}th${NOCOLOR} time!"
fi
fi
else
echo "Did you forget to run export times=0?"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment