Skip to content

Commit

Permalink
Add example configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisduerr committed Feb 18, 2024
1 parent 883c346 commit dd051cd
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Catacomb is configured through IPC using `catacomb msg`.
For persistent configuration or to launch applications on startup, Catacomb
automatically loads `$XDG_CONFIG_HOME/catacomb/post_start.sh` (or
`~/.config/catacomb/post_start.sh` if `XDG_CONFIG_HOME` is not defined).

You can find an example configuration [here](./post_start.sh).
52 changes: 52 additions & 0 deletions post_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh

# This configuration file describes a minimal example for a usable mobile
# experience.
#
# 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)

# 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"

# Per-application scale overrides
catacomb msg scale --app-id firefox 1.5

# 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

0 comments on commit dd051cd

Please sign in to comment.