Compare commits
No commits in common. "246535facdbecc18b27004400f685a599c4bf391" and "d3ba93257215b0ed2c8b3fc6259bb1357071e8c6" have entirely different histories.
246535facd
...
d3ba932572
4 changed files with 15 additions and 56 deletions
|
|
@ -15,18 +15,13 @@ all(){
|
||||||
sleep .2
|
sleep .2
|
||||||
xdotool key Left
|
xdotool key Left
|
||||||
;;
|
;;
|
||||||
"split_up")
|
"split_up" | "split_down")
|
||||||
debug "no op"
|
debug "no op"
|
||||||
;;
|
;;
|
||||||
"split_down")
|
|
||||||
echo "downstairs lights off"
|
|
||||||
source "$ROOT/.env"
|
|
||||||
curl -X POST -d '' $DOWNSTAIRS_LIGHTS_OFF
|
|
||||||
;;
|
|
||||||
"back")
|
"back")
|
||||||
echo "downstairs lights off"
|
echo "toggling livingroom lights"
|
||||||
source "$ROOT/.env"
|
source "$ROOT/.env"
|
||||||
curl -X POST -d '' $DOWNSTAIRS_LIGHTS_OFF
|
curl -X POST -d '' $LIVINGROOM_LIGHTS_ENDPOINT
|
||||||
;;
|
;;
|
||||||
"forward")
|
"forward")
|
||||||
echo "toggling kitchen lights"
|
echo "toggling kitchen lights"
|
||||||
|
|
@ -34,15 +29,10 @@ all(){
|
||||||
curl -X POST -d '' $KITCHEN_LIGHTS_ENDPOINT
|
curl -X POST -d '' $KITCHEN_LIGHTS_ENDPOINT
|
||||||
;;
|
;;
|
||||||
"split_right")
|
"split_right")
|
||||||
echo "toggling kitchen lights"
|
bluetoothctl disconnect 4C:B9:9B:11:4B:31
|
||||||
source "$ROOT/.env"
|
|
||||||
curl -X POST -d '' $KITCHEN_LIGHTS_ENDPOINT
|
|
||||||
;;
|
;;
|
||||||
"split_left")
|
"split_left")
|
||||||
#toggle_res
|
toggle_res
|
||||||
echo "toggling livingroom lights"
|
|
||||||
source "$ROOT/.env"
|
|
||||||
curl -X POST -d '' $LIVINGROOM_LIGHTS_ENDPOINT
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
### top buttons
|
### top buttons
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,10 @@ firefox_youtube(){
|
||||||
sleep .2
|
sleep .2
|
||||||
xdotool key k
|
xdotool key k
|
||||||
}
|
}
|
||||||
|
# kiosk
|
||||||
|
split_right(){
|
||||||
|
xdotool key F11
|
||||||
|
}
|
||||||
# go to yt.com in shared container
|
# go to yt.com in shared container
|
||||||
desktop(){
|
desktop(){
|
||||||
helpers
|
helpers
|
||||||
|
|
@ -36,13 +40,14 @@ firefox_youtube(){
|
||||||
}
|
}
|
||||||
|
|
||||||
firefox_pbs(){
|
firefox_pbs(){
|
||||||
|
firefox_init
|
||||||
|
|
||||||
split_up(){
|
split_up(){
|
||||||
xdotool mousemove 900 900
|
xdotool mousemove 500 300
|
||||||
xdotool click 1 click 1
|
xdotool click 1 click 1
|
||||||
}
|
}
|
||||||
play(){
|
play(){
|
||||||
xdotool mousemove 900 900
|
xdotool mousemove 500 300
|
||||||
xdotool click 1
|
xdotool click 1
|
||||||
}
|
}
|
||||||
desktop(){
|
desktop(){
|
||||||
|
|
|
||||||
9
cec.sh
9
cec.sh
|
|
@ -1,18 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
tv_on() {
|
tv_on() {
|
||||||
echo "on 0" > /run/cec.fifo
|
cec-ctl --to 0 --image-view-on
|
||||||
echo "on">~/scripts/PJ/tv_state
|
echo "on">~/scripts/PJ/tv_state
|
||||||
curl -X POST -d '' $REPORT_TV_ON
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tv_off() {
|
tv_off() {
|
||||||
echo "standby 0" > /run/cec.fifo
|
cec-ctl --to 0 --standby
|
||||||
echo "off">~/scripts/PJ/tv_state
|
echo "off">~/scripts/PJ/tv_state
|
||||||
curl -X POST -d '' $REPORT_TV_OFF
|
|
||||||
}
|
}
|
||||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
||||||
source "$ROOT/.env"
|
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" ]]; then
|
||||||
if grep -q off ~/scripts/PJ/tv_state; then
|
if grep -q off ~/scripts/PJ/tv_state; then
|
||||||
tv_on
|
tv_on
|
||||||
|
|
|
||||||
33
nix/cec.nix
33
nix/cec.nix
|
|
@ -1,33 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
boot.kernelModules = [ "cec" ];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
libcec
|
|
||||||
];
|
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
|
||||||
# Pulse-Eight CEC adapter
|
|
||||||
SUBSYSTEM=="tty" ACTION=="add" ATTRS{manufacturer}=="Pulse-Eight" ATTRS{product}=="CEC Adapter" GROUP="video" MODE="0660"
|
|
||||||
'';
|
|
||||||
|
|
||||||
systemd.sockets."cec-client" = {
|
|
||||||
wantedBy = [ "sockets.target" ];
|
|
||||||
socketConfig = {
|
|
||||||
ListenFIFO = "/run/cec.fifo";
|
|
||||||
SocketGroup = "video";
|
|
||||||
SocketMode = "0660";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services."cec-client" = {
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = ''${pkgs.libcec}/bin/cec-client -d 1 -o /dev/ttyACM0'';
|
|
||||||
ExecStop = ''/bin/sh -c "echo q > /run/cec.fifo"'';
|
|
||||||
StandardInput = "socket";
|
|
||||||
StandardOutput = "journal";
|
|
||||||
Restart = "on-failure";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue