-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrestart.sh
37 lines (31 loc) · 1.04 KB
/
restart.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# kAELogOut = 'logo',
# kAEReallyLogOut = 'rlgo',
# kAEShowRestartDialog = 'rrst',
# kAEShowShutdownDialog = 'rsdn'
#Shut down without showing a confirmation dialog:
#osascript -e 'tell app "System Events" to shut down'
#
#Shut down after showing a confirmation dialog:
#osascript -e 'tell app "loginwindow" to «event aevtrsdn»'
#
#Restart without showing a confirmation dialog:
#osascript -e 'tell app "System Events" to restart'
#
#Restart after showing a confirmation dialog:
#osascript -e 'tell app "loginwindow" to «event aevtrrst»'
#
#Log out without showing a confirmation dialog:
#osascript -e 'tell app "System Events" to «event aevtrlgo»'
#
#Log out after showing a confirmation dialog:
#osascript -e 'tell app "System Events" to log out'
#Go to sleep (pmset):
#pmset sleepnow
#
#Go to sleep (AppleScript):
#osascript -e 'tell app "System Events" to sleep'
#
#Put displays to sleep (10.9 and later):
#pmset displaysleepnow
osascript -e 'tell app "loginwindow" to "event aevtrrst"'