You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
477 B
Bash

#!/bin/bash
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
echo $SCRIPT_DIR
sudo tee /home/kuba/.config/systemd/user/g435-sink-switch.service <<EOF
[Unit]
Description=Switch audio sink to G435 when its volume rocker is pressed
After=pipewire-pulse.service
Wants=pipewire-pulse.service
[Service]
Type=simple
ExecStart=$SCRIPT_DIR/auto-switch-to-headphones.sh
Restart=always
RestartSec=5
Environment=XDG_RUNTIME_DIR=%t
[Install]
WantedBy=default.target
EOF