4
#FIXME: Auto detect DM?
5
__DM_TOOL="dm-tool lock"
8
function __auto_system () {
9
if [[ -n $(which systemctl) ]]; then
11
elif [[ -n $(which dbus-send) ]]; then
13
elif [[ $(which loginctl) ]]; then
15
elif [[ -n $(which pm-suspend) ]]; then
18
echo "UNSUPORTED SYSTEM!?"
23
function __suspend() {
25
if [[ $__SYSTEM == "systemd" ]]; then
27
systemctl suspend-then-hibernate
28
elif [[ $__SYSTEM == "dbus" ]]; then
30
bus-send --system --print-reply\
31
--dest=org.freedesktop.login1 /org/freedesktop/login
32
"org.freedesktop.login1.Manager.Suspend"\
34
elif [[ $__SYSTEM == "loginctl" ]]; then
37
elif [[ $__SYSTEM == "pm" ]]; then
41
echo "UNSUPORTED SYSTEM!?"
46
function __parse_args() {
48
echo "Argurment parsing is not implemented yet!"
52
if [[ $# != 0 ]]; then