Compare commits
No commits in common. "afe1ccd1fc7d22d51b962fb1f940ea2ffe26cc6e" and "240764957932e982de8b61100df181f8b3dce64e" have entirely different histories.
afe1ccd1fc
...
2407649579
5 changed files with 50 additions and 24 deletions
19
bash/.bashrc
19
bash/.bashrc
|
@ -54,15 +54,13 @@ function sshunlock() {
|
|||
|
||||
# Show a menu of all known Tailscale nodes for the user to select from
|
||||
function tsselect() {
|
||||
local jq_filter="$1"
|
||||
[ -z "$jq_filter" ] && jq_filter=".Peer[] | .DNSName"
|
||||
|
||||
local items=()
|
||||
while read -r line; do
|
||||
[ -z "$line" ] && continue
|
||||
[[ "$line" =~ ^\# ]] && continue
|
||||
items+=("$line")
|
||||
done <<< $(tailscale status -json | jq -r "$jq_filter" | sort)
|
||||
local name=$(echo "$line" | awk '{ print $2 }')
|
||||
items+=("$name")
|
||||
done <<< $(tailscale status --self=false | sort -k 2)
|
||||
|
||||
_COLUMNS=$COLUMNS
|
||||
# Force options to display in one column
|
||||
|
@ -144,17 +142,6 @@ function moshwezscrts() {
|
|||
moshwez $(tsselect) -- screen -RR -d
|
||||
}
|
||||
|
||||
# Switch tailscale exit nodes
|
||||
function tsexit() {
|
||||
echo "Current exit node: $(tailscale status -json | jq -r ".Peer[] | select(.ExitNode == true) | .DNSName")"
|
||||
local newsel="$(tsselect ".Peer[] | select(.ExitNodeOption == true) | .DNSName")"
|
||||
[ -z "$newsel" ] || sudo tailscale set --exit-node="$newsel" --exit-node-allow-lan-access=true
|
||||
}
|
||||
|
||||
function tsnoexit() {
|
||||
sudo tailscale set --exit-node="" --exit-node-allow-lan-access=false
|
||||
}
|
||||
|
||||
# Add local to path
|
||||
export PATH="$PATH:~/.local/bin"
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[D-BUS Service]
|
||||
Name=org.freedesktop.secrets
|
||||
Exec=/usr/bin/kwalletd6
|
|
@ -46,8 +46,3 @@ window-rule {
|
|||
match is-active=false
|
||||
opacity 0.98
|
||||
}
|
||||
|
||||
window-rule {
|
||||
match app-id=r#"mpv$"#
|
||||
default-column-width { proportion 0.9; }
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=ClockworkPi Audio Service (3.5mm / speaker switching)
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/clockworkpi-audio-patch
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
38
uconsole-rootfs/usr/local/bin/clockworkpi-audio-patch
Executable file
38
uconsole-rootfs/usr/local/bin/clockworkpi-audio-patch
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ $UID -ne 0 ]; then
|
||||
echo "Please run as root!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! which pinctrl; then
|
||||
echo "Please install pinctrl (raspberrypi-utils)!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cleanup() {
|
||||
echo "Disabling speaker before exitting"
|
||||
# Disable speaker when this script exits
|
||||
pinctrl set 11 dl
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
# Initialize GPIO pin 10 (3.5mm sense)
|
||||
pinctrl set 10 ip pn
|
||||
# Pin 11 (speaker)
|
||||
pinctrl set 11 op
|
||||
|
||||
while true; do
|
||||
if pinctrl 10 | grep -q "lo"; then
|
||||
echo "Enabling speaker"
|
||||
pinctrl set 11 op dh
|
||||
else
|
||||
echo "Disabling speaker"
|
||||
pinctrl set 11 op dl
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
Loading…
Add table
Reference in a new issue