From ec0e53095844900d884d7600867949d75a3a2051 Mon Sep 17 00:00:00 2001 From: spinach <19keegandeppe@gmail.com> Date: Tue, 21 Mar 2023 19:53:23 -0400 Subject: [PATCH] replaced xdotool with i3 polling script for cpu reduction --- bin/i3-focus.sh | 14 ++++++++++++++ editors/nvim/config/spell/en.utf-8.add | 5 +++++ editors/nvim/config/spell/en.utf-8.add.spl | Bin 70 -> 132 bytes gui/i3/base.conf | 3 ++- gui/polybar/config.ini | 8 +++++++- 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 bin/i3-focus.sh diff --git a/bin/i3-focus.sh b/bin/i3-focus.sh new file mode 100755 index 0000000..57fa2d7 --- /dev/null +++ b/bin/i3-focus.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# loops over i3 ipc events to prevent unnesecary polling + +while :; do + # infinite loop + i3_msg=$(i3-msg -t SUBSCRIBE '[ "window" , "output" ]') + window=$(echo "$i3_msg" | gojq 'if .change == "focus" then .container.window_properties end | if .title == "tmux" then .title else .class end' | tr -d '"') + case "$window" in + 'st-256color') echo 'st' ;; + 'Brave-browser') echo 'Brave' ;; + *) echo "$window" ;; + esac +done diff --git a/editors/nvim/config/spell/en.utf-8.add b/editors/nvim/config/spell/en.utf-8.add index dac80cf..3ca18f4 100644 --- a/editors/nvim/config/spell/en.utf-8.add +++ b/editors/nvim/config/spell/en.utf-8.add @@ -3,3 +3,8 @@ L3 Pset Kalynn Appt +EPR +S983 +Airpods +swiffer +postlab diff --git a/editors/nvim/config/spell/en.utf-8.add.spl b/editors/nvim/config/spell/en.utf-8.add.spl index 7ea7764a54f5e56ef655194ff7041188a697672b..b8c134e2101a13c75748af4033fe20a882081463 100644 GIT binary patch literal 132 zcmXAiK?;LF3`O&T^aL(Ehi+