From 7b0f37451da08ad99c3ce10998d772c9603645ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Tue, 4 May 2021 03:39:39 +0300 Subject: Sway config and scripts changes * Hide cursor while typing globally * Move cursor to focused container * Improve swaygetcurrentwindow script, used by other scripts --- dotfiles/.config/foot/foot.ini | 3 --- dotfiles/.config/sway/config | 8 +++++--- dotfiles/.local/bin/swaygetcurrentwindow | 7 ++++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dotfiles/.config/foot/foot.ini b/dotfiles/.config/foot/foot.ini index b988e3f..871e793 100644 --- a/dotfiles/.config/foot/foot.ini +++ b/dotfiles/.config/foot/foot.ini @@ -1,9 +1,6 @@ dpi-aware = no font = monospace:size=10 -[mouse] -hide-when-typing = yes - [colors] foreground = fcf8e2 diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index c2824ab..f82c514 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -14,6 +14,9 @@ set $browser qutebrowser # Switch back to previously focused ws on ws switch command repeat workspace_auto_back_and_forth yes +# Move mouse to focused container +mouse_warping container + # Configure border style default_border pixel 2 default_floating_border pixel 2 @@ -106,10 +109,9 @@ for_window [app_id="telegramdesktop"] floating enable, sticky enable for_window [title="^ddterminal$"] floating enable, sticky enable #for_window [title="^ddterminal$"] border none -# Laptop lid -bindswitch --reload --locked lid:on exec "swaysession suspend" +# Don't display mouse cursor while typing +seat * hide_cursor when-typing enable -# Trackpoint (Thinkpad) input 2:10:TPPS/2_IBM_TrackPoint { accel_profile flat pointer_accel 0.8 diff --git a/dotfiles/.local/bin/swaygetcurrentwindow b/dotfiles/.local/bin/swaygetcurrentwindow index e6403a6..4489115 100755 --- a/dotfiles/.local/bin/swaygetcurrentwindow +++ b/dotfiles/.local/bin/swaygetcurrentwindow @@ -1,5 +1,6 @@ #!/bin/sh -xydata=$(swaymsg -t get_tree | grep -B 5 '"focused": true' | head -n 4 | tr -d '\n\r' | sed -e 's/[^0-9,]//g' -e 's/,/ /2' -e 's/,/x/2') - -echo $xydata +echo "$(swaymsg -t get_tree |\ + jq 'recurse(.nodes[]) | if .focused then .rect else empty end' |\ + tr -d '\n\r' |\ + sed -e 's/[^0-9,]//g' -e 's/,/ /2' -e 's/,/x/2')" -- cgit v1.2.3