Created
November 22, 2021 19:57
-
-
Save augustin64/2c32634751ad6ffbcaeb9993b7e70ec4 to your computer and use it in GitHub Desktop.
Self-describing
This file contains hidden or 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
| #!/usr/bin/sh | |
| run() { | |
| number=$1 | |
| shift | |
| for _ in $(seq $number); do | |
| $@ | |
| done | |
| } | |
| # Récupération des périphériques d'entrée connectés | |
| devices=$(xinput list | grep -E "slave" | awk -Fid= '{print $2}' | awk '{print $1}') | |
| # Désactive les périphériques 1 à 1 | |
| for i in $devices; do | |
| xinput set-prop "$i" "Device Enabled" 0 | |
| done; | |
| # Si le son est désactivé, il est activé à nouveau | |
| if [[ $(pacmd list-sinks | awk '/muted/ {print $2}') == "yes" ]]; then | |
| amixer set Master toggle | |
| fi; | |
| # Appuie 100 fois sur la touche volume+ | |
| run 100 "xdotool key XF86AudioRaiseVolume" | |
| # Ouvre le rickroll | |
| xdg-open https://www.youtube.com/watch\?v\=dQw4w9WgXcQ & | |
| # Mettre le focus sur Firefox | |
| xdotool windowactivate $(xdotool search --class Firefox) | |
| # Attend que la page charge | |
| sleep 5 | |
| # Met en plein écran | |
| xdotool key f | |
| # Attend que la vidéo se termine | |
| sleep 212 | |
| # Réactive les périphériques | |
| for i in $devices; do | |
| xinput set-prop "$i" "Device Enabled" 1 | |
| done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment