Last active
March 7, 2024 17:49
-
-
Save noneofyourbusiness1415252/766c5847b02fa23e13ab562fc7fb7269 to your computer and use it in GitHub Desktop.
on login, automatically open onenote page for my current lesson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ ! -w /dev/tty/2 ]; then | |
weston & | |
times=("0915" "1010" "1120" "1315" "1410" "1505" "1600") | |
#blanks=lessons which don't need laptop | |
lessons=( | |
E-En3 M-Ma1 S-Sc1{,} "" G1-Gg E-En3 | |
M-Ma1{,} E-En3 S-Sc1 G1-Gg "" "" | |
E-En3{,} "" S-Sc1 "" "" G1-Gg | |
E-En3 M-Ma1 "" S-Sc1 "" "" S-Sc1 | |
E-En3 S-Sc1 G1-Gg M-Ma1) | |
printf -v day "%(%u)T" | |
printf -v now "%(%H%M)T" | |
if [ $day = 5 ]; then | |
times=("0905" "1010" "1100" "1150" "1240") | |
fi | |
for ((i = 0; i < ${#times[@]} - 1; i++)); do | |
if [ $now -lt ${times[i]} ]; then | |
lesson_start=$i | |
break | |
fi | |
done | |
if [ -v lesson_start ]; then | |
lesson_id=${lessons[((7 * (day - 1) + lesson_start))]} | |
sleep .1 | |
WAYLAND_DISPLAY=wayland-1 exec microsoft-edge-beta --kiosk --ozone-platform=wayland --no-sandbox "https://tauheedulschools.sharepoint.com/sites/Section_TIBHS-11${lesson_id}-2023-24-MT/SiteAssets/TIBHS 11${lesson_id} 2023-24 MT Notebook" | |
else | |
sleep .2 | |
WAYLAND_DISPLAY=wayland-1 weston-terminal | |
fi | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
printf(){: | |
} | |
day=5 | |
now=1239 | |
. <(tail -29 .profile) | |
unset printf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment