-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinitrc
55 lines (45 loc) · 1.84 KB
/
initrc
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
# This configuration file describes a minimal example for a Catacomb config.
#
# The following applications should be installed or replaced:
# - tremor: Used for vibration effects (/~https://github.com/catacombing/tremor)
# - epitaph: Panel (/~https://github.com/catacombing/epitaph)
# - tzompantli: Application launcher (/~https://github.com/catacombing/tzompantli)
# - squeekboard: Virtual Keyboard (https://gitlab.gnome.org/World/Phosh/squeekboard)
# - swayidle: Automatic idle timeouts (/~https://github.com/swaywm/sway)
# Exit on error
set -e
# Key Bindings
## Ignore power-button press, to allow binding to it
systemd-inhibit --what handle-power-key sleep infinity &
## Launch `tzompantli` when holding the power button
catacomb msg bind-key --on-press '*' XF86PowerOff bash -c \
"sleep 0 0 0 0 0 0 0 0.5 && \
if [ \"\$(catacomb msg dpms)\" == \"on\" ]; then \
(tremor 100 0 1; tzompantli) \
fi"
## Turn off display when pressing the power button
catacomb msg bind-key '*' XF86PowerOff bash -c \
"if pkill -xf -9 \"sleep 0 0 0 0 0 0 0 0.5\"; then \
if [ \"\$(catacomb msg dpms)\" == \"on\" ]; then \
catacomb msg dpms off; \
else \
catacomb msg dpms on; \
fi \
fi"
## Allow manually toggling the virtual keyboard
catacomb msg bind-key '*' EnableVirtualKeyboard \
busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
catacomb msg bind-key '*' AutoVirtualKeyboard \
busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false
# Spawn background apps
squeekboard &
epitaph &
# Turn off display after 3 minutes, suspend 30s later
swayidle -w \
timeout 180 'catacomb msg dpms off' \
resume 'catacomb msg dpms on' \
timeout 210 'systemctl suspend' \
after-resume 'catacomb msg dpms on' &
# Wait for completion
wait