blob: 5f2a524af8cc94be84d5c1358b81a4b49b30f667 (
plain) (
blame)
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
|
#!/usr/bin/env dash
# nixos-config - My current NixOS configuration
#
# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of my nixos-config.
#
# You should have received a copy of the License along with this program.
# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
# TODO(@bpeetz): The task context reset functionality could be moved to `tskm`. <2025-04-14>
# TODO: This whole script should be a systemd service with Before=hibernate.target <2026-06-26>
context="$(task _get rc.context)"
[ "$context" ] && task context none
# We have ensured that only one task is active
active="$(task +ACTIVE _ids)"
[ "$active" ] && task stop "$active"
# Make sure that the swayidle service is actually running. Otherwise we don't get a
# screenlock upon hibernate-resume.
systemctl --user start swayidle.service
systemctl hibernate "$@"
# vim: ft=sh
|