2022-10-20 10:54:08 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
SWAYSOCK=/run/user/$(id -u)/sway-ipc.sock
|
|
|
|
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u)/bus"
|
|
|
|
export SWAYSOCK
|
|
|
|
export DBUS_SESSION_BUS_ADDRESS
|
|
|
|
|
2023-01-26 21:36:52 +01:00
|
|
|
if thinkpad-is-docked; then
|
|
|
|
if [[ $(emacsclient -n -e "(org-clocking-p)") == "t" ]]; then
|
|
|
|
notify-send "OrgMode $(org-get-current-clock-task)" "Clocking out of current task because of inactivity."
|
|
|
|
org-clock-out
|
|
|
|
fi;
|
2023-04-21 13:10:55 +02:00
|
|
|
doas /run/current-system/sw/bin/systemctl suspend;
|
2022-10-20 10:54:08 +02:00
|
|
|
fi;
|