aboutsummaryrefslogtreecommitdiff
path: root/home/dot_local/share/bin/executable_wacommode
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2026-08-02 14:48:29 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2026-08-02 14:48:29 +0200
commite43eb1177872f52e949fb5f0f93396ed94b0d093 (patch)
tree78b73af6a989fa2996d71b112e161b70d35081ef /home/dot_local/share/bin/executable_wacommode
parent2f14a896e4b897bd747c24d7ad8e9e7bb3237d03 (diff)
move to chezmoi
Diffstat (limited to 'home/dot_local/share/bin/executable_wacommode')
-rw-r--r--home/dot_local/share/bin/executable_wacommode58
1 files changed, 58 insertions, 0 deletions
diff --git a/home/dot_local/share/bin/executable_wacommode b/home/dot_local/share/bin/executable_wacommode
new file mode 100644
index 0000000..2563895
--- /dev/null
+++ b/home/dot_local/share/bin/executable_wacommode
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+defaults () {
+ # smoothing
+ setwacom Suppress 2
+ setwacom RawSample 5
+
+ # full pen area
+ setwacom Area 0 0 15200 9500
+
+ setwacom Rotate none
+}
+
+notify() {
+ notify-send \
+ --replace-id=99999 \
+ --icon=/dev/null \
+ --expire-time=1000 \
+ -- \
+ 'ワコム' "$*"
+}
+
+SCREEN_1_GEOMETRY="$(xrandr -q | awk '$2 == "connected" && $3 == "primary" { print $4 }')"
+SCREEN_2_GEOMETRY="$(xrandr -q | awk '$2 == "connected" && $3 != "primary" { print $3 }')"
+ALL_GEOMETRY="$(xrandr -q | awk '$1 == "Screen" { print ; exit }' | grep -o '\<current\>[^,]\+' | sed -e 's/^current//' -e 's/ //g' -e 's/$/+0+0/')"
+
+topleft() {
+ notify "画面1、横"
+
+ setwacom MapToOutput "$SCREEN_1_GEOMETRY"
+}
+
+bottomleft() {
+ notify "画面2、縦"
+
+ setwacom Rotate ccw
+ setwacom MapToOutput "$SCREEN_2_GEOMETRY"
+}
+
+topright() {
+ notify "画面1、横、低遅延"
+
+ setwacom Suppress 0
+ setwacom RawSample 1
+
+ setwacom Area 0 1623 7600 5898
+ setwacom MapToOutput "$SCREEN_1_GEOMETRY"
+}
+
+bottomright() {
+ notify "全ての画面、横"
+
+ setwacom Area 0 0 11875 7600
+ setwacom MapToOutput "$ALL_GEOMETRY"
+}
+
+defaults
+$1