From 35cab3cb5a1ce92cec602226cd0c9deb8925de37 Mon Sep 17 00:00:00 2001 From: Julian T Date: Mon, 6 Feb 2023 22:37:59 +0100 Subject: Create auto run stuff --- config.yaml | 2 +- intcp/intcp/main.c | 27 --------------------------- intcp/intcp/udevmon.yaml | 4 ---- intcp/resc/intcp/main.c | 27 +++++++++++++++++++++++++++ intcp/resc/intcp/udevmon.yaml | 4 ++++ intcp/resc/run/00-intcp | 9 +++++++++ resc/resc/run.sh | 9 +++++++++ scripts/resc/run/00-setwall | 8 ++++++++ 8 files changed, 58 insertions(+), 32 deletions(-) delete mode 100644 intcp/intcp/main.c delete mode 100644 intcp/intcp/udevmon.yaml create mode 100644 intcp/resc/intcp/main.c create mode 100644 intcp/resc/intcp/udevmon.yaml create mode 100755 intcp/resc/run/00-intcp create mode 100755 resc/resc/run.sh create mode 100755 scripts/resc/run/00-setwall diff --git a/config.yaml b/config.yaml index 352d690..2215627 100644 --- a/config.yaml +++ b/config.yaml @@ -5,6 +5,6 @@ do_not_link: - .config/nvim - .vim - Scripts - - intcp - .config/mpd - resc + - resc/run diff --git a/intcp/intcp/main.c b/intcp/intcp/main.c deleted file mode 100644 index 383ef5b..0000000 --- a/intcp/intcp/main.c +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -#include - -int main(void) { - setbuf(stdin, NULL); setbuf(stdout, NULL); - - struct input_event event; - while (fread(&event, sizeof(event), 1, stdin)) { - if (event.type == EV_KEY) { - switch (event.code) { - case KEY_CAPSLOCK: - event.code = KEY_LEFTCTRL; - break; - case KEY_LEFTALT: - event.code = KEY_LEFTMETA; - break; - case KEY_102ND: - event.code = KEY_LEFTALT; - break; - } - } - - fwrite(&event, sizeof(event), 1, stdout); - } -} - diff --git a/intcp/intcp/udevmon.yaml b/intcp/intcp/udevmon.yaml deleted file mode 100644 index 3733456..0000000 --- a/intcp/intcp/udevmon.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- JOB: "intercept -g $DEVNODE | /home/julian/intcp/intcp | uinput -d $DEVNODE" - DEVICE: - EVENTS: - EV_KEY: [ KEY_CAPSLOCK, KEY_LEFTALT, KEY_102ND ] diff --git a/intcp/resc/intcp/main.c b/intcp/resc/intcp/main.c new file mode 100644 index 0000000..383ef5b --- /dev/null +++ b/intcp/resc/intcp/main.c @@ -0,0 +1,27 @@ +#include +#include +#include + +int main(void) { + setbuf(stdin, NULL); setbuf(stdout, NULL); + + struct input_event event; + while (fread(&event, sizeof(event), 1, stdin)) { + if (event.type == EV_KEY) { + switch (event.code) { + case KEY_CAPSLOCK: + event.code = KEY_LEFTCTRL; + break; + case KEY_LEFTALT: + event.code = KEY_LEFTMETA; + break; + case KEY_102ND: + event.code = KEY_LEFTALT; + break; + } + } + + fwrite(&event, sizeof(event), 1, stdout); + } +} + diff --git a/intcp/resc/intcp/udevmon.yaml b/intcp/resc/intcp/udevmon.yaml new file mode 100644 index 0000000..3733456 --- /dev/null +++ b/intcp/resc/intcp/udevmon.yaml @@ -0,0 +1,4 @@ +- JOB: "intercept -g $DEVNODE | /home/julian/intcp/intcp | uinput -d $DEVNODE" + DEVICE: + EVENTS: + EV_KEY: [ KEY_CAPSLOCK, KEY_LEFTALT, KEY_102ND ] diff --git a/intcp/resc/run/00-intcp b/intcp/resc/run/00-intcp new file mode 100755 index 0000000..eac7900 --- /dev/null +++ b/intcp/resc/run/00-intcp @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -e +set -x +echo Running intcp + +cd ~/resc/intcp + +gcc main.c -o intcp +sudo cp udevmon.yaml /etc/interception/udevmon.yaml diff --git a/resc/resc/run.sh b/resc/resc/run.sh new file mode 100755 index 0000000..5f1c1c4 --- /dev/null +++ b/resc/resc/run.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e +set -x + +for f in ~/resc/run/*; do + $f +done + diff --git a/scripts/resc/run/00-setwall b/scripts/resc/run/00-setwall new file mode 100755 index 0000000..c68367c --- /dev/null +++ b/scripts/resc/run/00-setwall @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e +set -x +echo Running setwall install + +cd ~/resc/setwall + +cargo install --path . -- cgit v1.2.3